From patchwork Tue Jul 26 20:42:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emese Revfy X-Patchwork-Id: 9248827 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 AE5036077C for ; Tue, 26 Jul 2016 20:24:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9D5E826223 for ; Tue, 26 Jul 2016 20:24:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8D9A9272AA; Tue, 26 Jul 2016 20:24:15 +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=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1D5A626223 for ; Tue, 26 Jul 2016 20:24:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757368AbcGZUYO (ORCPT ); Tue, 26 Jul 2016 16:24:14 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:33443 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757322AbcGZUYN (ORCPT ); Tue, 26 Jul 2016 16:24:13 -0400 Received: by mail-wm0-f68.google.com with SMTP id o80so3414605wme.0; Tue, 26 Jul 2016 13:24:12 -0700 (PDT) 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=NR/PXGpKSanalVYwErC9cmYpLBoyT8lmZirho+S2WTw=; b=BxOcP6jrf8FOTF2mcmR1DR5X3G1SP6/KsjrOuu0CWEKucTJ/xF3WGHy/fmOrfk9Oab 1B4zGrYjJnu9RIYXCr3xXOB7ZC1+AerNMgRyqQx12xlSA4HF/13It8zSln+DITzbVoae 2GmI8RiVS0aSMzDkJqOn1yhC7AxE2FLMbSi3eyyWdYoKsa5ubRC9YPrRuTP5z1EuCBnU R8IorPtdjx3zkONXHoEk+1hPdZDg4Muypco2gjJnMnLpijkGKD1qerdjbREMQiB9C878 d41GuWvnxktuG6KZxQj0C3BYOuPTWWjnCqwSuCwszUcYsJHxAF11wVR4RfGKLc96LOKw aMDg== 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=NR/PXGpKSanalVYwErC9cmYpLBoyT8lmZirho+S2WTw=; b=fAjv5wd0BUUy5i4Tfdkzr8Gb8nuoZV4n4dvxHZsY9T2jfAKlx5Kz71z9TTIPBV3EV4 F4uOIyCz0w6w0fuYZ5PA5BU9b9ous9dUc+BdCp7tbYIEHhVclDM8DPmHeKdwAeTYTIIa 0mts4/wbqw+cMgr+974wAAI3+jXQwUKf7KrpFSXD2mW4EXDAJp6Onanb5ya3+TjliB4E ccnGtQklyxNmmevMtjdm/Wh0o/dg5mcmkGXIlSgZ2D6z4fukBg8R+xgbsbND0s/+zkEH Cy84zAWKlmVnQfEx320DaJ9oZHWvgOqmKFwqXpqlhafUg2/R6N3fV6VlRPd4wlcvNCwT 2v4w== X-Gm-Message-State: AEkoouv+sxMGGBpcipkVFBtoxbBbhohSq74lP+XcIWdw+K2W3WN/YYRWKccMA7QhPg5LLA== X-Received: by 10.194.205.166 with SMTP id lh6mr25484101wjc.114.1469564651716; Tue, 26 Jul 2016 13:24:11 -0700 (PDT) Received: from vakond.lan (beleg.madhouse-project.org. [128.199.36.147]) by smtp.gmail.com with ESMTPSA id xa2sm2697085wjc.0.2016.07.26.13.24.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Jul 2016 13:24:11 -0700 (PDT) Date: Tue, 26 Jul 2016 22:42:34 +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 Subject: [PATCH v3 6/7] Mark a few functions with the printf attribute Message-Id: <20160726224234.c680b28a327365604664cb2b@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 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This allows not only compile time format string checking but can also increase the coverage of the initify plugin. Signed-off-by: Emese Revfy --- drivers/scsi/esas2r/esas2r_log.h | 4 ++-- include/acpi/acpiosxf.h | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/esas2r/esas2r_log.h b/drivers/scsi/esas2r/esas2r_log.h index 7b6397b..75b9d23 100644 --- a/drivers/scsi/esas2r/esas2r_log.h +++ b/drivers/scsi/esas2r/esas2r_log.h @@ -61,8 +61,8 @@ enum { #endif }; -int esas2r_log(const long level, const char *format, ...); -int esas2r_log_dev(const long level, +__printf(2, 3) int esas2r_log(const long level, const char *format, ...); +__printf(3, 4) int esas2r_log_dev(const long level, const struct device *dev, const char *format, ...); diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h index 562603d..7ee4475 100644 --- a/include/acpi/acpiosxf.h +++ b/include/acpi/acpiosxf.h @@ -337,11 +337,12 @@ acpi_status acpi_os_signal(u32 function, void *info); * Debug print routines */ #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_printf +__printf(1, 2) void ACPI_INTERNAL_VAR_XFACE acpi_os_printf(const char *format, ...); #endif #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_vprintf -void acpi_os_vprintf(const char *format, va_list args); +__printf(1, 0) void acpi_os_vprintf(const char *format, va_list args); #endif #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_redirect_output