From: tip-bot for Nicolas Iooss <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: bp@alien8.de, hpa@zytor.com, keescook@chromium.org,
tglx@linutronix.de, linux-kernel@vger.kernel.org,
nicolas.iooss_linux@m4x.org, peterz@infradead.org,
dvlasenk@redhat.com, mingo@kernel.org,
torvalds@linux-foundation.org, brgerst@gmail.com,
luto@kernel.org, jpoimboe@redhat.com
Subject: [tip:x86/urgent] x86/mm/kaslr: Fix -Wformat-security warning
Date: Thu, 11 Aug 2016 04:56:02 -0700 [thread overview]
Message-ID: <tip-62d16b5a3fca4d186e13215e0d7d2f6d36191796@git.kernel.org> (raw)
In-Reply-To: <20160806102039.27221-1-nicolas.iooss_linux@m4x.org>
Commit-ID: 62d16b5a3fca4d186e13215e0d7d2f6d36191796
Gitweb: http://git.kernel.org/tip/62d16b5a3fca4d186e13215e0d7d2f6d36191796
Author: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
AuthorDate: Sat, 6 Aug 2016 12:20:39 +0200
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Thu, 11 Aug 2016 10:58:12 +0200
x86/mm/kaslr: Fix -Wformat-security warning
debug_putstr() is used to output strings without using printf-like
formatting but debug_putstr(v) is defined as early_printk(v) in
arch/x86/lib/kaslr.c.
This makes clang reports the following warning when building
with -Wformat-security:
arch/x86/lib/kaslr.c:57:15: warning: format string is not a string
literal (potentially insecure) [-Wformat-security]
debug_putstr(purpose);
^~~~~~~
Fix this by using "%s" in early_printk().
Signed-off-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
Acked-by: Kees Cook <keescook@chromium.org>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/20160806102039.27221-1-nicolas.iooss_linux@m4x.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
arch/x86/lib/kaslr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/lib/kaslr.c b/arch/x86/lib/kaslr.c
index f7dfeda..121f59c 100644
--- a/arch/x86/lib/kaslr.c
+++ b/arch/x86/lib/kaslr.c
@@ -19,7 +19,7 @@
#include <asm/cpufeature.h>
#include <asm/setup.h>
-#define debug_putstr(v) early_printk(v)
+#define debug_putstr(v) early_printk("%s", v)
#define has_cpuflag(f) boot_cpu_has(f)
#define get_boot_seed() kaslr_offset()
#endif
prev parent reply other threads:[~2016-08-11 11:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-06 10:20 [PATCH 1/1] x86/mm: kaslr: fix -Wformat-security warning Nicolas Iooss
2016-08-11 11:56 ` tip-bot for Nicolas Iooss [this message]
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=tip-62d16b5a3fca4d186e13215e0d7d2f6d36191796@git.kernel.org \
--to=tipbot@zytor.com \
--cc=bp@alien8.de \
--cc=brgerst@gmail.com \
--cc=dvlasenk@redhat.com \
--cc=hpa@zytor.com \
--cc=jpoimboe@redhat.com \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mingo@kernel.org \
--cc=nicolas.iooss_linux@m4x.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).