printk: hash addresses printed with %p
Currently there exist approximately 14 000 places in the kernel where
addresses are being printed using an unadorned %p. This potentially
leaks sensitive information regarding the Kernel layout in memory. Many
of these calls are stale, instead of fixing every call lets hash the
address by default before printing. This will of course break some
users, forcing code printing needed addresses to be updated.
Code that _really_ needs the address will soon be able to use the new
printk specifier %px to print the address.
For what it's worth, usage of unadorned %p can be broken down as
follows (thanks to Joe Perches).
$ git grep -E '%p[^A-Za-z0-9]' | cut -f1 -d"/" | sort | uniq -c
1084 arch
20 block
10 crypto
32 Documentation
8121 drivers
1221 fs
143 include
101 kernel
69 lib
100 mm
1510 net
40 samples
7 scripts
11 security
166 sound
152 tools
2 virt
Add function ptr_to_id() to map an address to a 32 bit unique
identifier. Hash any unadorned usage of specifier %p and any malformed
specifiers.
Signed-off-by:
Tobin C. Harding <me@tobin.cc>
Loading
-
mentioned in commit d8104182
-
mentioned in commit 85c3e4a5
-
mentioned in commit 10a7e9d8
-
mentioned in commit 63b2c373
-
mentioned in commit 0ae60d0c
-
mentioned in commit 04903c06
-
mentioned in commit 28df2f83
-
mentioned in commit 0e6c16c6
-
mentioned in commit 0e4d819d
-
mentioned in commit 2d02424e
-
mentioned in commit 0862ca42
-
mentioned in commit 31833332
-
mentioned in commit bcbd385b
-
mentioned in commit 85f4f12d
-
mentioned in commit 568fb6f4
-
mentioned in commit dded2e15
-
mentioned in commit 1476ea25
-
mentioned in commit a3151724
-
mentioned in commit b929a500
-
mentioned in commit 00206a69
-
mentioned in commit 0bdd0047
Please register or sign in to comment