* [RESEND][PATCH] bug: Use %pB in BUG and stack protector failure
@ 2018-03-01 22:57 Kees Cook
0 siblings, 0 replies; only message in thread
From: Kees Cook @ 2018-03-01 22:57 UTC (permalink / raw)
To: Andrew Morton
Cc: linux-kernel, Ingo Molnar, Thomas Gleixner, Peter Zijlstra,
Borislav Petkov, Richard Weinberger, Linus Torvalds
The BUG and stack protector reports were still using a raw %p. This
changes it to %pB for more meaningful output.
Fixes: ad67b74d2469 ("printk: hash addresses printed with %p")
Cc: stable@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
---
Resending through akpm as this isn't x86-specific ...
---
kernel/panic.c | 2 +-
lib/bug.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/panic.c b/kernel/panic.c
index 2cfef408fec9..4b794f1d8561 100644
--- a/kernel/panic.c
+++ b/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 --git a/lib/bug.c b/lib/bug.c
index 551e4d405307..1077366f496b 100644
--- a/lib/bug.c
+++ b/lib/bug.c
@@ -193,7 +193,7 @@ enum bug_trap_type report_bug(unsigned long bugaddr, struct pt_regs *regs)
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;
--
2.7.4
--
Kees Cook
Pixel Security
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2018-03-01 22:57 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-01 22:57 [RESEND][PATCH] bug: Use %pB in BUG and stack protector failure Kees Cook
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox