From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fhigh-b7-smtp.messagingengine.com (fhigh-b7-smtp.messagingengine.com [202.12.124.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F0F6344A739 for ; Thu, 26 Feb 2026 20:16:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.158 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772137020; cv=none; b=cmikxH/zg4CxxwrSgpXqn22oRQ0jlaE6lIrA0oO4yfeMEAkz4x3ycKUFdpioZ3J3XLvKYBlzSnzeUun0YDzr89kTAIzd2T+6xI+VLYYwWVngzNVf6xn0BrgYlHCSdHF1cp5tz25L2w2vzXwkBaUq3FXDoCkRHqKOLtYyQaKkrZ4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772137020; c=relaxed/simple; bh=U8IRZYRyFOIsErSX8tuqE9E6V/KWIlqLuhX8Ne9Tqog=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jzgoJyu5FY939zmlr86yNAV/AbIXLS6PgWPTKu7Np/s5646WPeShHJmEHNM3fDUjldZQj50WJAHO1CwaQQZczc9IAEnoCZXax9gd2kImAEXUH7VPazDeT5WmKuw4xPQ7s7nFrkH4u17ljuYH3YiEKG6At7D3hgrtbSvYobQa0yc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=fastmail.im; spf=pass smtp.mailfrom=fastmail.im; dkim=pass (2048-bit key) header.d=fastmail.im header.i=@fastmail.im header.b=JmCVLZPl; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=sQdss3s+; arc=none smtp.client-ip=202.12.124.158 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=fastmail.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fastmail.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fastmail.im header.i=@fastmail.im header.b="JmCVLZPl"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="sQdss3s+" Received: from phl-compute-11.internal (phl-compute-11.internal [10.202.2.51]) by mailfhigh.stl.internal (Postfix) with ESMTP id 001867A019E; Thu, 26 Feb 2026 15:16:57 -0500 (EST) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-11.internal (MEProxy); Thu, 26 Feb 2026 15:16:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.im; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm3; t=1772137017; x= 1772223417; bh=ITvoeK0erDKFOAGW64Mad0+sofs8RTwkyYSlolaxdZk=; b=J mCVLZPl2DuZcvYHhz0urmnUnLANhjSfcVABqKLI4Aa8mL2kKJlQOoMfKBsfHd5J4 KfoGegrC1KQ8Xj3UQFLOTU63IFLvj/mQBU22qbqKnaeoWnDUbNc8Hkdf0duJtvu6 GqPCMhMD2HbNywlhbM9+yafKXiI89YKIOddP1O6E70YIvw+aBrYvfwn9rhBOh4O1 BeSti00Fg0va92Swzs0obczNgRsgDKl434cYjTmvv/N9NY7rE6T9QZncSc3o/w94 zNKA+OWMSgGNoVqBn2/sEeEFUCNRTr5B9L309LvWM52pEiDHHxWoAHfdqP6rHhhJ K2kesnEp/Lz1UBBZUuLog== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1772137017; x=1772223417; bh=I TvoeK0erDKFOAGW64Mad0+sofs8RTwkyYSlolaxdZk=; b=sQdss3s+OrWTdOGt1 9WV1dl4fVFkLHOLh8vnArZhh1ybZ2KUxij9F+AHQ+5wp01V7mZm97rM+DkL7LVHj 82kPeb08db8+TF0380aTIvkYDId2x6wNvl2dT69wfeDLfG6zPH6V0KLnsU/PhCap qOKVrRwk6vbi6VPzZYBhpW0q/Ek1hUJKMLO66O1ws3rKLc7Widn9Tvr+n/HPRAH8 nXxx+6j8yTFsYDpENnnlGqlwhhnL49QlSlwonLWfh4k43UbQl+IeLJUTKhLINk5P zN19EdP7XPzaZsvo+YgTGJEvnAH4Kiqxz9PcXafTkdlD29HCeZbCMJdXwqnHWh/A d1vrQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddvgeejtddvucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomheptehlihgtvgcu ofhikhhithihrghnshhkrgcuoegrlhhitggvrdhkvghrnhgvlhesfhgrshhtmhgrihhlrd himheqnecuggftrfgrthhtvghrnhepteffleejfedvhfehieejlefgkeeljeevueeggeev tefhgfeuhfduffegkedvtddtnecuvehluhhsthgvrhfuihiivgepudenucfrrghrrghmpe hmrghilhhfrhhomheprghlihgtvgdrkhgvrhhnvghlsehfrghsthhmrghilhdrihhmpdhn sggprhgtphhtthhopeduiedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepuggrnh hivghlsehiohhgvggrrhgsohigrdhnvghtpdhrtghpthhtohepuggrvhgvmhesuggrvhgv mhhlohhfthdrnhgvthdprhgtphhtthhopegvughumhgriigvthesghhoohhglhgvrdgtoh hmpdhrtghpthhtohepkhhusggrsehkvghrnhgvlhdrohhrghdprhgtphhtthhopehprggs vghnihesrhgvughhrghtrdgtohhmpdhrtghpthhtoheplhhutghivghnrdigihhnsehgmh grihhlrdgtohhmpdhrtghpthhtohepfihilhhlvghmuggvsghruhhijhhnrdhkvghrnhgv lhesghhmrghilhdrtghomhdprhgtphhtthhopegushgrhhgvrhhnsehkvghrnhgvlhdroh hrghdprhgtphhtthhopehrrgiiohhrsegslhgrtghkfigrlhhlrdhorhhg X-ME-Proxy: Feedback-ID: i559e4809:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 26 Feb 2026 15:16:57 -0500 (EST) From: Alice Mikityanska To: Daniel Borkmann , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Xin Long , Willem de Bruijn , David Ahern , Nikolay Aleksandrov Cc: Shuah Khan , Stanislav Fomichev , Andrew Lunn , Simon Horman , Florian Westphal , netdev@vger.kernel.org, Alice Mikityanska Subject: [PATCH net-next v2 07/12] udp: Support BIG TCP GSO packets where they can occur Date: Thu, 26 Feb 2026 22:15:55 +0200 Message-ID: <20260226201600.222044-8-alice.kernel@fastmail.im> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260226201600.222044-1-alice.kernel@fastmail.im> References: <20260226201600.222044-1-alice.kernel@fastmail.im> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Alice Mikityanska Wherever a GSO packet can occur, and its length is used to fill the UDP header, use udp_set_len that assigns 0 if the length doesn't fit 16 bits, so that the packet can be properly parsed and segmented later, instead of having truncated length. Signed-off-by: Alice Mikityanska --- net/ipv4/fou_core.c | 2 +- net/ipv6/fou6.c | 2 +- net/netfilter/ipvs/ip_vs_xmit.c | 2 +- net/netfilter/nf_conntrack_proto_udp.c | 4 +++- net/netfilter/nf_nat_helper.c | 2 +- net/psp/psp_main.c | 2 +- 6 files changed, 8 insertions(+), 6 deletions(-) diff --git a/net/ipv4/fou_core.c b/net/ipv4/fou_core.c index 7aeb6efbfc44..d934860e1f34 100644 --- a/net/ipv4/fou_core.c +++ b/net/ipv4/fou_core.c @@ -1043,7 +1043,7 @@ static void fou_build_udp(struct sk_buff *skb, struct ip_tunnel_encap *e, uh->dest = e->dport; uh->source = sport; - udp_set_len_short(uh, skb->len); + udp_set_len(uh, skb->len); udp_set_csum(!(e->flags & TUNNEL_ENCAP_FLAG_CSUM), skb, fl4->saddr, fl4->daddr, skb->len); diff --git a/net/ipv6/fou6.c b/net/ipv6/fou6.c index abcf23500299..3c79fe8aba1b 100644 --- a/net/ipv6/fou6.c +++ b/net/ipv6/fou6.c @@ -30,7 +30,7 @@ static void fou6_build_udp(struct sk_buff *skb, struct ip_tunnel_encap *e, uh->dest = e->dport; uh->source = sport; - udp_set_len_short(uh, skb->len); + udp_set_len(uh, skb->len); udp6_set_csum(!(e->flags & TUNNEL_ENCAP_FLAG_CSUM6), skb, &fl6->saddr, &fl6->daddr, skb->len); diff --git a/net/netfilter/ipvs/ip_vs_xmit.c b/net/netfilter/ipvs/ip_vs_xmit.c index b460998e348e..08b0b5bfe4ec 100644 --- a/net/netfilter/ipvs/ip_vs_xmit.c +++ b/net/netfilter/ipvs/ip_vs_xmit.c @@ -1089,7 +1089,7 @@ ipvs_gue_encap(struct net *net, struct sk_buff *skb, dport = cp->dest->tun_port; udph->dest = dport; udph->source = sport; - udp_set_len_short(udph, skb->len); + udp_set_len(udph, skb->len); udph->check = 0; *next_protocol = IPPROTO_UDP; diff --git a/net/netfilter/nf_conntrack_proto_udp.c b/net/netfilter/nf_conntrack_proto_udp.c index e9bd1632304f..ca7d259ded8b 100644 --- a/net/netfilter/nf_conntrack_proto_udp.c +++ b/net/netfilter/nf_conntrack_proto_udp.c @@ -45,9 +45,11 @@ static bool udp_validate_len(struct sk_buff *skb, const struct udphdr *hdr, unsigned int dataoff) { - unsigned int udplen = udp_get_len_short(hdr); + unsigned int udplen = ntohs(hdr->len); unsigned int skblen = skb->len - dataoff; + if (!udplen && skblen >= GRO_LEGACY_MAX_SIZE) + return true; if (udplen > skblen || udplen < sizeof(*hdr)) return false; return true; diff --git a/net/netfilter/nf_nat_helper.c b/net/netfilter/nf_nat_helper.c index 3853f41db499..ec34a2f4baa8 100644 --- a/net/netfilter/nf_nat_helper.c +++ b/net/netfilter/nf_nat_helper.c @@ -161,7 +161,7 @@ nf_nat_mangle_udp_packet(struct sk_buff *skb, /* update the length of the UDP packet */ datalen = skb->len - protoff; - udp_set_len_short(udph, datalen); + udp_set_len(udph, datalen); /* fix udp checksum if udp checksum was previously calculated */ if (!udph->check && skb->ip_summed != CHECKSUM_PARTIAL) diff --git a/net/psp/psp_main.c b/net/psp/psp_main.c index 2415b75a2a12..c9c60cb69daa 100644 --- a/net/psp/psp_main.c +++ b/net/psp/psp_main.c @@ -207,7 +207,7 @@ static void psp_write_headers(struct net *net, struct sk_buff *skb, __be32 spi, uh->source = udp_flow_src_port(net, skb, 0, 0, false); } uh->check = 0; - udp_set_len_short(uh, udp_len); + udp_set_len(uh, udp_len); psph->nexthdr = IPPROTO_TCP; psph->hdrlen = PSP_HDRLEN_NOOPT; -- 2.52.0