From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796384765; b=rgtX1oDxGt477yPa0zclBlGH2P7X44WqKbBgT6e4cEzgJb3ATk1aG5wZTg2uN/lTz37M SATaEziN9Sr0F073K63X/VY8gZbOMMvRNHoQwYDUoqwFHWwHBulvGRmklVUTBFElo4H7r srlnioz9FX1GvIwFmhcjVBRXRIR0ja1ZJg7mOzvnMR0BSa4AKAz0dZZycAxtqI6NeddaJ hgsGtNkalXs/yZp4Vw0AynMROV7HOz6wHeHXJzJRTmEuOHQi511CCGu68xjpxTo1XuJ1Y FP26fCpm1V+3z3tK0oc7hiR7L5G5iTbnsgZkG5H+WCnZ6eDauD2+9PizuCAqR7AW/Iw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796384765; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=WFHtjPutDQzaAzYv80aMDY/uH5sjvQpc8GtV2Azg/dw=; b=cfjP5wXuvSCecb7GSZCNvDa7ST4wjpt+29vyAPR1vj7coTgYl7rlWPlOY0NM4CoR8lSD eINb2onwbSgXDvv/RmXJz4IRGlnsFxXen9M9T9Sgdg7mMDxVkbtGAOJ0N3MmtTwH1YiAs jIXc+ZXKQM2RooB/GXFv+caU9fI8sTf7IiJzMdQfhgwQrfSYly+gwueo+jN0iUHh2D/HA 8+4krwdbusS/C7qjfdH5OzJgPWBy2IB7PJZqiK3nyu1MBjB5CXq2i/09vSAugU0HJME3w 3GzVkCxtyc+balHx5Q76dADFW2MxXPtCbQDaR16Zqqscu/j/rgiwaa4poPVdc9ol4dQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=R3B7gvz5; arc=none smtp.remote-ip=100.103.45.18 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 43D24606A339; Fri, 4 Dec 2026 11:46:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=R3B7gvz5 Received: by smtp.kernel.org (Postfix) with ESMTPSA id AE2031F00933; Fri, 4 Dec 2026 11:46:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796384765; bh=WFHtjPutDQzaAzYv80aMDY/uH5sjvQpc8GtV2Azg/dw=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=R3B7gvz5zLykpx/5khp8G9yOZfOH9C9mM3En6fBCUxaOWYKFpvXHwVtOfuFxzh42r kpEJ76B5MnH9l7vfwdNoEthDc/RBfsES2qFWhMzd/MwOjNCiN6BP+976KrQYA5qdLK oKUeBbsppaqFk6KjYS2EGJbGABgMaBW/kFTyHFY4= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Kyle Zeng , Eric Dumazet , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.6 0243/1167] fou: gue: check IP version of held packets for direct IP encapsulation Date: Fri, 4 Dec 2026 18:54:30 +0900 Message-ID: <20261204100708.399870104@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100702.047403948@linuxfoundation.org> References: <20261204100702.047403948@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@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 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Eric Dumazet [ Upstream commit c59f004734a2a7c0e427011db13aca524e781498 ] 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 Signed-off-by: Eric Dumazet Link: https://patch.msgid.link/20261106195615.2498766-1-edumazet@kernel.org Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- 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 78917f7261250..2899450bfb361 100644 --- a/net/ipv4/fou_core.c +++ b/net/ipv4/fou_core.c @@ -365,6 +365,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