Received: from fhigh-a8-smtp.messagingengine.com (fhigh-a8-smtp.messagingengine.com [103.168.172.159]) (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 851DC38333B for ; Thu, 11 Jun 2026 17:58:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.159 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781200686; cv=none; b=RbfFn0+1RQ8lTRWysLIKYtTlURVgXHYlGb1qj5+gY0WrRK4YTQNQ5LYZRThsKXpUKx7StVi38Re36qi3DuocFjG9uva9Hsga8C0eOtq6dBwKWKZ25glJpjEZNGc2oHWXyGk0yEub3dULJ7WDJajHDUI91rmeHllN+CBK76yY+8w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781200686; c=relaxed/simple; bh=Kh6ENXEvSpBtA+7GRc3J7wZRb6ZBVzAyNJcJz4GWyKE=; h=MIME-Version:Date:From:To:Cc:Message-Id:In-Reply-To:References: Subject:Content-Type; b=MQXczDQyUQ4nMwpkzaePPCvqbr/tTUeX3utoz0AaW1aMks+A3Mr2hYocKb0Ybb08ujS/oNBLSYfMZdN78AI0PEsh9zWkRMSlSoWKjpXoB+PLA7E2oEUhJ8lHL2HJkGCaAPOP8r+LNeqJC7YeI1N56lURBRuY+Y13DSpu3JQcYlk= 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=PEqluxwn; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=ERVxEAew; arc=none smtp.client-ip=103.168.172.159 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="PEqluxwn"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="ERVxEAew" Received: from phl-compute-10.internal (phl-compute-10.internal [10.202.2.50]) by mailfhigh.phl.internal (Postfix) with ESMTP id 949D01400111; Thu, 11 Jun 2026 13:58:03 -0400 (EDT) Received: from phl-imap-03 ([10.202.2.93]) by phl-compute-10.internal (MEProxy); Thu, 11 Jun 2026 13:58:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.im; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1781200683; x=1781287083; bh=PSI6vrXa62DLOtjxNMaKyTJ6p/iETJFSHoAb3s7WiEY=; b= PEqluxwn7x/wskvuTelASVFBOYSa7YjeG87NrB2cTkQ0NcmWS6yu7xXImKsgsLYG KMxlXtbrxlp9lOQD8ytzwqTRLsHNF472TQJ2BBNAYPWRqylJfw/OthD8C/HM5A5i K+V3w04qNGY+PA8OQG57eO1kIgmYS1Sm4q9yZ4fikLiosxQZhCL+RMG+ubqRuKx7 2HfKv8oQG/9HqNKpi+4P8TTp2rcZEce+uAXNY/4SbL8p9GJSf/LXMSQUUZlIW1vr 06PXP/4JK1ltQX793qft8MqrQrll/sXWd5Wpu0ySoyqJ9Q8oK62JG7qj1P6A9WA0 blBwp47SaLU04VWnJ/NSZw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type: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=fm1; t=1781200683; x= 1781287083; bh=PSI6vrXa62DLOtj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MW20DiwkoFPaadszKY9F5A X-ME-Proxy: Feedback-ID: i559e4809:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id A320A18E006C; Thu, 11 Jun 2026 13:58:02 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Date: Thu, 11 Jun 2026 19:57:41 +0200 From: "Alice Mikityanska" To: "Paolo Abeni" , "Daniel Borkmann" , "David S. Miller" , "Eric Dumazet" , "Jakub Kicinski" , "Xin Long" , "Willem de Bruijn" , "Willem de Bruijn" , "David Ahern" , "Nikolay Aleksandrov" Cc: "Shuah Khan" , "Stanislav Fomichev" , "Andrew Lunn" , "Simon Horman" , "Florian Westphal" , netdev@vger.kernel.org, "Alice Mikityanska" Message-Id: <60756eb2-8f4c-48cf-adb2-79228de6266e@app.fastmail.com> In-Reply-To: <859702b5-0528-416f-9325-c13757d8463f@redhat.com> References: <20260602093931.516281-1-alice.kernel@fastmail.im> <20260602093931.516281-6-alice.kernel@fastmail.im> <6bdf5092-d877-4c09-b3a2-07a92b57fd54@app.fastmail.com> <859702b5-0528-416f-9325-c13757d8463f@redhat.com> Subject: Re: [PATCH net-next v6 05/11] udp: Support gro_ipv4_max_size > 65536 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Wed, Jun 10, 2026, at 11:31, Paolo Abeni wrote: > On 6/9/26 7:41 PM, Alice Mikityanska wrote: >> On Tue, Jun 9, 2026, at 10:32, Paolo Abeni wrote: >>> Hi, >>> >>> On 6/2/26 11:39 AM, Alice Mikityanska wrote: >>>> @@ -2605,6 +2605,9 @@ int udp_rcv(struct sk_buff *skb) >>>> if (ulen > skb->len) >>>> goto short_packet; >>>> =20 >>>> + if (!ulen) >>>> + ulen =3D skb->len; >>> >>> Sashiko noted the above is a bit fragile, as malformed udp skb will >>> unconditionally use the skb len. >>=20 >> Malformed packets are addressed in patch 7 =E2=80=94 it closes the ga= p, so that >> uh->len =3D 0 can't come from the wire. >>=20 >>> What about introducing/using an additional helper alike: >>> >>> int udp_get_len(const struct sk_buff *skb, const struct udphdr *uh) >>> { >>> if (uh->len) >>> return htons(uh->len); >>> if (skb_is_gso(skb)) >>> return skb->len; >>> return 0; >>> } >>> >>> and use it here and in the next patch? >>=20 >> Since UDP-Lite was removed along with the special case in udp_rcv, the >> helper for udp_get_len makes sense now, yes. The only two places where >> it's going to be used, though, are udp_rcv and udpv6_rcv. AFAIR, only >> these two need to read and decode len=3D0. > > I think also udp_validate_len() in nf_conntrack_proto_udp.c could/shou= ld > use the same helper.=20 Possible; but I'll have to pass dataoff to the helper, because the SKB in udp_validate_len doesn't have skb->data pointing at the UDP header. I'll do that. >> I'm not sure about the skb_is_gso check, though. Given that malformed >> packets are addressed in patch 7, do we need this check? udpv6_rcv >> already does the following without checking for GSO: >>=20 >> /* Check for jumbo payload */ >> if (ulen =3D=3D 0) >> ulen =3D skb->len; > > AFAICS, checking in udp_gro_receive() is not enough to protect the who= le=20 > RX path: some NICs still do use NAPI, some other explicitly skips NAPI=20 > when aggregation is not possible. Also malformed 0 len packets are not > dropped at the GRO engine level, and with eventually reach udp{,v6}_rc= v(). That's a valid point; devices that use netif_receive_skb will skip the checks in udp_gro_receive. Moreover, these checks don't block the packet, they just flush GRO. > I think the GSO check is the more robust among the easily > available ones, and should not impact performances - it touches 2 > additional cachelines compared to the current code, but both should be > already hot in all the relevant callers. > >> I don't think Linux supports jumbo UDP with HBH coming from the wire >> natively, does it? If it doesn't, and the above is only for BIG TCP, = it >> should be safe to check skb_is_gso in udpv6_rcv too, but again, is it >> actually necessary after patch 7? > > WRT the need for such check, see the previous point.=20 > > I forgot about jumbograms. The current ipv6 udp RX path currently=20 > handle them, Indeed; I tested with a TUN device (with NAPI), and receiving a jumbogram via socket worked (sending, I believe, is blocked by the check in the beginning of udp_sendmsg). BTW, are there any selftests for IPv6 jumbograms? > I think we must preserve such handling. Possibly something=20 > alike the following? > > --- > diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c > index 15e032194ecc..d4d1d85dd7cb 100644 > --- a/net/ipv6/udp.c > +++ b/net/ipv6/udp.c > @@ -1085,8 +1085,9 @@ INDIRECT_CALLABLE_SCOPE int udpv6_rcv(struct sk_= buff *skb) > if (ulen > skb->len) > goto short_packet; >=20 > - /* Check for jumbo payload */ > - if (ulen =3D=3D 0) > + /* Check for Big TCP over UDP tunnel and jumbo payload. */ > + ulen =3D udp_get_len(skb, uh); > + if (ulen =3D=3D 0 && inet6_is_jumbogram(skb)) > ulen =3D skb->len; Looks good, thanks for the suggestion! udp_get_len will cover BIG TCP, and the new check will cover jumbograms, restricting ulen=3D0 to these t= wo cases only. Thanks for the review, I'll resubmit with these changes. >=20 > if (ulen < sizeof(*uh)) > --- > > The above will make the check in the RX path more restrictive, but it = will > be also aligned with the existing one in recvmsg(). > > /P