Skip to content

Commit

Permalink
sh: fix format string bug in stack tracer
Browse files Browse the repository at this point in the history
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: Matt Fleming <matt.fleming@intel.com>
Reported-by: Kees Cook <keescook@chromium.org>
Acked-by: Kees Cook <keescook@chromium.org>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Matt Fleming authored and Linus Torvalds committed Apr 3, 2014
1 parent 59ecc26 commit a0c3276
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/sh/kernel/dumpstack.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
printk(data);
printk("%s", (char *)data);
printk_address(addr, reliable);
}

Expand Down

0 comments on commit a0c3276

Please sign in to comment.