* [PATCH] printk: Fix %pB when there's no symbol at the address
@ 2014-07-14 14:38 Namhyung Kim
0 siblings, 0 replies; only message in thread
From: Namhyung Kim @ 2014-07-14 14:38 UTC (permalink / raw)
To: Ingo Molnar
Cc: Peter Zijlstra, Andrew Morton, Masami Hiramatsu, LKML,
Steven Rostedt, Frederic Weisbecker, Josh Poimboeuf
The __sprint_symbol() should restore original address when
kallsyms_lookup() failed to find a symbol. It's reported when
dumpstack shows an address in a dynamically allocated trampoline
for ftrace.
[ 1314.612287] [<ffffffff81700312>] dump_stack+0x45/0x56
[ 1314.612290] [<ffffffff8125f5b0>] ? meminfo_proc_open+0x30/0x30
[ 1314.612293] [<ffffffffa080a494>] kpatch_ftrace_handler+0x14/0xf0 [kpatch]
[ 1314.612306] [<ffffffffa00160c4>] 0xffffffffa00160c3
You can see a difference in the hex address - c4 and c3. Fix it.
Reported-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
kernel/kallsyms.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c
index cb0cf37dac3a..ae5167087845 100644
--- a/kernel/kallsyms.c
+++ b/kernel/kallsyms.c
@@ -364,7 +364,7 @@ static int __sprint_symbol(char *buffer, unsigned long address,
address += symbol_offset;
name = kallsyms_lookup(address, &size, &offset, &modname, buffer);
if (!name)
- return sprintf(buffer, "0x%lx", address);
+ return sprintf(buffer, "0x%lx", address - symbol_offset);
if (name != buffer)
strcpy(buffer, name);
--
2.0.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2014-07-14 14:39 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-14 14:38 [PATCH] printk: Fix %pB when there's no symbol at the address Namhyung Kim
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®