sparc: use %s for unaligned panic
PATCH RESEND 1/1 sparc: use %s for unaligned panic
Since unaligned_panic() takes a literal string, make sure it can never accidentally be used as a format string.
Signed-off-by Kees Cook <[email protected]>
--- arch/sparc/kernel/unaligned_32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/sparc/kernel/unaligned_32.c +1 -1
@@ -166,7 +166,7 @@ unsigned long safe_compute_effective_address(struct pt_regs *regs,/* This is just to make gcc think panic does return... */ static void unaligned_panic (char *str) { -panic (str); +panic ("%s" , str); }/* una_asm.S */
Signature · 6 lines
1.7.9.5 -- Kees Cook Chrome OS Security
Quoted 13 lines · Kees Cook
Since
unaligned_panic()takes a literal string, make sure it can never accidentally be used as a format string.Signed-off-by Kees Cook <[email protected]>--- arch/sparc/kernel/unaligned_32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/sparc/kernel/unaligned_32.c +0
-0
arch/sparc/kernel/unaligned_32.c unsigned long safe_compute_effective_address(struct pt_regs *regs, · line 172
Quoted 8 lines
arch/sparc/kernel/unaligned_32.c +1
-1@@ -166,7 +166,7 @@ unsigned long safe_compute_effective_address(struct pt_regs *regs,/* This is just to make gcc think panic does return... */ static void unaligned_panic (char *str) { -panic (str); +panic ("%s" , str); }/* una_asm.S */
The feedback last time was that this patch is silly. panic() has only two callsites within the same file.
Sam
David Miller
maintainerFrom: Kees Cook <[email protected]>
Date: Mon, 30 Jun 2014 13:37:59 -0700
Quoted 4 lines
Since
unaligned_panic()takes a literal string, make sure it can never accidentally be used as a format string.Signed-off-by Kees Cook <[email protected]>
Unnecessary, but harmless, so applied to sparc-next, thanks.