[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <152481133105.22588.10668983189195179761.stgit@devbox>
Date: Fri, 27 Apr 2018 15:42:11 +0900
From: Masami Hiramatsu <mhiramat@...nel.org>
To: linux-kernel@...r.kernel.org, linux-arch@...r.kernel.org
Cc: Ingo Molnar <mingo@...hat.com>, "H . Peter Anvin" <hpa@...or.com>,
x86@...nel.org, Masami Hiramatsu <mhiramat@...nel.org>,
Ananth N Mavinakayanahalli <ananth@...ibm.com>,
Anil S Keshavamurthy <anil.s.keshavamurthy@...el.com>,
"David S . Miller" <davem@...emloft.net>,
Jon Medhurst <tixy@...aro.org>,
Will Deacon <will.deacon@....com>,
Arnd Bergmann <arnd@...db.de>,
David Howells <dhowells@...hat.com>,
Heiko Carstens <heiko.carstens@...ibm.com>,
"Tobin C . Harding" <me@...in.cc>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Thomas Richter <tmricht@...ux.ibm.com>,
akpm@...ux-foundation.org, acme@...nel.org, rostedt@...dmis.org,
brueckner@...ux.vnet.ibm.com, schwidefsky@...ibm.com,
stable@...r.kernel.org
Subject: [PATCH v3 5/7] kprobes/x86: Fix %p uses in error messages
Fix %p uses in error messages in kprobes/x86.
- Some %p uses are not needed. Just remove it (or remove message).
- One %p use seems important to show some address
so replaced with %pS.
Signed-off-by: Masami Hiramatsu <mhiramat@...nel.org>
---
Changes in v3:
- Do not use %px.
---
arch/x86/kernel/kprobes/core.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/arch/x86/kernel/kprobes/core.c b/arch/x86/kernel/kprobes/core.c
index 0715f827607c..d2c9d5c8e4ce 100644
--- a/arch/x86/kernel/kprobes/core.c
+++ b/arch/x86/kernel/kprobes/core.c
@@ -391,8 +391,6 @@ int __copy_instruction(u8 *dest, u8 *src, u8 *real, struct insn *insn)
- (u8 *) real;
if ((s64) (s32) newdisp != newdisp) {
pr_err("Kprobes error: new displacement does not fit into s32 (%llx)\n", newdisp);
- pr_err("\tSrc: %p, Dest: %p, old disp: %x\n",
- src, real, insn->displacement.value);
return 0;
}
disp = (u8 *) dest + insn_offset_displacement(insn);
@@ -636,8 +634,7 @@ static int reenter_kprobe(struct kprobe *p, struct pt_regs *regs,
* Raise a BUG or we'll continue in an endless reentering loop
* and eventually a stack overflow.
*/
- printk(KERN_WARNING "Unrecoverable kprobe detected at %p.\n",
- p->addr);
+ pr_err("Unrecoverable kprobe detected.\n");
dump_kprobe(p);
BUG();
default:
@@ -1146,12 +1143,11 @@ int longjmp_break_handler(struct kprobe *p, struct pt_regs *regs)
(addr < (u8 *) jprobe_return_end)) {
if (stack_addr(regs) != saved_sp) {
struct pt_regs *saved_regs = &kcb->jprobe_saved_regs;
- printk(KERN_ERR
- "current sp %p does not match saved sp %p\n",
+ pr_err("current sp %pS does not match saved sp %pS\n",
stack_addr(regs), saved_sp);
- printk(KERN_ERR "Saved registers for jprobe %p\n", jp);
+ pr_err("Saved registers for jprobe\n");
show_regs(saved_regs);
- printk(KERN_ERR "Current registers\n");
+ pr_err("Current registers\n");
show_regs(regs);
BUG();
}
Powered by blists - more mailing lists