Commit 0862ca42 authored by Kees Cook's avatar Kees Cook Committed by Linus Torvalds

bug: use %pB in BUG and stack protector failure

The BUG and stack protector reports were still using a raw %p.  This
changes it to %pB for more meaningful output.

Link: http://lkml.kernel.org/r/20180301225704.GA34198@beast
Fixes: ad67b74d ("printk: hash addresses printed with %p")
Signed-off-by: default avatarKees Cook <keescook@chromium.org>
Reviewed-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Richard Weinberger <richard.weinberger@gmail.com>,
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 4704dea3
...@@ -640,7 +640,7 @@ device_initcall(register_warn_debugfs); ...@@ -640,7 +640,7 @@ device_initcall(register_warn_debugfs);
*/ */
__visible void __stack_chk_fail(void) __visible void __stack_chk_fail(void)
{ {
panic("stack-protector: Kernel stack is corrupted in: %p\n", panic("stack-protector: Kernel stack is corrupted in: %pB\n",
__builtin_return_address(0)); __builtin_return_address(0));
} }
EXPORT_SYMBOL(__stack_chk_fail); EXPORT_SYMBOL(__stack_chk_fail);
......
...@@ -191,7 +191,7 @@ enum bug_trap_type report_bug(unsigned long bugaddr, struct pt_regs *regs) ...@@ -191,7 +191,7 @@ enum bug_trap_type report_bug(unsigned long bugaddr, struct pt_regs *regs)
if (file) if (file)
pr_crit("kernel BUG at %s:%u!\n", file, line); pr_crit("kernel BUG at %s:%u!\n", file, line);
else else
pr_crit("Kernel BUG at %p [verbose debug info unavailable]\n", pr_crit("Kernel BUG at %pB [verbose debug info unavailable]\n",
(void *)bugaddr); (void *)bugaddr);
return BUG_TRAP_TYPE_BUG; return BUG_TRAP_TYPE_BUG;
......
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