From: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
To: <linuxppc-dev@lists.ozlabs.org>
Cc: Ravi Bangoria <ravi.bangoria@linux.ibm.com>,
Balamuruhan S <bala24@linux.ibm.com>
Subject: [PATCH 3/3] powerpc/hw_bkpt: Update printk format specifiers for kernel addresses
Date: Thu, 23 Apr 2020 20:47:37 +0530 [thread overview]
Message-ID: <f9c1406822b00f74ac0b5e1b6119486bd6d6de18.1587652966.git.naveen.n.rao@linux.vnet.ibm.com> (raw)
In-Reply-To: <cover.1587652966.git.naveen.n.rao@linux.vnet.ibm.com>
Change prinkt format specifier from %lx to %pK to indicate kernel
pointer, and to hide the addresses from unprivileged users.
Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
---
arch/powerpc/kernel/hw_breakpoint.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/kernel/hw_breakpoint.c b/arch/powerpc/kernel/hw_breakpoint.c
index 72f461bd70fb..93a303cf0c67 100644
--- a/arch/powerpc/kernel/hw_breakpoint.c
+++ b/arch/powerpc/kernel/hw_breakpoint.c
@@ -257,7 +257,8 @@ static bool stepping_handler(struct pt_regs *regs, struct perf_event *bp,
if (!ret && (type == LARX || type == STCX)) {
printk_ratelimited("Breakpoint hit on instruction that can't be emulated."
- " Breakpoint at 0x%lx will be disabled.\n", addr);
+ " Breakpoint at 0x%pK will be disabled.\n",
+ (void *)addr);
goto disable;
}
@@ -286,7 +287,7 @@ static bool stepping_handler(struct pt_regs *regs, struct perf_event *bp,
* it and throw a warning message to let the user know about it.
*/
WARN(1, "Unable to handle hardware breakpoint. Breakpoint at "
- "0x%lx will be disabled.", addr);
+ "0x%pK will be disabled.", (void *)addr);
disable:
perf_event_disable_inatomic(bp);
--
2.25.1
prev parent reply other threads:[~2020-04-23 15:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-23 15:17 [PATCH 0/3] powerpc: Use proper printk format specifiers Naveen N. Rao
2020-04-23 15:17 ` [PATCH 1/3] powerpc/kprobes: Use appropriate format specifier for printing kernel address Naveen N. Rao
2022-03-09 18:28 ` Christophe Leroy
2020-04-23 15:17 ` [PATCH 2/3] powerpc/ftrace: Use appropriate format specifier for printing kernel addresses Naveen N. Rao
2020-04-23 15:17 ` Naveen N. Rao [this message]
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:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f9c1406822b00f74ac0b5e1b6119486bd6d6de18.1587652966.git.naveen.n.rao@linux.vnet.ibm.com \
--to=naveen.n.rao@linux.vnet.ibm.com \
--cc=bala24@linux.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=ravi.bangoria@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).