]> git.baikalelectronics.ru Git - kernel.git/commit
kdb: print real address of pointers instead of hashed addresses
authorChristophe Leroy <christophe.leroy@c-s.fr>
Thu, 27 Sep 2018 17:17:57 +0000 (17:17 +0000)
committerDaniel Thompson <daniel.thompson@linaro.org>
Tue, 13 Nov 2018 20:27:37 +0000 (20:27 +0000)
commited7befa5ec15740d9b5d200a925b65fc666044b2
tree07c1ab9d9004257d7d0afcbac83a7581221cf841
parent0dd99076a3a3fe435924bf3cc1c44ad21c78e2a7
kdb: print real address of pointers instead of hashed addresses

Since commit 7f32ed5e940b ("printk: hash addresses printed with %p"),
all pointers printed with %p are printed with hashed addresses
instead of real addresses in order to avoid leaking addresses in
dmesg and syslog. But this applies to kdb too, with is unfortunate:

    Entering kdb (current=0x(ptrval), pid 329) due to Keyboard Entry
    kdb> ps
    15 sleeping system daemon (state M) processes suppressed,
    use 'ps A' to see all.
    Task Addr       Pid   Parent [*] cpu State Thread     Command
    0x(ptrval)      329      328  1    0   R  0x(ptrval) *sh

    0x(ptrval)        1        0  0    0   S  0x(ptrval)  init
    0x(ptrval)        3        2  0    0   D  0x(ptrval)  rcu_gp
    0x(ptrval)        4        2  0    0   D  0x(ptrval)  rcu_par_gp
    0x(ptrval)        5        2  0    0   D  0x(ptrval)  kworker/0:0
    0x(ptrval)        6        2  0    0   D  0x(ptrval)  kworker/0:0H
    0x(ptrval)        7        2  0    0   D  0x(ptrval)  kworker/u2:0
    0x(ptrval)        8        2  0    0   D  0x(ptrval)  mm_percpu_wq
    0x(ptrval)       10        2  0    0   D  0x(ptrval)  rcu_preempt

The whole purpose of kdb is to debug, and for debugging real addresses
need to be known. In addition, data displayed by kdb doesn't go into
dmesg.

This patch replaces all %p by %px in kdb in order to display real
addresses.

Fixes: 7f32ed5e940b ("printk: hash addresses printed with %p")
Cc: <stable@vger.kernel.org>
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
kernel/debug/kdb/kdb_main.c
kernel/debug/kdb/kdb_support.c