[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-62d16b5a3fca4d186e13215e0d7d2f6d36191796@git.kernel.org>
Date: Thu, 11 Aug 2016 04:56:02 -0700
From: tip-bot for Nicolas Iooss <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: bp@...en8.de, hpa@...or.com, keescook@...omium.org,
tglx@...utronix.de, linux-kernel@...r.kernel.org,
nicolas.iooss_linux@....org, peterz@...radead.org,
dvlasenk@...hat.com, mingo@...nel.org,
torvalds@...ux-foundation.org, brgerst@...il.com, luto@...nel.org,
jpoimboe@...hat.com
Subject: [tip:x86/urgent] x86/mm/kaslr: Fix -Wformat-security warning
Commit-ID: 62d16b5a3fca4d186e13215e0d7d2f6d36191796
Gitweb: http://git.kernel.org/tip/62d16b5a3fca4d186e13215e0d7d2f6d36191796
Author: Nicolas Iooss <nicolas.iooss_linux@....org>
AuthorDate: Sat, 6 Aug 2016 12:20:39 +0200
Committer: Ingo Molnar <mingo@...nel.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@....org>
Acked-by: Kees Cook <keescook@...omium.org>
Cc: Andy Lutomirski <luto@...nel.org>
Cc: Borislav Petkov <bp@...en8.de>
Cc: Brian Gerst <brgerst@...il.com>
Cc: Denys Vlasenko <dvlasenk@...hat.com>
Cc: H. Peter Anvin <hpa@...or.com>
Cc: Josh Poimboeuf <jpoimboe@...hat.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Thomas Gleixner <tglx@...utronix.de>
Link: http://lkml.kernel.org/r/20160806102039.27221-1-nicolas.iooss_linux@m4x.org
Signed-off-by: Ingo Molnar <mingo@...nel.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
Powered by blists - more mailing lists