From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Kees Cook <kees@kernel.org>
Cc: linux-atm-general@lists.sourceforge.net,
linux-can@vger.kernel.org, linux-sctp@vger.kernel.org,
netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
"Herbert Xu" <herbert@gondor.apana.org.au>,
"Jakub Kicinski" <kuba@kernel.org>,
"Kuniyuki Iwashima" <kuniyu@google.com>,
"Marc Kleine-Budde" <mkl@pengutronix.de>,
"Marcelo Ricardo Leitner" <marcelo.leitner@gmail.com>,
"Neal Cardwell" <ncardwell@google.com>,
"Oliver Hartkopp" <socketcan@hartkopp.net>,
"Paolo Abeni" <pabeni@redhat.com>,
"Remi Denis-Courmont" <courmisch@gmail.com>,
"Simon Horman" <horms@kernel.org>,
"Steffen Klassert" <steffen.klassert@secunet.com>,
"Willem de Bruijn" <willemdebruijn.kernel@gmail.com>,
"Xin Long" <lucien.xin@gmail.com>,
"Petr Mladek" <pmladek@suse.com>,
"Thomas Weißschuh" <thomas.weissschuh@linutronix.de>
Subject: Re: [PATCH net-next] net: Convert %pK back to %p
Date: Tue, 14 Jul 2026 17:09:57 +0200 [thread overview]
Message-ID: <20260714150957.GY4aiPiH@linutronix.de> (raw)
In-Reply-To: <202607090916.7731D36D@keescook>
tl;dr: Do the networking folks mind switch it to 0 instead the pointer?
On 2026-07-09 09:18:44 [-0700], Kees Cook wrote:
> On Mon, Jul 06, 2026 at 09:38:24AM +0200, Sebastian Andrzej Siewior wrote:
> > This is a revert of commit 71338aa7d050c ("net: convert %p usage to
> > %pK") which is from 2011. Back then the default behaviour for %p was to
> > print the pointer. The %pK modifier was introduced to be able to control
> > the behaviour of specific pointer output without changing the behaviour
> > of %p for everyone. It was dedicated to avoid leaking pointers via
> > /proc.
>
> Given the policy on bare %p, and that there are so few in this list (15
> files), how about review those that can just simply be removed or
> switched to %pS, etc:
> https://docs.kernel.org/process/deprecated.html#p-format-specifier
It is not a new use, but an old one ;)
The pointers are data pointers of sockets and so on, not code. So using
%pS will reveal the exact pointers even with hashing enabled (in case
you think about changing the behaviour for __sprint_symbol() for cases
where kallsyms fails to resolve the symbol).
The things here are "reports" such as /proc/net/icmp where you get
|# cat /proc/net/icmp
| sl local_address rem_address st tx_queue rx_queue tr tm->when retrnsmt uid timeout inode ref pointer drops
| 53: 00000000:C9F2 00000000:0000 07 00000000:00000000 00:00000000 00000000 1000 0 4569 2 000000001145b7f6 0
so this is probably considered as ABI. lsof, lsfd (util-linux) are using
this file. So I don't think this entry can be removed. These kind of
files have usually a flexible ABI and are fine with adding new
attributes but not removing existing ones.
In this cases we usually put 0 if we remove an entry.
The pointer in icmp has been added int commit c319b4d76b9e5 ("net: ipv4:
add IPPROTO_ICMP socket kind") and no explanation why. But the order is
the same as in the tcp or raw file. I traced the tcp pointer inclusion
back to 2.3.15pre3 with no explanation. It just appeared with bunch of
other changes so maybe making debug a bit easier.
Anyway, given all this, do the networking folks mind switch it to 0
instead the pointer?
Sebastian
prev parent reply other threads:[~2026-07-14 15:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-06 7:38 [PATCH net-next] net: Convert %pK back to %p Sebastian Andrzej Siewior
2026-07-07 7:46 ` sashiko-bot
2026-07-07 9:37 ` Sebastian Andrzej Siewior
2026-07-09 11:28 ` Petr Mladek
2026-07-09 16:18 ` Kees Cook
2026-07-14 15:09 ` Sebastian Andrzej Siewior [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260714150957.GY4aiPiH@linutronix.de \
--to=bigeasy@linutronix.de \
--cc=courmisch@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=herbert@gondor.apana.org.au \
--cc=horms@kernel.org \
--cc=kees@kernel.org \
--cc=kuba@kernel.org \
--cc=kuniyu@google.com \
--cc=linux-atm-general@lists.sourceforge.net \
--cc=linux-can@vger.kernel.org \
--cc=linux-sctp@vger.kernel.org \
--cc=lucien.xin@gmail.com \
--cc=marcelo.leitner@gmail.com \
--cc=mkl@pengutronix.de \
--cc=ncardwell@google.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pmladek@suse.com \
--cc=socketcan@hartkopp.net \
--cc=steffen.klassert@secunet.com \
--cc=thomas.weissschuh@linutronix.de \
--cc=willemdebruijn.kernel@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox