From patchwork Tue Jul 26 20:39:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emese Revfy X-Patchwork-Id: 9248813 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8171A6077C for ; Tue, 26 Jul 2016 20:21:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7484A26B39 for ; Tue, 26 Jul 2016 20:21:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 68AC0272AA; Tue, 26 Jul 2016 20:21:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by mail.wl.linuxfoundation.org (Postfix) with SMTP id 95C1426B39 for ; Tue, 26 Jul 2016 20:21:34 +0000 (UTC) Received: (qmail 21861 invoked by uid 550); 26 Jul 2016 20:21:33 -0000 Mailing-List: contact kernel-hardening-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: kernel-hardening@lists.openwall.com Delivered-To: mailing list kernel-hardening@lists.openwall.com Received: (qmail 21797 invoked from network); 26 Jul 2016 20:21:23 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3qGPwcyKF1J2rGoM7dnPVQTKJLwzUAeFCfcM0XaeT48=; b=mLVlUuakQpOyG3pRi1blzueJpuT6Wgy8qQwsmUFyrRcoqZ65s4iodInaad0j5lLwdi MfzIGH7UBqAO2a7SsFyYrB7NpZyrYTpfLe5i2LvCAApL/EkzzS1zxsGqTSJ77RA6u+xd kWBohzgVP49BHDUpnTgPJRNmvD/7nD4BXgZkddqlN9X3DQvVYrW/w82oiGL1LMcJojId 9PM0Dhrvr1wxofkYjHvqWUPM/4SPUee9jIZ5bvp+6kusxTUvv63iXp+AVVyZ/0MIR1z8 Gr1NC7X2lIlpi8pvm9kILN7SGDjmMla1xlR9IYPZVYBr7nKCSyVIK336gHj/Xho4ymCC Er2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3qGPwcyKF1J2rGoM7dnPVQTKJLwzUAeFCfcM0XaeT48=; b=i7BqZnXywRiAJxgeke3gp6MBZirE3wESQ+4d58M5WHjkn8FxMFOrphnj2RSa7H1fIk Kfmkdbhdkli+bZdzeP2Fh37whLp5Q/1KE04/2rVWI2iEkcOC7bPbdm9XtNNgYJ55uEBC Lwrrat2CwVTJNL77wCP6sD9hMcck3dzCwl0XRJX2PuVCT3SSEtG11robetfifI3Hjl8P U9EUtf1HWpB3XTMUl8mG+Ri6uB0beoOoDdgABcFaH5gn0kZak1Ak+Ekl59tk9HtOlV1N UssgEj0r0aUi/aH8QK8ekKRe/G3qr1sXUmgGgMFrQOi5U0k80SmDUgOE7nP/BepZilwh V6uw== X-Gm-Message-State: AEkoouvL5eEOcEyxi/QSY6mtIDvxa7Q6K5ke9OKWDb04uPegQ8tuZmv8sj7+I75jQcr68w== X-Received: by 10.194.107.33 with SMTP id gz1mr25935733wjb.178.1469564472357; Tue, 26 Jul 2016 13:21:12 -0700 (PDT) Date: Tue, 26 Jul 2016 22:39:35 +0200 From: Emese Revfy To: kernel-hardening@lists.openwall.com Cc: pageexec@freemail.hu, spender@grsecurity.net, mmarek@suse.com, keescook@chromium.org, linux-kernel@vger.kernel.org, yamada.masahiro@socionext.com, linux-kbuild@vger.kernel.org, minipli@ld-linux.so, linux@armlinux.org.uk, catalin.marinas@arm.com, linux@rasmusvillemoes.dk, david.brown@linaro.org, benh@kernel.crashing.org, tglx@linutronix.de, akpm@linux-foundation.org, jlayton@poochiereds.net, arnd@arndb.de, sam@ravnborg.org, isdn@linux-pingi.de Message-Id: <20160726223935.403f0994a64a6f72ef91b4f1@gmail.com> In-Reply-To: <20160726223541.513ce76f6de65389da6a6abe@gmail.com> References: <20160726223541.513ce76f6de65389da6a6abe@gmail.com> X-Mailer: Sylpheed 3.5.0 (GTK+ 2.24.30; x86_64-pc-linux-gnu) Mime-Version: 1.0 Subject: [kernel-hardening] [PATCH v3 3/7] Constify some function parameters X-Virus-Scanned: ClamAV using ClamSMTP Initify needs const pointer types, the initify plugin caught some __printf arguments that weren't const yet. Signed-off-by: Emese Revfy --- drivers/isdn/hisax/config.c | 16 ++++++++-------- drivers/isdn/hisax/hisax.h | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/isdn/hisax/config.c b/drivers/isdn/hisax/config.c index bf04d2a..2d12c6c 100644 --- a/drivers/isdn/hisax/config.c +++ b/drivers/isdn/hisax/config.c @@ -659,7 +659,7 @@ int jiftime(char *s, long mark) static u_char tmpbuf[HISAX_STATUS_BUFSIZE]; -void VHiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt, +void VHiSax_putstatus(struct IsdnCardState *cs, char *head, const char *fmt, va_list args) { /* if head == NULL the fmt contains the full info */ @@ -669,23 +669,24 @@ void VHiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt, u_char *p; isdn_ctrl ic; int len; + const u_char *data; if (!cs) { printk(KERN_WARNING "HiSax: No CardStatus for message"); return; } spin_lock_irqsave(&cs->statlock, flags); - p = tmpbuf; if (head) { + p = tmpbuf; p += jiftime(p, jiffies); p += sprintf(p, " %s", head); p += vsprintf(p, fmt, args); *p++ = '\n'; *p = 0; len = p - tmpbuf; - p = tmpbuf; + data = tmpbuf; } else { - p = fmt; + data = fmt; len = strlen(fmt); } if (len > HISAX_STATUS_BUFSIZE) { @@ -699,13 +700,12 @@ void VHiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt, if (i >= len) i = len; len -= i; - memcpy(cs->status_write, p, i); + memcpy(cs->status_write, data, i); cs->status_write += i; if (cs->status_write > cs->status_end) cs->status_write = cs->status_buf; - p += i; if (len) { - memcpy(cs->status_write, p, len); + memcpy(cs->status_write, data + i, len); cs->status_write += len; } #ifdef KERNELSTACK_DEBUG @@ -729,7 +729,7 @@ void VHiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt, } } -void HiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt, ...) +void HiSax_putstatus(struct IsdnCardState *cs, char *head, const char *fmt, ...) { va_list args; diff --git a/drivers/isdn/hisax/hisax.h b/drivers/isdn/hisax/hisax.h index 6ead6314..338d040 100644 --- a/drivers/isdn/hisax/hisax.h +++ b/drivers/isdn/hisax/hisax.h @@ -1288,9 +1288,9 @@ int jiftime(char *s, long mark); int HiSax_command(isdn_ctrl *ic); int HiSax_writebuf_skb(int id, int chan, int ack, struct sk_buff *skb); __printf(3, 4) -void HiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt, ...); +void HiSax_putstatus(struct IsdnCardState *cs, char *head, const char *fmt, ...); __printf(3, 0) -void VHiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt, va_list args); +void VHiSax_putstatus(struct IsdnCardState *cs, char *head, const char *fmt, va_list args); void HiSax_reportcard(int cardnr, int sel); int QuickHex(char *txt, u_char *p, int cnt); void LogFrame(struct IsdnCardState *cs, u_char *p, int size);