LKML Archive on
 help / color / Atom feed
From: Kees Cook <>
To: Andrew Morton <>
Cc:, Ingo Molnar <>,
	Thomas Gleixner <>,
	Peter Zijlstra <>,
	Borislav Petkov <>,
	Richard Weinberger <>,
	Linus Torvalds <>
Subject: [RESEND][PATCH] bug: Use %pB in BUG and stack protector failure
Date: Thu, 1 Mar 2018 14:57:04 -0800
Message-ID: <20180301225704.GA34198@beast> (raw)

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")
Signed-off-by: Kees Cook <>
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",
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);
-		pr_crit("Kernel BUG at %p [verbose debug info unavailable]\n",
+		pr_crit("Kernel BUG at %pB [verbose debug info unavailable]\n",
 			(void *)bugaddr);

Kees Cook
Pixel Security

                 reply index

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180301225704.GA34198@beast \ \ \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

LKML Archive on

Archives are clonable:
	git clone --mirror lkml/git/0.git
	git clone --mirror lkml/git/1.git
	git clone --mirror lkml/git/2.git
	git clone --mirror lkml/git/3.git
	git clone --mirror lkml/git/4.git
	git clone --mirror lkml/git/5.git
	git clone --mirror lkml/git/6.git
	git clone --mirror lkml/git/7.git
	git clone --mirror lkml/git/8.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ \
	public-inbox-index lkml

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone