Article View: linux.kernel.netdev
Article #12291[PATCH net] fou: gue: check IP version of held packets for direct IP encapsulation
From: Eric Dumazet
Date: Fri, 06 Nov 2026 19:56
Date: Fri, 06 Nov 2026 19:56
52 lines
9416 bytes
9416 bytes
For GUE version 0, gue_gro_receive() compares the base GUE header and
its optional fields with every held packet. For GUE version 1 (direct
IP encapsulation), it skips this comparison and selects the next GRO
handler only from the IP version of the incoming packet.
A held version 0 GUE packet from the same outer flow therefore stays
eligible. For example, a GUE/IPv4/UDP packet can be aggregated with a
direct IPv4/TCP packet, and inet_gro_receive() then parses the held
packet's GUE header as an IPv4 header.
Clear same_flow for held packets whose first nibble does not match the
incoming IP version. A valid version 0 GUE header always has a first
nibble between 0 and 3, so this also separates the two GUE formats.
The reverse case is already handled: the version 0 path compares the
whole base GUE header, including the version bits.
Fixes: c1e48af7960e ("gue: Implement direction IP encapsulation")
Reported-by: Kyle Zeng <kylebot@openai.com>
Signed-off-by: Eric Dumazet <edumazet@kernel.org>
---
This issue was discovered by an AI code review agent. It has not been
triggered, and the fix was only compile-tested.
net/ipv4/fou_core.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/net/ipv4/fou_core.c b/net/ipv4/fou_core.c
index 076fdca44f518016e71ba0b3b68c45b3c0858663..5c3c8f55d0570424203e2b664a7b806c51d86dbf 100644
--- a/net/ipv4/fou_core.c
+++ b/net/ipv4/fou_core.c
@@ -364,6 +364,18 @@ static struct sk_buff *gue_gro_receive(struct sock *sk,
default:
goto out;
}
+
+ /* Match the encapsulation format and IP version. */
+ list_for_each_entry(p, head, list) {
+ const struct iphdr *iph2;
+
+ if (!NAPI_GRO_CB(p)->same_flow)
+ continue;
+
+ iph2 = (const struct iphdr *)(p->data + off);
+ if (iph2->version != ((struct iphdr *)guehdr)->version)
+ NAPI_GRO_CB(p)->same_flow = 0;
+ }
goto next_proto;
default:
goto out;
--
2.53.0
Technical Details
Message-ID:
<20261106195615.2498766-1-edumazet@kernel.org>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-358143-linux-kernel-netdev=dewy.ruShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-358143-linux-kernel-netdev=dewy.ru From: edumazet@kernel.org (Eric Dumazet) Newsgroups: linux.kernel.netdev Subject: [PATCH net] fou: gue: check IP version of held packets for direct IP encapsulation Date: Fri, 6 Nov 2026 20:56:15 +0100 Organization: Usenet Network Message-ID: <20261106195615.2498766-1-edumazet@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="3962830"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:3mex6g1p43WD/i8IPqVf3gLvkm8= sha256:Uu8IN4IF1P91N9WJ3Ig0IX9Cvoj0vgJiAavlf22hCGs= sha1:vAe8fAIEJW1fLt0t/V5NXHiytH4= sha256:0Qggf2U0KneYIZVE8BVUDzf0+4qtO08FB2i8Irj810k= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 7807B113306; Fri, 6 Nov 2026 22:57:45 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.401 X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0EFS12xC9xZe; Fri, 6 Nov 2026 22:57:42 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-358143-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id B31271132FE; Fri, 6 Nov 2026 22:57:33 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 310F637A31; Fri, 6 Nov 2026 19:56:21 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1793994981; b=JwfHVz7m/s3kimlKyasdKqaVNxWcxG8woMinAAYwZKRTE6o9VsaMfGjwgOd16HqRoUNO 9eT6ijx/1QelQMZrAYGUItbj86re+UzBi5KFz/cFRkXABEvC3ZxqAOUG1Q0D8MJUDLLoK j1SW8923LifHcjktmFI3EDJF+LteQI3Pl1Rqw4ujWkCUL6ZgGP6Xk/s4zQDPv8Y8Q6wpV HobjLkYyw0KTm/rPtwFjE8juVnmrpgFyVf+Z1Joa8cScVpv9unLa+1KsPKUPdd2sIyzmX D2MJNRksO0UPeCy0yBpLBxAIvTAXojxypdUWGWUkgm5P0NCV+iFMI/0ikxldC6BVFYw== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793994981; h=X-Original-To:Received:Received:DKIM-Signature:From:To:Cc:Subject: Date:Message-ID:X-Mailer:X-Mailing-List:List-Id:List-Post:List-Help: List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version: Content-Transfer-Encoding; bh=cKC44C2FREKnmCaYP9Z7jZKScgRafwsnBCvLqvPRQTQ=; b=wt6BAua2a2LdBCSQIhHhSlE1KYX1y4nNvNYpMwvfyMgEBh3634rAfVEm+GMGspNUnPyR n5Z8mrznlsOrS6kDf6fSUPKifZHMxxo6GOXq+QiQJ0m6ykylNNV/aoAcDhS9hnqCph1J7 zn/GCgWwG921gKiHeaksWuF0Gf0o4GKFFgKxPqu9WyXlIIg+L8vYCbngoOTw21sq35lJ0 hvKEQZnAf6HiN1OQKV01s+/qU2yJmlfTrJLHthORwjRO/8APwaUebg8rwcvBQCpzt2wLZ gn1IpBrfLpfQqM8J9azO+YKBIaypHqO6NraWv+4Gl7GjemU3co/83Q5fMQDld6LzluA== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="L5cf5ON/"; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0881A606A330; Fri, 6 Nov 2026 19:56:21 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=L5cf5ON/ X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793994980; b=H2aa038RMAq4IFa0vXgAYl5+EJP3Wrt8QQftuQAT6iVUWMltbsimjyXm7a860fLMcMxF dl3og/CIBGq6H68Kr1ReCo57P3VLPmXZpmkZFB2/GloUBYidFk3jK8/Jrwz3938J5S42R EjEpleqpA71uPzbA3VWCFf+rVQxpfGh0BcjWkC9Dss7Db/Eq5QEAXH4ytKX3dxzbJcVLg sBLv+CNkp/H9SY2GhnQ7TWSYs4k1e4w62+UY3V+ZVK0xTB0lJZphvdt6H1frVHaclrRli zkweS+zFkihoAzH5VsckayLKERL6MKV3900MZzfRDf2xd0gRYGm3B4YYdEduJJH1GQw== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793994980; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: MIME-Version:Content-Transfer-Encoding; bh=cKC44C2FREKnmCaYP9Z7jZKScgRafwsnBCvLqvPRQTQ=; b=1Gl6XUkVjPGlcMazSeJo5jYWT6+AihnaSQz421wv3fTSHkMjvzRpWe6biLgNNdgW/JxH zsc46VwwkRLHFhFpcHgndiQWm0CCrdNkgfk1h+fcY1hdb+/5i4ZC9EtZ0qPdltLZ09eXM JsgTsjVPYzT4d06zY5NxW5wUTZ9DS8s61R1vUIxHvocZ13KHMEYJptKjsF+m1AXlVB7Vt GY95Dg0LWLTFTQegn4jae9MbTBWVFXZt5VsT697KvnXlkApM9uvE7wdm1/UqQ34lHVQfw nZmRKFLYOkTO/SSuLsrQgsn44vQgToMrjk9do4PNiq1MldvlI/+8xv7kbZCsCVP6axg== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="L5cf5ON/"; arc=none smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D9F50606A326 for <netdev@vger.kernel.org>; Fri, 6 Nov 2026 19:56:19 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 74D0A1F0089F; Fri, 6 Nov 2026 19:56:17 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1793994979; bh=cKC44C2FREKnmCaYP9Z7jZKScgRafwsnBCvLqvPRQTQ=; h=From:To:Cc:Subject:Date; b=L5cf5ON/L/AtairjU62knfXLMwOCOKoXNud6213wv3PMlY2KwgqPwXlbvkqScammN G+iQClPz5fHqc1SpL2VaSsN6HsQ2QxYc3cOfJCXLywpNe0S90NkUsjEeBuUoX9ZfEf 5WwZCfbDryNRxLbDrragtiBPaeVYkEeHqFMRwMnobwzEScajypbDfsow/rBnLBXRNk P+iHwTUKiglR/o6/tsSP9cvylQv5cln4gqFsdpfV9hUcU2rakFNMf8qGmBcHLOXoKi Ow+m98uQamL9t1QCjNyHr68/vsjI6GeffRK8vbVxkAgNUGQ+Oe4S/IxZE6/fjELLRr FoS71us8YOu6Q== X-Cc: Kuniyuki Iwashima <kuniyu@google.com>, Willem de Bruijn <willemb@google.com>, Simon Horman <horms@kernel.org>, netdev@vger.kernel.org, Eric Dumazet <edumazet@kernel.org>, Kyle Zeng <kylebot@openai.com> X-Mailer: git-send-email 2.53.0 X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list