Netdev List
 help / color / mirror / Atom feed
* [PATCH net v2 0/2] net: gso: fraglist segmentation fixes
@ 2026-11-20  4:46 Willem de Bruijn
  2026-11-20  4:46 ` [PATCH net v2 1/2] net: gso: cow head on tcp fraglist fallback to skb_segment Willem de Bruijn
  2026-11-20  4:46 ` [PATCH net v2 2/2] net: gso: fall back to skb_segment when fraglist cannot satisfy checksum Willem de Bruijn
  0 siblings, 2 replies; 3+ messages in thread
From: Willem de Bruijn @ 2026-11-20  4:46 UTC (permalink / raw)
  To: netdev; +Cc: davem, kuba, edumazet, pabeni, horms, Willem de Bruijn

From: Willem de Bruijn <willemb@google.com>

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/20261111221129.829218-1-willemdebruijn.kernel@gmail.com/

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(-)

-- 
2.56.1.750.gf70dc682cf-goog


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

end of thread, other threads:[~2026-11-20  4:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-20  4:46 [PATCH net v2 0/2] net: gso: fraglist segmentation fixes Willem de Bruijn
2026-11-20  4:46 ` [PATCH net v2 1/2] net: gso: cow head on tcp fraglist fallback to skb_segment Willem de Bruijn
2026-11-20  4:46 ` [PATCH net v2 2/2] net: gso: fall back to skb_segment when fraglist cannot satisfy checksum 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