Skip to content

packet: use consistent hard_header_len in send paths

Qihang netdev stable 6 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest2 patches 5 repliesIn review
  2. v4 posting 2/22 patches 2 repliesSuperseded
  3. v4 posting 1/20 of 2 patches 0 repliesSuperseded
Earlier versions · 3
VersionPostedPatchesRepliesStatus
v3 posting 2/22 patches2 repliesSuperseded
v3 posting 1/20 of 2 patches0 repliesSuperseded
v21 patch1 replySuperseded

Changes in v5 from the cover letter

- Drop the unnecessary per-frame copylen reset from patch 2.

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2packet: use consistent hard_header_len in non-ring send pathsinclude/linux/netdevice.h net/packet/af_packet.c+20 -120 replies
2/2packet: use consistent hard_header_len in TX_RING send pathnet/packet/af_packet.c+11 -85 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchWillem de Bruijn
SeriesR-b R-b R-b
1/2R-b
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v5 thread

Cover letter [PATCH net v5 0/2] 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 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/[email protected]/
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    | 45 +++++++++++++++++++++++----------------
 2 files changed, 31 insertions(+), 20 deletions(-)
Signature · 1 line
2.50.1 (Apple Git-155)