From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.208.44 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796549013; b=cX0bCJFw5LuWIyZH3jmp+brVdqC/2VfuE/NwjeaVt1qGhA7Zr2RSA7TLgTUI5hl03uEr nY3RSFjXhYYHwoPnhgVxmuF8rnWiE+SJWmZLIoeD/+pRU4nH/CHJ21Z9v83FaWv3L9vgK e01eKbDwmIdtZyP1gX6BVQu2vPeMShZNnpzBBE1T4ywDXLjljxn+zAeWly4i6pz7hcnYr 5X4B67RcgfsNdCrLKVD4yyeiLYbQtr7p+QrSYALIEW0Gnd7i7YLRsQM1Zh4brZ/aIBd1Q anoMq7lb4LVx+2xSK/PaTPaDLkQT5VevjnGVg4h5yLFXarIpvRxPmVs2IkjCM94lUBw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796549013; 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=Unmpmt7wlJWd2L4o7bhjwWJhJvrYRZMFHBHf0UPVSnA=; b=4YOtbuBb/4t9l84MPw8cXFNqV8azkVqdVD8O9AF17G45wDb+BLY4BVyZqUc3aACSgS+2 ltlkZNJb6PCntbhdAoXNnETA7MMQxpOVMhZxb7i3KtmnYJszobZa/r1A29ruISw+ufzd9 UJafyMIpvW8qmbmH1wFs5jRF/TUfeEwpRGE3RXqkmjruGN+yO5Fm6eY3RejZhD288s9uS WzkgY0LE6cHU0W9/1f7pYidDPZFbGPR7lHnZu8iZxvCrQxHOhXqki7J1/BPaL+5A0WHH6 pWiBEE7JP6gKBn0PqbzINpBu+uuHaR0i8h5YdX4CnJN4WoTPx0F5YLFQj8MU326D/Fw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=bairaktaris.de; spf=pass smtp.mailfrom=bairaktaris.de; dkim=pass header.d=bairaktaris.de header.i=@bairaktaris.de header.a=rsa-sha256 header.s=google header.b="W2O7tSI/"; arc=none smtp.remote-ip=209.85.208.44 Received: from mail-ed1-f44.google.com (mail-ed1-f44.google.com [209.85.208.44]) (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 0750D606A33D for ; Sun, 6 Dec 2026 09:23:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 0750D606A33D Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bairaktaris.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bairaktaris.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=bairaktaris.de header.i=@bairaktaris.de header.a=rsa-sha256 header.s=google header.b=W2O7tSI/ Received: by mail-ed1-f44.google.com with SMTP id 4fb4d7f45d1cf-6b4bd3d98bfso2888268a12.1 for ; Sun, 06 Dec 2026 01:23:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bairaktaris.de; s=google; t=1796549011; x=1797153811; 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=Unmpmt7wlJWd2L4o7bhjwWJhJvrYRZMFHBHf0UPVSnA=; b=W2O7tSI/YRdkX5U+iGuoHt6lDyIR+PWAUi4RJguUGpQqdi8+Axaf9q1kJZrxbxnFCg KBJ1n6teKjzyow+TRlnPHlayDT3nrRSGnXEsCoGS5v2MBUH92ALSUBIF7vTMyHlO2MBV bSM0jlPJ1LtZL0Bf0Usmr2ERjsgonAmARnqrRoJMMQSa/zG5b7Sl2ln1/pcrQEL9HT6R 0NX4U9oGTtJfOJ6eQkj0yoylHr28PQuJvk8RAMukF+dGRRDMRWY10NECg093795+bzz9 +JSfWL/ioQ7QwzdnM8UmOGYViJSfMCAKoSu72xW9PY2M9sQqPdoWnnW1BZx45nJtkiJT D2tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796549011; x=1797153811; 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=Unmpmt7wlJWd2L4o7bhjwWJhJvrYRZMFHBHf0UPVSnA=; b=oFqVwOF/QCCtGTVGZHbVSa4yU3gxIorTToZ5uWR5Y6kcAWi0vG2lVjhSAKDWeKAhL+ a3KJyVfNwmtFIhlYcB0MoaCtMBPCZ4wIwDeg1yNBiz3cG+yWMRTZQeKyQIQrZcVDpBcO J3mH0Zz/Jv2tLBViOLXajxPFsQtvTYKtnAvlliFQEAvqEmLO5CulHf8Hn7LExeNtIOSc k0nL4I6OSSgHv1olmBADhYeQWHS2W/BUZs0y5P0JWDQdbHY0EK7aDWt4bWN7eNyVQQM+ bp7X/I8cW6PfJZsSrXIynCTAkGk+WIA5A+meYLF9OMvZ3pa1XqdbKp/ZW06WBm6mXhJI qS9Q== X-Gm-Message-State: AB4q+uHg3v6+YSGSKOVZ+QBfvKiNxTr0ybZUBO6kOB8Q0yP2WoWNvYLv mYGTBRBnV1fV6/puQLkzeJpB3gTV7YXuFgogfnduDrFxc4REDIkMwAr5Raky6Mwy/MDnVU0Bp2A MqIaJLKtO X-Gm-Gg: AZFdTZfK6upPktCwepLhgIOBiBqmp/n+qnbwCMO4KHGjWpIZYE5GM0iPuWpzLvgAn+K 3auebEGiWc/+MX1rif4c3RTQKexruDZdLsCC7unE4vLYcOjRFPH+xCqR69C0ZKHcsFvNhqcA6Dt wuRWkgDq3uu6XXllM0qMfWQf/fxHGdi7mKfmPWnVQ1Yc8TikLaIK00kvABKdMwWoADEww7rsOxx GAiHq4zIXbUe8D6qk2D8P3q3J0dJjh4bkEmMO7AlTckGuxh+HutcNTUTorqVP9UUDLE+hc3uaUJ sko0Rs1ecV2/2+RNm0LNQEBD2pge4wktV3ftJlA8iMW+gGaRoZP6L96Ms02oSiK8Re/5NLtEkFv G9k4xHMwqJKVLZqXEz1ZTp50SCg/NJdgTaysb/8arqt/+s1o32Mz5xwv2EQ8GBIMRnyvgI7HD13 bwCLXBEseq0fN4QOyff3EUPSBZHv4gVLuAvoiBrFwhHfTGN6ETz62zM/jH9DiALZn2NWMZlceZ+ yqjXIRMYQgJJcni+zyRSagEZ6nvV4hBP0h/wHjg9GNVeyAHJRjRm0BwM/RYGcf1QJzqsf714UJa FS/cyQR9k2bjJytmch6ojmkJ7uF7fVF1Fndv+Ds9n2Oa6lUWjFunDfEOZZRKW3p2BWyrktBChsi ivMK98qBmEyqkx47yxZ6IfyZMMKjvWg7IQwnXIWjfnq0lO25n79lh+D0xzs98WtYf2UHArZ0chq rT/8L9l/UR2k7pJVLy6xyZZb+wOJh4wEMnZDbp4VNiP7Lx8rlu5oiYlE8suIQA/AEgI0InRBfWj ZX1tnA+AKxqbia6APJZ4gwlTh5avLAHUbS3BzMekDrM8cAJafCUW6Gq2Qohax5vziQLpdOKATvj hKq9SWCDc7axWvRwAdfQfEstiWADJ2UZskh+23NDovw= X-Received: by 2002:a05:6402:5106:b0:6ba:39f2:9e43 with SMTP id 4fb4d7f45d1cf-6bcc1c156a2mr4770227a12.28.1796549011238; Sun, 06 Dec 2026 01:23:31 -0800 (PST) Received: from Desktop.tail070c67.ts.net (p54affbb4.dip0.t-ipconnect.de. [84.175.251.180]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-6bcbc0070absm2346583a12.30.2026.12.06.01.23.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Dec 2026 01:23:29 -0800 (PST) From: Julius Bairaktaris To: netdev@vger.kernel.org Cc: davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, horms@kernel.org, sdf.kernel@gmail.com, willemb@google.com, willemdebruijn.kernel@gmail.com, ncardwell@google.com, kuniyu@google.com, alice.kernel@fastmail.im, wang.zhan@smartx.com, marcelo.leitner@gmail.com, lucien.xin@gmail.com, linux-sctp@vger.kernel.org, dsahern@kernel.org, dahern@nvidia.com, steffen.klassert@secunet.com, nbd@nbd.name Subject: [PATCH net v2 0/3] net: gso: segment length of encapsulated GSO packets Date: Sun, 6 Dec 2026 10:23:24 +0100 Message-ID: X-Mailer: git-send-email 2.53.0 X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit skb_gso_transport_seglen() returns the length of one segment of a GSO packet, which the MTU checks of IPv4 and IPv6 forwarding and output compare with the MTU. For an encapsulated packet it counts from the inner transport header and adds the inner L4 header: fraglist GRO leaves the inner transport header unset for the inner flow of a tunnel, and the inner UDP and SCTP headers are not counted. Patch 1 sets the inner transport header in the fraglist completion of TCP and UDP GRO, IPv4 and IPv6. Patch 2 counts the inner UDP header of encapsulated UDP GSO packets. Patch 3 counts the SCTP header of encapsulated SCTP GSO packets. Patch 1 is hit by tunnel traffic from the network (VXLAN, FOU/GUE, GRE, IPIP, SIT) forwarded by a host whose ingress has rx-gro-list on: the forwarded aggregates are dropped or their segments checked against the MTU with a wrong length. Patches 2 and 3 are hit by UDP GSO packets in a UDP tunnel and by SCTP over UDP, forwarded or sent over a smaller MTU: segments of up to 8 or 12 bytes over the MTU leave whole and are lost further on. The bugs were found by Sashiko reviews of earlier versions of "ipmr: forward GSO multicast packets". Tested in QEMU (KVM) with network namespaces, on net (6902a2bb708c), 2 runs per case on net and with this series: - VXLAN with an inner UDP or TCP flow over IPv4 or IPv6, outer UDP checksum zero or set, rx-gro-list on the router, forwarded unicast over a 1400-byte route, 1000 packets per case: net delivers 33 to 186 per case (12 cases); with this series all 1000 arrive with valid outer and inner checksums, also with checksum offload on the egress. - An SCTP association over UDP with a 1500-byte path MTU through a router whose egress MTU is 1496 bytes: on net the router hands the egress 17 to 20 (IPv4) and 28 (IPv6) GSO packets with segments of up to 1500 bytes; with this series none. - ip6gre_{flat,hier}{,_key,_keys}.sh: every test passes on net and with this series. Changes in v2: - Resend as asked by Stanislav Fomichev; rebased on net 6902a2bb708c, no code change. The ip6gre failures NIPA reported on v1 came from another patch in the same NIPA branch. - Cover letter: test results on the new base; trigger and impact as prose. - v1: https://lore.kernel.org/netdev/cover.1795884313.git.julius@bairaktaris.de/ Changes in v1, since "ipmr: forward GSO multicast packets" v6, whose patches 1 and 3 are patches 1 and 2 here: - Split out of the ipmr series (Willem de Bruijn). - Patch 3 (new): count the SCTP header in the encapsulated branch of skb_gso_transport_seglen() (Sashiko on v6 patch 3). - Patches 1 and 2: name the IPv6 users of the segment length in the commit message. - ipmr v6: https://lore.kernel.org/netdev/cover.1795295554.git.julius@bairaktaris.de/ I used Claude (Anthropic) to help write these patches. Julius Bairaktaris (3): net: gro: set the inner transport header of encapsulated fraglist packets net: gso: count the inner UDP header of encapsulated UDP GSO packets net: gso: count the SCTP header of encapsulated SCTP GSO packets net/core/gso.c | 4 ++++ net/ipv4/tcp_offload.c | 3 +++ net/ipv4/udp_offload.c | 3 +++ net/ipv6/tcpv6_offload.c | 3 +++ net/ipv6/udp_offload.c | 3 +++ 5 files changed, 16 insertions(+) base-commit: 6902a2bb708c4075d3de6ec18ab6a5864c4c1aa2 -- 2.53.0