From: Matt Fleming Date: Thu, 3 Apr 2014 21:46:20 +0000 (-0700) Subject: sh: fix format string bug in stack tracer X-Git-Tag: v5.15~18164^2~236 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a0c32761e73c9999cbf592b702f284221fea8040;p=platform%2Fkernel%2Flinux-starfive.git 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: Matt Fleming Reported-by: Kees Cook Acked-by: Kees Cook Cc: Paul Mundt Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/arch/sh/kernel/dumpstack.c b/arch/sh/kernel/dumpstack.c index b959f55..8dfe645 100644 --- a/arch/sh/kernel/dumpstack.c +++ b/arch/sh/kernel/dumpstack.c @@ -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); }