From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 7EA4A1FF14C for ; Fri, 29 May 2026 11:11:37 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id A20BE57BC; Fri, 29 May 2026 11:11:35 +0200 (CEST) From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= To: pve-devel@lists.proxmox.com Subject: [PATCH pve-kernel] cherry-pick fix for broken UDP offloading Date: Fri, 29 May 2026 11:11:03 +0200 Message-ID: <20260529091129.61252-1-f.gruenbichler@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1780045861228 X-SPAM-LEVEL: Spam detection results: 0 AWL -2.446 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment KAM_SOMETLD_ARE_BAD_TLD 5 .bar, .beauty, .buzz, .cam, .casa, .cfd, .club, .date, .guru, .link, .live, .monster, .online, .press, .pw, .quest, .rest, .sbs, .shop, .stream, .top, .trade, .wiki, .work, .xyz TLD abuse SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [msgid.link] Message-ID-Hash: AN37DKEIAPIUFUB752XRAT72ZFSYLWTW X-Message-ID-Hash: AN37DKEIAPIUFUB752XRAT72ZFSYLWTW X-MailFrom: f.gruenbichler@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: this affected - among other things - tailscale's userspace wireguard implementation: https://github.com/tailscale/tailscale/issues/19777 Signed-off-by: Fabian Grünbichler --- ...ndling-checksum-in-__udp_gso_segment.patch | 71 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 patches/kernel/0053-udp-gso-Fix-handling-checksum-in-__udp_gso_segment.patch diff --git a/patches/kernel/0053-udp-gso-Fix-handling-checksum-in-__udp_gso_segment.patch b/patches/kernel/0053-udp-gso-Fix-handling-checksum-in-__udp_gso_segment.patch new file mode 100644 index 0000000..c5ab651 --- /dev/null +++ b/patches/kernel/0053-udp-gso-Fix-handling-checksum-in-__udp_gso_segment.patch @@ -0,0 +1,72 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Alice Mikityanska +Date: Mon, 18 May 2026 09:22:49 +0300 +Subject: [PATCH] udp: gso: Fix handling checksum in __udp_gso_segment + +The cited commit started using msslen for uh->len, but still uses newlen +to adjust uh->check. Although the checksum is ignored in most cases due +to the hardware offload, __udp_gso_segment attempts to maintain the +correct one. Fix uh->check and adjust it by the right value. + +Additionally, after the fix, newlen becomes assigned and unused before +the loop. The code can be simplified a bit if mss adjustment is dropped, +so that newlen becomes equal to msslen before the loop, and msslen can +be also dropped, saving a few lines of code. + +This brings us back to one variable, drops an unneeded arithmetic for +mss, and fixes the UDP checksum. + +Fixes: b10b446ce7ad ("udp: gso: Use single MSS length in UDP header for GSO_PARTIAL") +Signed-off-by: Alice Mikityanska +Reviewed-by: Willem de Bruijn +Signed-off-by: Gal Pressman +Link: https://patch.msgid.link/20260518062250.3019914-2-gal@nvidia.com +Signed-off-by: Jakub Kicinski +(cherry picked from commit 5f17ae0f595aeb560155ce98edbe44d3eacc7e40) +Signed-off-by: Fabian Grünbichler +--- + net/ipv4/udp_offload.c | 13 ++----------- + 1 file changed, 2 insertions(+), 11 deletions(-) + +diff --git a/net/ipv4/udp_offload.c b/net/ipv4/udp_offload.c +index 6b1654c1ad4ac0b7c611c338d75632f1974f842b..e831234326c414a1004609656ef2207d087d3346 100644 +--- a/net/ipv4/udp_offload.c ++++ b/net/ipv4/udp_offload.c +@@ -483,11 +483,11 @@ struct sk_buff *__udp_gso_segment(struct sk_buff *gso_skb, + struct sock *sk = gso_skb->sk; + unsigned int sum_truesize = 0; + struct sk_buff *segs, *seg; +- __be16 newlen, msslen; + struct udphdr *uh; + unsigned int mss; + bool copy_dtor; + __sum16 check; ++ __be16 newlen; + int ret = 0; + + mss = skb_shinfo(gso_skb)->gso_size; +@@ -556,15 +556,6 @@ struct sk_buff *__udp_gso_segment(struct sk_buff *gso_skb, + return segs; + } + +- msslen = htons(sizeof(*uh) + mss); +- +- /* GSO partial and frag_list segmentation only requires splitting +- * the frame into an MSS multiple and possibly a remainder, both +- * cases return a GSO skb. So update the mss now. +- */ +- if (skb_is_gso(segs)) +- mss *= skb_shinfo(segs)->gso_segs; +- + seg = segs; + uh = udp_hdr(seg); + +@@ -587,7 +578,7 @@ struct sk_buff *__udp_gso_segment(struct sk_buff *gso_skb, + if (!seg->next) + break; + +- uh->len = msslen; ++ uh->len = newlen; + uh->check = check; + + if (seg->ip_summed == CHECKSUM_PARTIAL) -- 2.47.3