From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
To: netdev-bot+sashiko@kernel.org, quchaosheng000406@163.com
Cc: willemdebruijn.kernel@gmail.com, davem@davemloft.net,
edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
horms@kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, mkl@pengutronix.de,
socketcan@hartkopp.net, stable@vger.kernel.org,
benquike@gmail.com
Subject: Re: [PATCH v3 net] net/packet: guard the ll header push in packet_rcv_spkt()
Date: Wed, 30 Sep 2026 21:01:32 -0400 [thread overview]
Message-ID: <willemdebruijn.kernel.34fd899c50ed8@gmail.com> (raw)
In-Reply-To: <179081112900.434549.3927636774761151103@kernel.org>
netdev-bot+sashiko@ wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential
> issue(s) to consider.
>
> Critical: 0 · High: 0 (2) · Medium: 1 · Low: 0
>
> If you believe none of the issues are legitimate, please reply to each
> issue of Medium severity or higher and explain why the AI is wrong.
> If any of them are legitimate and you plan to respin, please let patchwork
> know by including "pw-bot: cr" as a separate line at the end of your reply
> (one such reply per series is enough).
>
> - [Medium] The history and Fixes attribution in the commit message are
> inaccurate.
>
> Pre-existing issues:
> - [High] This problem wasn't introduced by this patch, but the same CAN
> RX skb with mac_header == 0xFFFF (left that way by init_can_skb()…
> - [High] This problem wasn't introduced by this patch, but the
> SOCK_PACKET receive path this patch touches leaks stale skb->cb bytes…
>
> [Severity: High]
> This is a pre-existing issue, but further down, packet_rcv_spkt() builds
> the sockaddr_pkt in place in skb->cb:
>
> spkt->spkt_family = dev->type;
> strscpy(spkt->spkt_device, dev->name, sizeof(spkt->spkt_device));
> spkt->spkt_protocol = skb->protocol;
>
> strscpy() writes strlen(name) + 1 bytes and doesn't pad, and nothing clears
> the rest of spkt_device. packet_recvmsg() then copies the full
> sizeof(struct sockaddr_pkt) to userspace:
>
> memcpy(msg->msg_name, &PACKET_SKB_CB(skb)->sa, copy_len);
>
> Can this leak stale skb->cb bytes to userspace?
This is being addressed in a separate fix that is in the review process:
https://lore.kernel.org/netdev/20260919215237.3470987-1-benquike@gmail.com/
next prev parent reply other threads:[~2026-10-01 1:01 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-28 11:31 [PATCH v3 net] net/packet: guard the ll header push in packet_rcv_spkt() Quchaosheng
2026-09-28 22:55 ` Willem de Bruijn
2026-09-29 7:36 ` Quchaosheng
2026-09-29 14:58 ` Willem de Bruijn
2026-09-29 14:58 ` Willem de Bruijn
2026-09-30 23:32 ` netdev-bot+sashiko
2026-10-01 1:01 ` Willem de Bruijn [this message]
2026-10-02 1:40 ` patchwork-bot+netdevbpf
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=willemdebruijn.kernel.34fd899c50ed8@gmail.com \
--to=willemdebruijn.kernel@gmail.com \
--cc=benquike@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mkl@pengutronix.de \
--cc=netdev-bot+sashiko@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=quchaosheng000406@163.com \
--cc=socketcan@hartkopp.net \
--cc=stable@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.