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 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 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 | 46 ++++++++++++++++++++++++---------------
2 files changed, 32 insertions(+), 20 deletions(-)
--
2.50.1 (Apple Git-155)