From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.218.51 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795884466; b=WIk1au1pWdnw9BHVjJOTjxVqqY7I5KV6/eg8NAe9uaAbboU6c+j0TnhykWKojGA0PWYN Gl+PbJk+n8qbryTs7KmToB0VAP2/MKXoq0QJY6IuuYZCGaJfVeNkyb46ULG0+G+KdYf1w 3mkVmHzkvCwGX79QlB+QJNCBaCVtYxJquHy5doX2ZpdQR7Yg5JS2TX458RrgI58mWZOmp OSiPj0CG/lG7JwMld7gc4Ptw3k24OIaG6CROigl2t6GJzuVaJllyCYV/PK5pCTjIWsLyk Ud/qqUGenPSnZYUQsEVNZ0cNrcRx9qoGlT1rva1zKxnaGFHjibtdzg3MdAmLwGcPj2Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795884466; 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=3596HjROiJ7Gn+b50hg/QKmPEcTqxtsdfJ1GBmuz0HE=; b=ovnoyImJN6XY4lW3FbxD8z+vH7o+QBDkavdb7f4fgS06hjDJuftXk0K7H8d+oWsXzlpK knMmbiErTyz9GfOzHoAZJeMak64sdYVY62lKBfjrr1G90bML+tpdpibcTYVHDyFguV0vw 6AQBvMax8Wm4X1teQnmNqJzKKjkv3HcAH+Mq1OE1cBWyFRp7J1Fp+IxlZEIsfnyxiVpa4 DcSRnC3VlkETGEnocrk25ZnpJ//wG9uVfzFJ7KJRgIdJpIb2gX9JoY0ehB87Udnrf+2i8 ZogjIULo+TJnUcHfbH4O3OLg4YEFT6lgitZRx4eU3e8hvHc6zTkQI9CCdky2Eyk/zdQ== 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=oAPBQilS; arc=none smtp.remote-ip=209.85.218.51 Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com [209.85.218.51]) (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 9F7AD606A31C for ; Sat, 28 Nov 2026 16:47:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 9F7AD606A31C 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=oAPBQilS Received: by mail-ej1-f51.google.com with SMTP id a640c23a62f3a-c51a14bd405so524576466b.2 for ; Sat, 28 Nov 2026 08:47:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bairaktaris.de; s=google; t=1795884464; x=1796489264; 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=3596HjROiJ7Gn+b50hg/QKmPEcTqxtsdfJ1GBmuz0HE=; b=oAPBQilS6SdL6dhnqxjYWESVAMBCyXzmgNlz6JuvK3izxH88rkeI2jAqHwmbtfFXje 9+vsIyCxST0GqmxQKdg9e0qouVp1lyBy1TIq2fCXadVLY/JxFQ3BM9n38bHUf2xTjo8L LqyXEQQi9Psv5bJmJrKazs6xB2j8z3O+J8dvnEThty5hPkpHUlKu91r0cIXIlVL9YiFh 1FVuKncBxj5WhyTXmrG1fURMS/wckaMlzcQTcIkiGGEo1vVPvO1y0Vhcd/QSbw0QiMTh 7V9VanvWjKkeTNIHOrTgRcKXBpcyLj3QcWknb0qJMJfHCZbG9khTgSZEFO4F6QrQ7PyZ MG2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795884464; x=1796489264; 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=3596HjROiJ7Gn+b50hg/QKmPEcTqxtsdfJ1GBmuz0HE=; b=v8ZHyuJ3cOI+P626D7FYhMfZ7FPXiRdyc+Y+dFkKGY7wC9JWcS62LVdN9sVZWXe00f WVI19ZrBa6KjXUy/6olsWk1uUGTNxBM9JLxWV0ddMb12wYax1+Qt3mnpkJWmV1FTRHrC rqZIHJUe/DOocXMy2pSwHdSlnNEhtvrx/w2WBNWjT7YGDBruQM5bHe14f0SuP4a4XAMN xZeZen93Ei2oUDWRgHoZcfE9eY2byDsF/rR/xROjgX6pp1jGaFlTY49KlpsTMp2gjNBY 0m4W6SGKizxw9EG46MtXDIrq1ilGxnO6unzEZMI5xjI7yAPCKI6wSn+aEzOUuqnb0hyL dqxA== X-Gm-Message-State: APuU4Z8+Qcvd/bNgbLDRFhn9robj0GWg/j0N768PWjgVaFi3UTAhENm5 7rn7RnNqrQ/7wBS/UsMkmGpNeHL97XNtiFrNIiEnEEw5g1S7Q2r4dlR2u+noSI9/Z5akdrBcuJk E/LvJrUHR X-Gm-Gg: AZFdTZfqmGs4ijth0di2zAtgo3PJ2Z5ebL+/v5fQPHvUug/laT5wdLD8SbbE0JIrzpf V+X0vBOEANnM5Z4ukOnPtcQef0SJTk+xokSWPnyAj5FEhCTokYlS9kduMUeQi0XB5u/9onMgr0o O8sdf50QZz5H10mvy56cWvy2IxLAaRCnCGHPWFhA+au8UvwfaDorEQ0hfS3UK5XoNkwwSJYsU4Q z+tILzg5ceyzK1rRQ1rbxcVMcDHvpkNsf4dLigqCGzQo8998OHTBblLqNvkQmH/wlhZZpkvwWQV YZB6ii5tP7EqVlaN2EvTyClFdip80aSnsqfI8KVHCVYMRkr0dOdvCzz5HH0UcYj9hGnjHB/f+iI 0M4Wjt0iDl5SHfbjcz4w1lB8vTjtWrtFbpQgROkRk9l3mcfG9LXMqz9sbxI5b++DGJWxLCyk6Tm itlEgfdsRmcK8Jhe7h0KIyY6k8GWSR9UQmnnOnPiqV5+KVsFOHdzfwtO/inwKVlKty0PzkIdGIt 5C0nUMCK1z8VD/6DQml6IJtX7KCHOoABmFlHk4CfNaJ/FlIuZlIOsrklfbgVxbGi3LjaT7i4gdb 81439bTbtlmYk705PMO1Ejx66vi3lvbsomwb2F2NGcMUcmagQxZ78XvbVY/t5F2n37ZA3uZPbOh jjOo2aoSXbo+xG3PKaLRXP+FgyAqorm5CFr8cbNCK20QDCzBSiGy002aqBLIchN30wNM62dNiYO 5J0yRuWXXmRIvniDwWO7AaZeoJtNSs3EucIRr0fyux24mwKFUca1oyHtT+FGIIT2GVDERV+1f6U 5VkfFkoNCaCs4NpPt0Zs/QJfTB9K5dqS866SzJwThXjY+WciXvOTLCheyNhb0/pcAgsDcP1jYv+ 91OVYmBTlNO44w== X-Received: by 2002:a17:907:3f20:b0:c29:4fcb:2886 with SMTP id a640c23a62f3a-c51d34ed7ecmr506540366b.39.1795884463788; Sat, 28 Nov 2026 08:47:43 -0800 (PST) Received: from Desktop.tail070c67.ts.net ([185.152.145.248]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c513aea3537sm954356166b.36.2026.11.28.08.47.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Nov 2026 08:47:43 -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, 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, steffen.klassert@secunet.com, nbd@nbd.name Subject: [PATCH net 0/3] net: gso: segment length of encapsulated GSO packets Date: Sat, 28 Nov 2026 17:47:40 +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. Per issue: - Trigger: patch 1, tunnel traffic from the network (VXLAN, FOU/GUE, GRE, IPIP, SIT) forwarded by a host whose ingress has rx-gro-list on; patch 2, UDP GSO packets in a UDP tunnel (UDP GRO behind a tunnel socket, UDP_SEGMENT over VXLAN) forwarded or sent over a smaller MTU; patch 3, SCTP over UDP (net.sctp.udp_port and encap_port set) forwarded over a smaller MTU. - Impact: patch 1, the forwarded aggregates are dropped or their segments checked against the MTU with a wrong length; patches 2 and 3, segments of up to 8 or 12 bytes over the MTU leave whole and are lost further on. No memory safety issue. CVSS 3.1: 3.7 (AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L). - Until the fix lands: patch 1, ethtool -K rx-gro-list off; patches 2 and 3, nothing short of the fix. - Found: by Sashiko reviews of earlier versions of "ipmr: forward GSO multicast packets". Tested in QEMU (KVM) with network namespaces, on net (28a371228d4e): - 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 35 to 195 per case (2 runs of 12 cases); with this series all 1000 arrive with valid outer and inner checksums, also with checksum offload on the egress (5 runs, one with KASAN). - 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 20 (IPv4) and 28 (IPv6) GSO packets with segments of up to 1500 bytes (2 runs); with this series none (5 runs, one with KASAN). Changes 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. - Rebase onto net. - 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: 28a371228d4eb4857cc31eeb1a0d7d01e9c3ea2f -- 2.53.0