From: Jakub Kicinski <kuba@kernel.org>
To: Doruk Tan Ozturk <doruk@0sec.ai>
Cc: Vladimir Oltean <olteanv@gmail.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
Florian Fainelli <f.fainelli@gmail.com>,
Woojung Huh <woojung.huh@microchip.com>,
Nick Child <nnac123@linux.ibm.com>,
"David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
linuxppc-dev@lists.ozlabs.org,
Sabrina Dubroca <sd@queasysnail.net>,
Arun Ramadoss <arun.ramadoss@microchip.com>,
UNGLinuxDriver@microchip.com,
Michael Ellerman <mpe@ellerman.id.au>,
Willem de Bruijn <willemb@google.com>
Subject: Re: [PATCH net 0/3] net: don't read an unset MAC header on the raw/qdisc-bypass TX path
Date: Wed, 22 Jul 2026 09:58:26 -0700 [thread overview]
Message-ID: <20260722095826.1685b943@kernel.org> (raw)
In-Reply-To: <20260713194010.54642-1-doruk@0sec.ai>
On Mon, 13 Jul 2026 21:40:07 +0200 Doruk Tan Ozturk wrote:
> On the AF_PACKET SOCK_RAW + PACKET_QDISC_BYPASS transmit path, skb->mac_header
> is left unset when ndo_start_xmit() runs, so eth_hdr(skb) resolves ~64KB out of
> bounds. Commit f5089008f90c ("macsec: don't read an unset MAC header in
> macsec_encrypt()") fixed one instance; these three are the same class in other
> TX/.xmit paths, each reading eth_hdr(skb)->h_dest. On TX the L2 header is at
> skb->data, so use skb_eth_hdr() (a no-op on normal TX where mac_header is set).
>
> Found by static analysis (0sec); verified against source, not runtime-reproduced.
> Confirmed by an independent cross-check that mac_header is unset on the bypass
> path (__dev_direct_xmit does not reset it). More siblings exist (sja1105 shared
> TX/RX helper, atlantic PTP path) and will follow separately.
If there's one known source of such strange packets we generally try to
fix the problem at the source rather than hardening the whole stack
against bad packets.
Can we make SOCK_RAW + PACKET_QDISC_BYPASS set the header offset
instead? (If not the relevant analysis should be part of the cover
letter).
--
pw-bot: cr
prev parent reply other threads:[~2026-07-22 16:58 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-13 19:40 Doruk Tan Ozturk
2026-07-13 19:40 ` [PATCH net 1/3] net: dsa: tag_ocelot_8021q: don't read an unset MAC header on transmit Doruk Tan Ozturk
2026-07-13 20:04 ` Vladimir Oltean
2026-07-13 21:12 ` Doruk (0sec)
2026-07-13 21:37 ` Vladimir Oltean
2026-07-13 19:40 ` [PATCH net 2/3] net: dsa: tag_ksz: don't read an unset MAC header in lan937x_xmit() Doruk Tan Ozturk
2026-07-13 19:40 ` [PATCH net 3/3] ibmveth: don't read an unset MAC header on transmit Doruk Tan Ozturk
2026-07-22 16:58 ` Jakub Kicinski [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=20260722095826.1685b943@kernel.org \
--to=kuba@kernel.org \
--cc=UNGLinuxDriver@microchip.com \
--cc=andrew+netdev@lunn.ch \
--cc=arun.ramadoss@microchip.com \
--cc=davem@davemloft.net \
--cc=doruk@0sec.ai \
--cc=edumazet@google.com \
--cc=f.fainelli@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=netdev@vger.kernel.org \
--cc=nnac123@linux.ibm.com \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
--cc=sd@queasysnail.net \
--cc=willemb@google.com \
--cc=woojung.huh@microchip.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
Powered by JetHome