Skip to content

Commit d810418

Browse files
committed
powerpc/xmon: Don't print hashed pointers in xmon
Since commit ad67b74 ("printk: hash addresses printed with %p") pointers printed with %p are hashed, ie. you don't see the actual pointer value but rather a cryptographic hash of its value. In xmon we want to see the actual pointer values, because xmon is a debugger, so replace %p with %px which prints the actual pointer value. We justify doing this in xmon because 1) xmon is a kernel crash debugger, it's only accessible via the console 2) xmon doesn't print to dmesg, so the pointers it prints are not able to be leaked that way. Signed-off-by: Michael Ellerman <[email protected]>
1 parent 371b804 commit d810418

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

arch/powerpc/xmon/xmon.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1590,7 +1590,7 @@ static void print_bug_trap(struct pt_regs *regs)
15901590
printf("kernel BUG at %s:%u!\n",
15911591
bug->file, bug->line);
15921592
#else
1593-
printf("kernel BUG at %p!\n", (void *)bug->bug_addr);
1593+
printf("kernel BUG at %px!\n", (void *)bug->bug_addr);
15941594
#endif
15951595
#endif /* CONFIG_BUG */
15961596
}
@@ -2329,7 +2329,7 @@ static void dump_one_paca(int cpu)
23292329

23302330
p = &paca[cpu];
23312331

2332-
printf("paca for cpu 0x%x @ %p:\n", cpu, p);
2332+
printf("paca for cpu 0x%x @ %px:\n", cpu, p);
23332333

23342334
printf(" %-*s = %s\n", 20, "possible", cpu_possible(cpu) ? "yes" : "no");
23352335
printf(" %-*s = %s\n", 20, "present", cpu_present(cpu) ? "yes" : "no");
@@ -2945,7 +2945,7 @@ static void show_task(struct task_struct *tsk)
29452945
(tsk->exit_state & EXIT_DEAD) ? 'E' :
29462946
(tsk->state & TASK_INTERRUPTIBLE) ? 'S' : '?';
29472947

2948-
printf("%p %016lx %6d %6d %c %2d %s\n", tsk,
2948+
printf("%px %016lx %6d %6d %c %2d %s\n", tsk,
29492949
tsk->thread.ksp,
29502950
tsk->pid, tsk->parent->pid,
29512951
state, task_thread_info(tsk)->cpu,
@@ -2988,7 +2988,7 @@ static void show_pte(unsigned long addr)
29882988

29892989
if (setjmp(bus_error_jmp) != 0) {
29902990
catch_memory_errors = 0;
2991-
printf("*** Error dumping pte for task %p\n", tsk);
2991+
printf("*** Error dumping pte for task %px\n", tsk);
29922992
return;
29932993
}
29942994

@@ -3074,7 +3074,7 @@ static void show_tasks(void)
30743074

30753075
if (setjmp(bus_error_jmp) != 0) {
30763076
catch_memory_errors = 0;
3077-
printf("*** Error dumping task %p\n", tsk);
3077+
printf("*** Error dumping task %px\n", tsk);
30783078
return;
30793079
}
30803080

0 commit comments

Comments
 (0)