🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #19616

[PATCH net v2 0/2] net: gso: fraglist segmentation fixes

#19616
From: Willem de Bruijn
Date: Fri, 20 Nov 2026 04:46
65 lines
13150 bytes
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
Technical Details
Message-ID: <20261120044733.222627-1-willemdebruijn.kernel@gmail.com>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-367637-linux-kernel-netdev=dewy.ru

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-367637-linux-kernel-netdev=dewy.ru
From: willemdebruijn.kernel@gmail.com (Willem de Bruijn)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net v2 0/2] net: gso: fraglist segmentation fixes
Date: Thu, 19 Nov 2026 23:46:38 -0500
Organization: Usenet Network
Message-ID: <20261120044733.222627-1-willemdebruijn.kernel@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="3064394"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:e/DIuJXGKM85lo1oCvuCVSqK0Ng= sha256:DcVOQnbaDddG0OdDNleaZ+cuxQSiWttO9JdeEqSVzLs=
	sha1:mFDaHdX5G+VHtyTzrUceuENa97Q= sha256:6W8MUXDqXNJzraxjkdMagw0+XgfzYcfk/7RddjmE1gI=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 19E651158AA; Fri, 20 Nov 2026 07:48:38 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.049
X-Spam-Status: No, score=-3.049 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001,
	FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=gmail.com
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id 3hjN9RWyEUSX;
	Fri, 20 Nov 2026 07:48:27 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-367637-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4])
	by mail.dewy.ru (Postfix) with ESMTPS id 66CA5115860; Fri, 20 Nov 2026 07:48:17 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sin.lore.kernel.org (Postfix) with ESMTP id 998FC895B1; Fri, 20 Nov 2026 04:47:47 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1795150060;
	b=XkNLJybAtxmD7VPstkPhyD9iT2K5q/OpRFDYy1SxV1ESS1GFQtDrrLdehqt5t9axprH8
	 iZpbuzadZBjd5613LxrNAbA9iT0hkmh50lwmEO0WazmyLzRLDXTFnql9hfLYb5B13iPAk
	 15zPt0trKRLcylAfezisxSrZNCPZ1FP2ce0qNrZF4XduscYlMexJxnJiwj0Xzh3iuF7gf
	 I9cSff1+8FBk7Vij4vLXcVwxLyN6Zx4FW/N0o5zBCiOpCscyGu45Z9sNLJxW/NxghIAoZ
	 Cv0NFr181zzPIkCAV+3QVLTB52PY1SgPIXVI12Vg97k2BYFgfMtHxw6+2vsA22yvTvA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795150060;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
	 X-Google-DKIM-Signature:X-Gm-Message-State:X-Gm-Gg:X-Received:
	 Received:From:To:Cc:Subject:Date:Message-ID:X-Mailer:X-Mailing-List:
	 List-Id:List-Post:List-Help:List-Subscribe:List-Unsubscribe:
	 List-Owner:Precedence:MIME-Version:Content-Transfer-Encoding;
	bh=wyC9d9SoyF2ZyiffP4QhM0CpfiDlvbBQ1BMIgXdq5yQ=;
	b=rE/MKJFuxd2o8NeCaoskMtpdVdko98p+z6ck+PrDeQ+0zzlpNfYNiD6R6Bv4OgYR1x7X
	 kgtN8fgbNaWJK7H5O82aRHk/vM+DjSuaaVQ8d8J6ga/mDAOrkbw13F/b4k/Gqfz6Oegrz
	 G/ZFZz6yyctKS0gn8eOi7n3Vh03UsH41aiUS4VfTkNKBpYVQ04TD8L/4tP1DPEsuJ5U3y
	 zov6qRGFwAFAZL6tOBdK7ff131hJOc4lxIDY2onhfrhkuiCMuRibFJVjXMODp5dt+ZFoy
	 1m0/cBJI7wnj5QGdS12EIF6fnNTPXp3yyHTQAPC5jZYNv7DotsIWpAJ//cLypYkHo/A==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=i8mYi8U3;
	dmarc=pass header.from=gmail.com;
	spf=pass smtp.mailfrom=gmail.com;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 277E860A2625;
	Fri, 20 Nov 2026 04:47:40 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=i8mYi8U3
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.217.47
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1795150059;
	b=0oyslFgCqqJHGzCIExwtUKWxMOLg0nMJh8Zqvzwq4xOR9cRsrOHw9WQJ9rA+pVAICEwe
	 h51B7caK23USyKsUqLG96zwl6rx71iE8QKFZM9DMwau2MxLE53SbX0GIJmZRTop5U0QNZ
	 qiqYjAI2PZ+d3EYQzUBLDIfkfqpwIPX56gzVcb7As7W3HlefjW25zLlyc47mdlFqqYx55
	 7U64wUVXz3LT4ZILiF7RsqsJOdEZmPy2QMzaZLJV6FbO6+vodATe7R85bnwAKeEfQx/Cp
	 81hByfGwabSwI/r9pH/9+Bp5aauneN70SIFBzHZ6pd/rZQQKmsU0fKv1txrT5b2wtYw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795150059;
	h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
	 X-Gm-Message-State:X-Gm-Gg:X-Received:Received:From:To:Cc:Subject:
	 Date:Message-ID:X-Mailer:MIME-Version:Content-Transfer-Encoding;
	bh=wyC9d9SoyF2ZyiffP4QhM0CpfiDlvbBQ1BMIgXdq5yQ=;
	b=iHKOqI81pdxnaoJOC0mh7thil13ZkUheAwW8wWjpsJzrOOnFIzHxDgVVqhD7W4HsiOOF
	 DHCUqGFQMKXbPnXlH/ddHJPRax38r5CCcXQZBkemyTQspSF1GyfH3SckZM5uKKppVLM4R
	 9S9J8CR5ZDlrXCOxye+7NhoDSXFWU2+VHQ4qTGnIRE84/79D2M2ES2fw0nejosKWC33jB
	 cfYQxC//ECQ4zKw/7jVmsc06GK9c971u37BPFG40vEQ45pyDMk9IB43nIlYNuD0yxbhdP
	 592LiMhSf+ZpyvK6XvBk4usIMQZTD54nQw8f21P5sD+qUtrgiz6rRnRleh+h5rmvJKg==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=gmail.com;
	spf=pass smtp.mailfrom=gmail.com;
	dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=i8mYi8U3;
	arc=none smtp.remote-ip=209.85.217.47
X-Received: from mail-vs1-f47.google.com (mail-vs1-f47.google.com [209.85.217.47])
	(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 358FF60A261D
	for <netdev@vger.kernel.org>; Fri, 20 Nov 2026 04:47:38 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 358FF60A261D
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-vs1-f47.google.com with SMTP id ada2fe7eead31-7cc53938a8fso402501137.2
        for <netdev@vger.kernel.org>; Thu, 19 Nov 2026 20:47:38 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20260707; t=1795150057; x=1795754857; darn=vger.kernel.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to:content-type;
        bh=wyC9d9SoyF2ZyiffP4QhM0CpfiDlvbBQ1BMIgXdq5yQ=;
        b=i8mYi8U3VAPe+YTVRMGfFkkk6yvsF+ifOjSeb8wrHPb3Fwg90VuJ4zu37PPCiYYbe7
         hSDLRrH0Gd92ggFp2YaZFnAQavgeRhn+ubDFl/wAnMRC8rbZKB0g9WbBSFkEDFkSkUqY
         2ZSAtjpwo+oWfW1g84onxpuReIjwGprvnOGpGn2EFV5HGSvEbLm6Gwgr58JCyOv/Hu9r
         yskk726/zlD2H6ZCUIt5vFM8ZiBeR5QTQV9r5j74MnwYFV8OlXwYsGXn7ABQ0m1tf/XL
         aG0t//3QbyG5OrdxEQhWpn9DZtzfIcOZnOAXmmI5f69iaxi3x4W1Eurb/RHRyB4Lhkp8
         esrw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1795150057; x=1795754857;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=wyC9d9SoyF2ZyiffP4QhM0CpfiDlvbBQ1BMIgXdq5yQ=;
        b=x85JOaLPIemMV6j2bfgYgBiiigKqI3L6MRHp4FIIrl/hOpLxxzo6lMXQW9izyNUi3v
         3TzVsQp8SikzjvDyhED2jUqeZnMWSFAaRc6EKFzgUeUlkaJ9g2NsSX26W4qiXpq9dUKX
         KchA5IDYYanma1Zf/XxKjKH/vRFl3aS2KPZjZaovNAvjIQ1rcsqnBuaV9xdtaha9+x4M
         q3isNpeUog6ucIPomPtlW57g/xswcKGWJaX8FVipphA77KjG3W4t3qdR8wRLK6Du8JXp
         CZ0qgbQhBHW2i4rActO0EEJI0zqQrnyV5u2cZRyTy3E8iIlbdjKOetG+XM4MPPFLXy6a
         XI6Q==
X-Gm-Message-State: APuU4Z9OkTVyPWhSJPSqrdOC5hZRIJFODUoTQqTaie7S6ppNn4fS5vIo
	FICrW9pMOW31X0SOLRlWo3UtTl0HTak82kaoOrx7/9K1JDxYTP8gP2ibrOxFag==
X-Gm-Gg: AZFdTZevoKRYgXvBIkqz6yYLAlo2eN3QzYyJE+ZCruk6wr89488IxkVyoqbE31uebp+
	/52Nd57/8npSJYw/dk7SlbTSq5ACO1gZnc36UU+h4dUfKTkeUSEcAZkm6IfwdMcPHFHZr1UAwez
	eRw/PzJiZ1bI7LjV7iyEz6h0bAL+34R/9pzdQVBcseeLuc49GzzwVcN3f3fkKmIPyt8gNez7iIy
	6oS3GlWRSPE9POpVCfYt7YOlIwf7wwAssUs3nZSlH/MXGIE1X8pYwhe2DOeuMXaxQF6e4HYXWpw
	aitIqlt/qVGjZg/aWR9eN/9V97jeyXj+RL1ynbU8/GBjsrwY12zrs+a7vqa6rwZXy9YotVL3vtA
	rvOiqG94l2OAhBLK/Gyms86nH3muTdFWux80ere6vxJqzs0gOT1e7fSt5D+0FGdnCTrxLCCgNmw
	UlTixeMQnXJZfRzszBXg1lwL/AZ8Stv9TW1vjWVPPJNoYT2J3pIIadtiy+ecBXxIsInnc3VhHET
	UUqS8II5okkg2FDJa4uo9VUXqxp6+jE446MJTZC7Ax2tjdIMgRktpAJkHK3w4RyT5vvbdYOye6R
	u1n0Lfz/9PuzCw1oEGWn9Sd0UTj2RBlH+zV5yzNmMsseGMxBvVK5VZb2GQ1rerwFcB5ahA08yS3
	V0cdVxAkpuqXVA5cGr4KV2AFsne6FoWYOXLwKp69z15S7NGE7cHnBvQPw3OqO+wj0Qu5vcZpwDF
	lzZi8jqcUq/sbg/nh0/Bs38larabsQC6o=
X-Received: by 2002:a05:6102:5698:b0:7d2:8610:3223 with SMTP id ada2fe7eead31-7d73968ae3emr871696137.34.1795150057173;
        Thu, 19 Nov 2026 20:47:37 -0800 (PST)
X-Received: from willemb.c.googlers.com.com (15.60.86.34.bc.googleusercontent.com. [34.86.60.15])
        by smtp.gmail.com with ESMTPSA id ada2fe7eead31-7d6e7f92680sm1966811137.5.2026.11.19.20.47.36
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Thu, 19 Nov 2026 20:47:36 -0800 (PST)
X-Cc: davem@davemloft.net,
	kuba@kernel.org,
	edumazet@kernel.org,
	pabeni@redhat.com,
	horms@kernel.org,
	Willem de Bruijn <willemb@google.com>
X-Mailer: git-send-email 2.56.1.750.gf70dc682cf-goog
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list