Skip to content

Commit 0862ca4

Browse files
keestorvalds
authored andcommitted
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: ad67b74 ("printk: hash addresses printed with %p") Signed-off-by: Kees Cook <keescook@chromium.org> Reviewed-by: Andrew 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: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 4704dea commit 0862ca4

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

kernel/panic.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ device_initcall(register_warn_debugfs);
640640
*/
641641
__visible void __stack_chk_fail(void)
642642
{
643-
panic("stack-protector: Kernel stack is corrupted in: %p\n",
643+
panic("stack-protector: Kernel stack is corrupted in: %pB\n",
644644
__builtin_return_address(0));
645645
}
646646
EXPORT_SYMBOL(__stack_chk_fail);

lib/bug.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ enum bug_trap_type report_bug(unsigned long bugaddr, struct pt_regs *regs)
191191
if (file)
192192
pr_crit("kernel BUG at %s:%u!\n", file, line);
193193
else
194-
pr_crit("Kernel BUG at %p [verbose debug info unavailable]\n",
194+
pr_crit("Kernel BUG at %pB [verbose debug info unavailable]\n",
195195
(void *)bugaddr);
196196

197197
return BUG_TRAP_TYPE_BUG;

0 commit comments

Comments
 (0)