summaryrefslogtreecommitdiff
authorKees Cook <keescook@chromium.org>2018-03-09 23:50:59 (GMT)
committer Alistair Strachan <astrachan@google.com>2019-03-29 04:13:06 (GMT)
commit96dc04da6c53803df271b4f555bfcfa988755377 (patch)
treec79523b83f5d8e01b9d8d8720f9e92ec716627d7
parentf98a05fa43e8c2d36542eca3528e3c32431786ae (diff)
downloadcommon-96dc04da6c53803df271b4f555bfcfa988755377.zip
common-96dc04da6c53803df271b4f555bfcfa988755377.tar.gz
common-96dc04da6c53803df271b4f555bfcfa988755377.tar.bz2
UPSTREAM: 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> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> (cherry picked from commit 0862ca422b79cb5aa70823ee0f07f6b468f86070) Signed-off-by: Sandeep Patil <sspatil@android.com> Bug: 78533979 Test: Build and boot cuttlefish Change-Id: Id4ff4ef7d236f1d7ce6d61ef071bd0d4414c8dd2
Diffstat
-rw-r--r--kernel/panic.c2
-rw-r--r--lib/bug.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/kernel/panic.c b/kernel/panic.c
index eb7bc6d..b932a93 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -599,7 +599,7 @@ EXPORT_SYMBOL(warn_slowpath_null);
*/
__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 bc3656e..dc7aa6b 100644
--- a/lib/bug.c
+++ b/lib/bug.c
@@ -177,7 +177,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;