From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Oliver Hartkopp <socketcan@hartkopp.net>
Cc: linux-can@vger.kernel.org
Subject: Re: [PATCH can-next v3] can: proc: remove pointers from CAN specific proc output
Date: Fri, 16 Oct 2026 12:43:21 +0200 [thread overview]
Message-ID: <20261016104321.Z9OEG9m_@linutronix.de> (raw)
In-Reply-To: <20261016103706.410678-1-socketcan@hartkopp.net>
On 2026-10-16 12:37:06 [+0200], Oliver Hartkopp wrote:
> The proc content in /proc/net/can/ and /proc/net/can-bcm/ is intended to
> check the internal filter lists (af_can, can_raw) and the efficiency and
> functionality of can_bcm jobs. While exposing kernel addresses was
> acceptable when this code was written the times have changed and multiple
> attempts have been made to hash or remove such now sensitive data.
>
> This patch removes the disclosure of pointers and instead provides the
> function names and sock inode numbers when available. When the function
> name can not be resolved (e.g. KALLSYMS=n or stripped module symbols)
> %ps would fall back to the raw text address. Therefore (unknown) is
> printed instead in this case. As there's no known tooling around the CAN
> specific proc output breaking the ABI with this rework creates no issue.
>
> Suggested-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
I am all fine with this \o/
> --- a/net/can/proc.c
> +++ b/net/can/proc.c
> @@ -189,30 +189,36 @@ static void can_print_rcvlist(struct seq_file *m, struct hlist_head *rx_list,
> struct net_device *dev)
…
> +
> + /* %ps falls back to the raw text address when the symbol
> + * can not be resolved (KALLSYMS=n, stripped module symbols)
> + */
> + snprintf(symcheck, sizeof(symcheck), "%ps", r->func);
> + if (strncmp(symcheck, "0x", 2))
> + seq_printf(m, " %ps\n", r->func);
> + else
> + seq_puts(m, " (unknown)\n");
If you want to keep this because the bot said so, fine. I will let you
know once my side projects gets through
https://lore.kernel.org/all/20261015-vsprintf_kallsym-v3-1-c175c27f38b7@linutronix.de/
;)
> }
> }
>
Sebastian
next prev parent reply other threads:[~2026-10-16 10:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-16 10:37 [PATCH can-next v3] can: proc: remove pointers from CAN specific proc output Oliver Hartkopp
2026-10-16 10:43 ` Sebastian Andrzej Siewior [this message]
2026-10-16 11:22 ` Oliver Hartkopp
2026-10-16 11:08 ` Marc Kleine-Budde
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=20261016104321.Z9OEG9m_@linutronix.de \
--to=bigeasy@linutronix.de \
--cc=linux-can@vger.kernel.org \
--cc=socketcan@hartkopp.net \
/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