linux/net/phonet
Sebastian Andrzej Siewior 7c0ec6288b net: Replace %pK output with 0
Commit 71338aa7d0 ("net: convert %p usage to %pK") which is from
2011 and changed the %p annotation for pointer to %pK. Back then the
default behaviour for %p was to print the pointer. The %pK modifier was
introduced to able to control the behaviour of specific pointer values
without changing the behaviour of %p for everyone. It was dedicated to
avoid leaking pointers via /proc.

There was also the idea to remove the check from formatting the string
and move to the open callback with some helpers but this did not happen.

Things changed over time. The default behaviour for %p is now to print a
hash pointer which does not leak the address but allows to correlate if
two pointers are equal.
The policy on %p is to not introduce new ones. This is somehow in
between since it already exists. The pointer are usually socket pointers
and I don't see any value in exposing them. Therefore I am following the
recommendation of removing them. Since their usage in /proc/ can be
considered ABI I replace the pointer with a 0.

Replace the %pK annotation with 0 value. Correct the spacing for the
cases where pointer is at the beginning.

Reviewed-by: Kees Cook <kees@kernel.org>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Link: https://patch.msgid.link/20260901160345.eeknHmY2@linutronix.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-09-02 18:38:16 -07:00
..
af_phonet.c bonding: prevent potential infinite loop in bond_header_parse() 2026-03-16 19:29:45 -07:00
datagram.c net: remove addr_len argument of recvmsg() handlers 2026-03-02 18:17:17 -08:00
Kconfig
Makefile
pep-gprs.c
pep.c phonet: pep: convert getsockopt to sockopt_t 2026-08-03 16:55:23 -07:00
pn_dev.c phonet: check register_netdevice_notifier() error in phonet_device_init() 2026-07-23 10:28:50 -07:00
pn_netlink.c phonet: do not call synchronize_rcu() from phonet_route_del() 2024-11-07 20:34:16 -08:00
socket.c net: Replace %pK output with 0 2026-09-02 18:38:16 -07:00
sysctl.c sysctl: treewide: constify the ctl_table argument of proc_handlers 2024-07-24 20:59:29 +02:00