Re: [PATCH net-next v2] net: Replace %pK output with 0
[email protected] Tue, 21 Jul 2026 14:40:43 +0000
| Newsgroups | org.kernel.vger.linux-can |
|---|---|
| Message-ID | <[email protected]> |
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider: - [Critical] Missing placeholder for `%pK` in `/proc/net/tcp6` for TIME_WAIT sockets breaks column count. - [Low] The format string for CAN EFF frames uses `%ps` without a width specifier, breaking column alignment. -- --- Patch [1]: [PATCH net-next v2] net: Replace %pK output with 0 --- commit 43254de7fd1d6d9709d84bcd9bfd332145fe505b Author: Sebastian Andrzej Siewior <[email protected]> net: Replace %pK output with 0 Replace the %pK annotation with a 0 value to avoid exposing socket pointers, and correct spacing for cases where the pointer is at the beginning. > diff --git a/net/can/proc.c b/net/can/proc.c > index de4d05ae34597..cc3050f4c8e75 100644 > --- a/net/can/proc.c > +++ b/net/can/proc.c > @@ -192,12 +192,11 @@ static void can_print_rcvlist(struct seq_file *m, struct hlist_head *rx_list, > > hlist_for_each_entry_rcu(r, rx_list, list) { > char *fmt = (r->can_id & CAN_EFF_FLAG)? > - " %-5s %08x %08x %pK %pK %8ld %s\n" : > - " %-5s %03x %08x %pK %pK %8ld %s\n"; > + " %-5s %08x %08x %ps %8u %8ld %s\n" : > + " %-5s %03x %08x %-20ps %8u %8ld %s\n"; [Severity: Low] Does the missing %-20 width specifier in the CAN_EFF_FLAG branch break column alignment? The non-EFF branch uses %-20ps, but the EFF branch only uses %ps, which might cause subsequent columns to be misaligned depending on the length of the symbol name when reading /proc/net/can/rcvlist_*. [ ... ] > diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c > index 522ba45ce9b75..bc45e647c4956 100644 > --- a/net/ipv6/tcp_ipv6.c > +++ b/net/ipv6/tcp_ipv6.c [ ... ] > @@ -2209,7 +2209,7 @@ static void get_timewait6_sock(struct seq_file *seq, > > seq_printf(seq, > "%4d: %08X%08X%08X%08X:%04X %08X%08X%08X%08X:%04X " > - "%02X %08X:%08X %02X:%08lX %08X %5d %8d %d %d %pK\n", > + "%02X %08X:%08X %02X:%08lX %08X %5d %8d %d %d\n", [Severity: Critical] Does removing this %pK placeholder completely instead of replacing it with a 0 break the column count in /proc/net/tcp6 for TIME_WAIT sockets? Unlike other socket states and the IPv4 equivalent where the pointer is replaced with 0, this drops the column entirely. Could this cause userspace parsers relying on whitespace separation to fail or parse incorrect data? -- Sashiko AI review ยท https://sashiko.dev/#/patchset/[email protected]?part=1