Commit 5650bff7 authored by Matt Fleming's avatar Matt Fleming Committed by Greg Kroah-Hartman

sh: fix format string bug in stack tracer

commit a0c32761 upstream.

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>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d6f6fc7a
......@@ -80,7 +80,7 @@ static int print_trace_stack(void *data, char *name)
*/
static void print_trace_address(void *data, unsigned long addr, int reliable)
{
printk(data);
printk("%s", (char *)data);
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