Thread (12 messages) flat view 12 messages, 1 author, 3d ago

Re: [PATCH net-next 00/10] net: remove skb mac_header assumptions in TX paths (I)

From: Eric Dumazet <edumazet@google.com>
Date: 2026-09-02 11:22:51

On Wed, Sep 2, 2026 at 2:33 AM Eric Dumazet [off-list ref] wrote:
In the transmit path, network drivers should not assume that
skb->mac_header has been set.

In the TX path, skb->data points to the start of the L2 header. Using
eth_hdr(skb) or vlan_eth_hdr(skb) when mac_header is unset reads from
skb->head + (u16)~0, leading to out-of-bounds reads (flagged by KASAN)
or triggering DEBUG_NET warnings.

Commit 96cc4b69581d ("macvlan: do not assume mac_header is set in
macvlan_broadcast()") introduced skb_eth_hdr() (and later commit
1f5020acb33f ("net: vlan: introduce skb_vlan_eth_hdr()")) to safely
access L2 headers in TX paths via skb->data without needing to call
skb_reset_mac_header().

This series converts the first batch of 10 network drivers and virtual
devices to use skb_eth_hdr(), skb_vlan_eth_hdr(), and
skb_checksum_start_offset() in their TX paths, and removes now redundant
skb_reset_mac_header() calls.

When all drivers are converted, we will remove skb_reset_mac_header()
from our TX fast paths.
AI-reviews have killed the notion of patch series.

I will send stand alone patches, to avoid 10+ versions ;)

pw-bot: cr
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help