Skip to contentSkip to conversation

packet: use consistent hard_header_len in send paths

PATCH Superseded Qihang 1 participant 1 message Jul 29

Subsystems (3)

v4 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

Qihang

author
#0 lore raw

v4 cover packet: use consistent hard_header_len in send paths

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/[email protected]/

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(-)
Signature · 1 line
2.50.1 (Apple Git-155)