All of lore.kernel.org
 help / color / mirror / Atom feed
From: Emese Revfy <re.emese@gmail.com>
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
Date: Tue, 26 Jul 2016 22:42:34 +0200	[thread overview]
Message-ID: <20160726224234.c680b28a327365604664cb2b@gmail.com> (raw)
In-Reply-To: <20160726223541.513ce76f6de65389da6a6abe@gmail.com>

This allows not only compile time format string checking but can also
increase the coverage of the initify plugin.

Signed-off-by: Emese Revfy <re.emese@gmail.com>
---
 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
-- 
2.8.1

WARNING: multiple messages have this Message-ID (diff)
From: Emese Revfy <re.emese@gmail.com>
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: [kernel-hardening] [PATCH v3 6/7] Mark a few functions with the printf attribute
Date: Tue, 26 Jul 2016 22:42:34 +0200	[thread overview]
Message-ID: <20160726224234.c680b28a327365604664cb2b@gmail.com> (raw)
In-Reply-To: <20160726223541.513ce76f6de65389da6a6abe@gmail.com>

This allows not only compile time format string checking but can also
increase the coverage of the initify plugin.

Signed-off-by: Emese Revfy <re.emese@gmail.com>
---
 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
-- 
2.8.1

  parent reply	other threads:[~2016-07-26 20:24 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-26 20:35 [PATCH v3 0/7] Introduce the initify gcc plugin Emese Revfy
2016-07-26 20:35 ` [kernel-hardening] " Emese Revfy
2016-07-26 20:36 ` [PATCH v3 1/7] Move type casts into is_kernel_rodata Emese Revfy
2016-07-26 20:36   ` [kernel-hardening] " Emese Revfy
2016-07-26 20:38 ` [PATCH v3 2/7] Split up struct warn_args Emese Revfy
2016-07-26 20:38   ` [kernel-hardening] " Emese Revfy
2016-07-27  1:15   ` kbuild test robot
2016-07-27  1:15     ` [kernel-hardening] " kbuild test robot
2016-07-27  2:27   ` kbuild test robot
2016-07-27  2:27     ` [kernel-hardening] " kbuild test robot
2016-07-27 15:31   ` Emese Revfy
2016-07-27 15:31     ` [kernel-hardening] " Emese Revfy
2016-07-26 20:39 ` [PATCH v3 3/7] Constify some function parameters Emese Revfy
2016-07-26 20:39   ` [kernel-hardening] " Emese Revfy
2016-07-26 20:40 ` [PATCH v3 4/7] Add the initify gcc plugin Emese Revfy
2016-07-26 20:40   ` [kernel-hardening] " Emese Revfy
2016-07-26 20:41 ` [PATCH v3 5/7] Mark functions with the __nocapture attribute Emese Revfy
2016-07-26 20:41   ` [kernel-hardening] " Emese Revfy
2016-07-26 20:42 ` Emese Revfy [this message]
2016-07-26 20:42   ` [kernel-hardening] [PATCH v3 6/7] Mark a few functions with the printf attribute Emese Revfy
2016-07-27  1:17   ` kbuild test robot
2016-07-27  1:17     ` [kernel-hardening] " kbuild test robot
2016-07-27  1:23   ` kbuild test robot
2016-07-27  1:23     ` [kernel-hardening] " kbuild test robot
2016-07-27  1:29   ` kbuild test robot
2016-07-27  1:29     ` [kernel-hardening] " kbuild test robot
2016-07-27 15:34   ` Emese Revfy
2016-07-27 15:34     ` [kernel-hardening] " Emese Revfy
2016-07-26 20:43 ` [PATCH v3 7/7] Mark functions with the __unverified_nocapture attribute Emese Revfy
2016-07-26 20:43   ` [kernel-hardening] " Emese Revfy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160726224234.c680b28a327365604664cb2b@gmail.com \
    --to=re.emese@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=benh@kernel.crashing.org \
    --cc=catalin.marinas@arm.com \
    --cc=david.brown@linaro.org \
    --cc=isdn@linux-pingi.de \
    --cc=jlayton@poochiereds.net \
    --cc=keescook@chromium.org \
    --cc=kernel-hardening@lists.openwall.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=linux@rasmusvillemoes.dk \
    --cc=minipli@ld-linux.so \
    --cc=mmarek@suse.com \
    --cc=pageexec@freemail.hu \
    --cc=sam@ravnborg.org \
    --cc=spender@grsecurity.net \
    --cc=tglx@linutronix.de \
    --cc=yamada.masahiro@socionext.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.