Netdev List
 help / color / mirror / Atom feed
* [PATCH net v4 0/2] packet: use consistent hard_header_len in send paths
@ 2026-07-29  3:01 Qihang
  2026-07-29  3:01 ` [PATCH net v4 1/2] packet: use consistent hard_header_len in non-ring " Qihang
  2026-07-29  3:01 ` [PATCH net v4 2/2] packet: use consistent hard_header_len in TX_RING send path Qihang
  0 siblings, 2 replies; 4+ messages in thread
From: Qihang @ 2026-07-29  3:01 UTC (permalink / raw)
  To: netdev
  Cc: willemdebruijn.kernel, daniel.zahka, davem, edumazet, kuba,
	pabeni, horms, stable, Qihang

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/

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)

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

end of thread, other threads:[~2026-07-29  7:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-29  3:01 [PATCH net v4 0/2] packet: use consistent hard_header_len in send paths Qihang
2026-07-29  3:01 ` [PATCH net v4 1/2] packet: use consistent hard_header_len in non-ring " Qihang
2026-07-29  3:01 ` [PATCH net v4 2/2] packet: use consistent hard_header_len in TX_RING send path Qihang
2026-07-29  7:46   ` Willem de Bruijn

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