Commit a0c32761 authored by Matt Fleming's avatar Matt Fleming Committed by Linus Torvalds

sh: fix format string bug in stack tracer

Kees reported the following error:

   arch/sh/kernel/dumpstack.c: In function 'print_trace_address':
   arch/sh/kernel/dumpstack.c:118:2: error: format not a string literal and no format arguments [-Werror=format-security]

Use the "%s" format so that it's impossible to interpret 'data' as a
format string.
Signed-off-by: default avatarMatt Fleming <matt.fleming@intel.com>
Reported-by: default avatarKees Cook <keescook@chromium.org>
Acked-by: default avatarKees Cook <keescook@chromium.org>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 59ecc260
...@@ -115,7 +115,7 @@ static int print_trace_stack(void *data, char *name) ...@@ -115,7 +115,7 @@ static int print_trace_stack(void *data, char *name)
*/ */
static void print_trace_address(void *data, unsigned long addr, int reliable) static void print_trace_address(void *data, unsigned long addr, int reliable)
{ {
printk(data); printk("%s", (char *)data);
printk_address(addr, reliable); printk_address(addr, reliable);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment