diff options
author | Michael Ellerman <mpe@ellerman.id.au> | 2017-12-06 07:23:28 -0500 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2017-12-06 08:27:01 -0500 |
commit | d8104182087319fd753d6d8e0afcd95d84c2aa2f (patch) | |
tree | be9baacdc1e58ae653535916659cd944a8d39186 | |
parent | 371b80447ff33ddac392c189cf884a5a3e18faeb (diff) |
powerpc/xmon: Don't print hashed pointers in xmon
Since commit ad67b74d2469 ("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 <mpe@ellerman.id.au>
-rw-r--r-- | arch/powerpc/xmon/xmon.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c index 1b2d8cb49abb..cab24f549e7c 100644 --- a/arch/powerpc/xmon/xmon.c +++ b/arch/powerpc/xmon/xmon.c | |||
@@ -1590,7 +1590,7 @@ static void print_bug_trap(struct pt_regs *regs) | |||
1590 | printf("kernel BUG at %s:%u!\n", | 1590 | printf("kernel BUG at %s:%u!\n", |
1591 | bug->file, bug->line); | 1591 | bug->file, bug->line); |
1592 | #else | 1592 | #else |
1593 | printf("kernel BUG at %p!\n", (void *)bug->bug_addr); | 1593 | printf("kernel BUG at %px!\n", (void *)bug->bug_addr); |
1594 | #endif | 1594 | #endif |
1595 | #endif /* CONFIG_BUG */ | 1595 | #endif /* CONFIG_BUG */ |
1596 | } | 1596 | } |
@@ -2329,7 +2329,7 @@ static void dump_one_paca(int cpu) | |||
2329 | 2329 | ||
2330 | p = &paca[cpu]; | 2330 | p = &paca[cpu]; |
2331 | 2331 | ||
2332 | printf("paca for cpu 0x%x @ %p:\n", cpu, p); | 2332 | printf("paca for cpu 0x%x @ %px:\n", cpu, p); |
2333 | 2333 | ||
2334 | printf(" %-*s = %s\n", 20, "possible", cpu_possible(cpu) ? "yes" : "no"); | 2334 | printf(" %-*s = %s\n", 20, "possible", cpu_possible(cpu) ? "yes" : "no"); |
2335 | printf(" %-*s = %s\n", 20, "present", cpu_present(cpu) ? "yes" : "no"); | 2335 | printf(" %-*s = %s\n", 20, "present", cpu_present(cpu) ? "yes" : "no"); |
@@ -2945,7 +2945,7 @@ static void show_task(struct task_struct *tsk) | |||
2945 | (tsk->exit_state & EXIT_DEAD) ? 'E' : | 2945 | (tsk->exit_state & EXIT_DEAD) ? 'E' : |
2946 | (tsk->state & TASK_INTERRUPTIBLE) ? 'S' : '?'; | 2946 | (tsk->state & TASK_INTERRUPTIBLE) ? 'S' : '?'; |
2947 | 2947 | ||
2948 | printf("%p %016lx %6d %6d %c %2d %s\n", tsk, | 2948 | printf("%px %016lx %6d %6d %c %2d %s\n", tsk, |
2949 | tsk->thread.ksp, | 2949 | tsk->thread.ksp, |
2950 | tsk->pid, tsk->parent->pid, | 2950 | tsk->pid, tsk->parent->pid, |
2951 | state, task_thread_info(tsk)->cpu, | 2951 | state, task_thread_info(tsk)->cpu, |
@@ -2988,7 +2988,7 @@ static void show_pte(unsigned long addr) | |||
2988 | 2988 | ||
2989 | if (setjmp(bus_error_jmp) != 0) { | 2989 | if (setjmp(bus_error_jmp) != 0) { |
2990 | catch_memory_errors = 0; | 2990 | catch_memory_errors = 0; |
2991 | printf("*** Error dumping pte for task %p\n", tsk); | 2991 | printf("*** Error dumping pte for task %px\n", tsk); |
2992 | return; | 2992 | return; |
2993 | } | 2993 | } |
2994 | 2994 | ||
@@ -3074,7 +3074,7 @@ static void show_tasks(void) | |||
3074 | 3074 | ||
3075 | if (setjmp(bus_error_jmp) != 0) { | 3075 | if (setjmp(bus_error_jmp) != 0) { |
3076 | catch_memory_errors = 0; | 3076 | catch_memory_errors = 0; |
3077 | printf("*** Error dumping task %p\n", tsk); | 3077 | printf("*** Error dumping task %px\n", tsk); |
3078 | return; | 3078 | return; |
3079 | } | 3079 | } |
3080 | 3080 | ||