Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next 00/10] net: remove skb mac_header assumptions in TX paths (I)
@ 2026-09-02  0:33 Eric Dumazet
  2026-09-02  0:33 ` [PATCH net-next 01/10] bonding: do not assume mac header is set in ALB/TLB tx paths Eric Dumazet
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: Eric Dumazet @ 2026-09-02  0:33 UTC (permalink / raw)
  To: David S . Miller, Jakub Kicinski, Paolo Abeni
  Cc: Simon Horman, Andrew Lunn, netdev, eric.dumazet, Eric Dumazet

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.

Eric Dumazet (10):
  bonding: do not assume mac header is set in ALB/TLB tx paths
  atlantic: do not assume mac header is set in aq_ndev_start_xmit()
  ibmveth: do not assume mac header is set in ibmveth_start_xmit()
  net: mediatek: do not assume mac header is set in mtk_start_xmit()
  netvsc: do not assume mac header is set in netvsc_start_xmit()
  macsec: do not assume mac header is set in macsec_encrypt_finish()
  macvlan: do not assume mac header is set in macvlan_broadcast()
  vxlan: do not assume mac header is set in tx paths
  cdc_mbim: do not assume mac header is set in cdc_mbim_tx_fixup()
  ice: do not assume mac header is set in tx paths

 drivers/net/bonding/bond_alb.c                |  8 +++----
 .../net/ethernet/aquantia/atlantic/aq_main.c  |  2 +-
 drivers/net/ethernet/ibm/ibmveth.c            |  2 +-
 drivers/net/ethernet/intel/ice/ice_eswitch.c  |  2 +-
 drivers/net/ethernet/intel/ice/ice_txrx.c     |  4 ++--
 drivers/net/ethernet/mediatek/mtk_eth_soc.c   |  2 +-
 drivers/net/hyperv/netvsc_drv.c               |  3 +--
 drivers/net/macsec.c                          |  3 +--
 drivers/net/macvlan.c                         |  5 ++--
 drivers/net/usb/cdc_mbim.c                    |  5 ++--
 drivers/net/vxlan/vxlan_core.c                | 24 +++++++++----------
 drivers/net/vxlan/vxlan_mdb.c                 |  4 ++--
 12 files changed, 28 insertions(+), 36 deletions(-)

-- 
2.55.0.966.g6673acef38-goog


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2026-09-02 11:22 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-02  0:33 [PATCH net-next 00/10] net: remove skb mac_header assumptions in TX paths (I) Eric Dumazet
2026-09-02  0:33 ` [PATCH net-next 01/10] bonding: do not assume mac header is set in ALB/TLB tx paths Eric Dumazet
2026-09-02  0:33 ` [PATCH net-next 02/10] atlantic: do not assume mac header is set in aq_ndev_start_xmit() Eric Dumazet
2026-09-02  0:33 ` [PATCH net-next 03/10] ibmveth: do not assume mac header is set in ibmveth_start_xmit() Eric Dumazet
2026-09-02  0:33 ` [PATCH net-next 04/10] net: mediatek: do not assume mac header is set in mtk_start_xmit() Eric Dumazet
2026-09-02  0:33 ` [PATCH net-next 05/10] netvsc: do not assume mac header is set in netvsc_start_xmit() Eric Dumazet
2026-09-02  0:33 ` [PATCH net-next 06/10] macsec: do not assume mac header is set in macsec_encrypt_finish() Eric Dumazet
2026-09-02  0:33 ` [PATCH net-next 07/10] macvlan: do not assume mac header is set in macvlan_broadcast() Eric Dumazet
2026-09-02  0:33 ` [PATCH net-next 08/10] vxlan: do not assume mac header is set in tx paths Eric Dumazet
2026-09-02  0:33 ` [PATCH net-next 09/10] cdc_mbim: do not assume mac header is set in cdc_mbim_tx_fixup() Eric Dumazet
2026-09-02  0:33 ` [PATCH net-next 10/10] ice: do not assume mac header is set in tx paths Eric Dumazet
2026-09-02 11:22 ` [PATCH net-next 00/10] net: remove skb mac_header assumptions in TX paths (I) Eric Dumazet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox