All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch 2/8] bug: use %pB in BUG and stack protector failure
@ 2018-03-09 23:50 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2018-03-09 23:50 UTC (permalink / raw)
  To: akpm, bp, keescook, mingo, mm-commits, peterz,
	richard.weinberger, stable, tglx, torvalds

From: Kees Cook <keescook@chromium.org>
Subject: 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: ad67b74d2469 ("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>
---

 kernel/panic.c |    2 +-
 lib/bug.c      |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff -puN kernel/panic.c~bug-use-%pb-in-bug-and-stack-protector-failure kernel/panic.c
--- a/kernel/panic.c~bug-use-%pb-in-bug-and-stack-protector-failure
+++ a/kernel/panic.c
@@ -640,7 +640,7 @@ device_initcall(register_warn_debugfs);
  */
 __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));
 }
 EXPORT_SYMBOL(__stack_chk_fail);
diff -puN lib/bug.c~bug-use-%pb-in-bug-and-stack-protector-failure lib/bug.c
--- a/lib/bug.c~bug-use-%pb-in-bug-and-stack-protector-failure
+++ a/lib/bug.c
@@ -191,7 +191,7 @@ enum bug_trap_type report_bug(unsigned l
 	if (file)
 		pr_crit("kernel BUG at %s:%u!\n", file, line);
 	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);
 
 	return BUG_TRAP_TYPE_BUG;
_

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-03-09 23:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-09 23:50 [patch 2/8] bug: use %pB in BUG and stack protector failure akpm

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.