[PATCH net v5 0/2] packet: use consistent hard_header_len in send paths
From: Qihang <hidden>
Date: 2026-07-30 08:29:42
Also in:
stable
AF_PACKET send paths read dev->hard_header_len at several stages of skb allocation and construction. Concurrent netdevice reconfiguration can make those reads inconsistent and cause skb headroom underflow. Split the regular and TX_RING paths so each patch has one Fixes tag. The separate SOCK_DGRAM consistency issue between hard_header_len and header_ops->create remains outside this series. Changes in v5: - Drop the unnecessary per-frame copylen reset from patch 2. Changes in v4: - Use one hard_header_len snapshot throughout tpacket_snd(), including reserve and per-frame skb construction. - Carry Willem's Reviewed-by on patch 1. Link to v4: https://lore.kernel.org/netdev/20260729030122.21462-1-q.h.hack.winter@gmail.com/ (local) Link to v3: https://lore.kernel.org/netdev/20260728031345.49562-1-q.h.hack.winter@gmail.com/ (local) Qihang (2): packet: use consistent hard_header_len in non-ring send paths packet: use consistent hard_header_len in TX_RING send path include/linux/netdevice.h | 6 ++++-- net/packet/af_packet.c | 45 +++++++++++++++++++++++---------------- 2 files changed, 31 insertions(+), 20 deletions(-) -- 2.50.1 (Apple Git-155)