net: gso: fraglist segmentation fixes
Get series with b4
b4 am [email protected]Versions newest first
- v2 Latest2 patches 2 repliesIn review
Changes in v2 from the cover letter
- new patch 1/2
- patch 2/2: move the test into helper skb_gso_fraglist_ok()
- patch 2/2: rebase onto commit 22b7cb932c6a ("udp: check frag_list
IP family before using skb_segment_list()")
- patch 2/2: commit message: explain the skb->encapsulation test, reference the existing skb_segment() fallback, drop the claim that skb_segment() is always safe
v1: https://lore.kernel.org/netdev/[email protected]/
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | net: gso: cow head on tcp fraglist fallback to skb_segmentnet/ net/ | +10 | 0 replies | |
| 2/2 | net: gso: fall back to skb_segment when fraglist cannot satisfy checksuminclude/ net/ net/ +1 more | +41 | 2 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.
Cover letter [PATCH net v2 0/2] net: gso: fraglist segmentation fixes
From: Willem de Bruijn <[email protected]>
Fix two issues when segmenting SKB_GSO_FRAGLIST packets.
Patch 1 unshares the head before the TCP fallback to skb_segment() rewrites the TCP checksum field.
Patch 2 falls back to skb_segment() in more cases where skb_segment_list() produces incorrect checksums: tunnels with outer checksums, and CHECKSUM_PARTIAL packets sent to a device without checksum offload.
Testing
Tested in virtme-ng. A sender injects TCP and UDP GSO packets (20 packets of 20 segments of 1000B) over a veth with TSO disabled. The peer veth has GRO and rx-gro-list enabled, and forwards the fraglist skbs to a tap device without offloads, in three ways:
- routed
- routed into a vxlan device with udpcsum, over the tap
- bridged
Each for IPv4 and IPv6, and with sender checksum offload enabled (CHECKSUM_PARTIAL) and disabled (complete checksums): 24 cases.
A reader on the tap verifies the IP, TCP and UDP checksums of every segment, including inside vxlan. For TCP, a packet socket on the ingress veth holds clones of the GRO packets, and checks whether their TCP checksum field was modified in place.
- net/main: 14 of 24 cases fail.
CHECKSUM_PARTIAL to the tap has incorrect L4 checksums, routed and bridged. Vxlan has incorrect outer UDP checksums: with IPv6 inner packets always, with IPv4 inner packets only with CHECKSUM_PARTIAL.
- This series without the skb_cow_head() of patch 1: the bridged TCP CHECKSUM_PARTIAL cases, IPv4 and IPv6, modify all clones. Routed cases are not affected, as ip_forward() unshares the head.
- This series: all 24 cases pass.
Changes
v1 -> v2
- new patch 1/2
- patch 2/2: move the test into helper skb_gso_fraglist_ok()
- patch 2/2: rebase onto commit 22b7cb932c6a ("udp: check frag_list
IP family before using skb_segment_list()")
- patch 2/2: commit message: explain the skb->encapsulation test, reference the existing skb_segment() fallback, drop the claim that skb_segment() is always safe
v1: https://lore.kernel.org/netdev/[email protected]/
Willem de Bruijn (2):
net: gso: cow head on tcp fraglist fallback to skb_segment
net: gso: fall back to skb_segment when fraglist cannot satisfy
checksum
include/net/gso.h | 33 +++++++++++++++++++++++++++++++++ net/ipv4/tcp_offload.c | 10 +++++++--- net/ipv4/udp_offload.c | 5 +++-- net/ipv6/tcpv6_offload.c | 11 ++++++++--- 4 files changed, 51 insertions(+), 8 deletions(-)
Signature · 1 line
2.56.1.750.gf70dc682cf-goog