From patchwork Wed Jul 6 16:44:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emese Revfy X-Patchwork-Id: 9216683 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 01479608A6 for ; Wed, 6 Jul 2016 16:38:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E896B27D5D for ; Wed, 6 Jul 2016 16:38:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DCFA927D4D; Wed, 6 Jul 2016 16:38:28 +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 11B3127D4D for ; Wed, 6 Jul 2016 16:38:27 +0000 (UTC) Received: (qmail 9551 invoked by uid 550); 6 Jul 2016 16:38:24 -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 9506 invoked from network); 6 Jul 2016 16:38:20 -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=T3TV7z7X8qwsbUxs2srFZwO0hpxXiFMSu3cSMSd0Y2B/QYLShi1RJoewcNsgdUZ0By ApvwjwwCYEq+zAJ5m/LgpGpi6yZauLo8RykIula2zsMIApyTWvJOd+x//KKFiznl9SZT 72dcXPKvZkChxX45xygGoY6vkM+Z+7QGcX/IPWKzChDfRQ9hpggnTEIi+1wLeBtTrXK6 T8Z4FfB8MOnqgd5Ln+z51tZk7gFzKS/37Bwla6WmT3lbp7seEbOJuZ5hAj8ydBTEy7x4 rv/6run1OPob6X1exnx2FVkOnP2ihTQtfAS12QZLI3MbmTo8d5sMZZc+SkqQtLxCM9Gi jgOA== 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=ginGqPVB+9KMFhwm2ez1u26UQvYKnOaJ+0LZkobr0BZAYYvVYByv7tsEri6F7bZIl3 XNl4SGjm4TgJ9VAPfHJwvVqXfapQTBNxFwAmHkW4Lzz3m8LvsZT8hytBJNiChkkz1o0U PS4c2uZea+nEDMHrzzq3iUj2jq7C+vSbanW2VbQTE6E8X7yIersZEvtvBccnMSfMFaAH 54NUK9N1H2G5XTEh7w2LyunsZXVfAthySyVsdqAhlVDU6wZYbCyqwxqT3F/Y8JZiGdB+ VclUJkGUwwMY7lPMbWyBjerv1RO2kDKLVmypg/oxZWxflDVvY6qUcXPn5ynVwJtWb5Yx fqcw== X-Gm-Message-State: ALyK8tKfi0LdS82TnTYzpq9lCa9AwFO/B4V86Q9W+ohHUbuvfZTvYqZuB2wEAeb7Iw67AQ== X-Received: by 10.28.187.134 with SMTP id l128mr20981976wmf.51.1467823088036; Wed, 06 Jul 2016 09:38:08 -0700 (PDT) Date: Wed, 6 Jul 2016 18:44:28 +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: <20160706184428.ea8500af0297971892249dc6@gmail.com> In-Reply-To: <20160705014315.c44b7c41fcb6900e10d9f4a2@gmail.com> References: <20160705013928.396ce4a7cbbc40e6c09efc43@gmail.com> <20160705014315.c44b7c41fcb6900e10d9f4a2@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 v2 3/3] 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);