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=1796228133; b=tnzN9nNyvDcComcCuDep/x0icVAT/psTZFqy9cH7wUnm2OJoo/SUWlAhE6PsbU3ifxyd mM0uWLdPP58UtkFejIFjM2N8JcDUMV+3hex0zKYCvq6Gz+AjtArtGs4P+fmR7vGmAr5Bl gqdWAn/s5VaPx67Lec97EtnlhkTDUk8yzgAMGSLuLPhkKZQjCrmMAfdX3wpjs0fgMMvaT 3dL/WwUT6fgbsSIDGvPlAcL3CIupDm9HqrnAiaMYVek7zTuMhFbYrP4rcFJt+lZXIZ0kv a1lW6eTYDkqoHeDzt4kOOedVIF7+vJRJ17NWWeaG5+MLo5RJCFZcLLy9SXFTO2FsMzA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796228133; h=Received:DKIM-Signature:Subject:To:Cc:From:Date:Message-ID: MIME-Version:Content-Type:Content-Transfer-Encoding; bh=gZjAoToBRIVokHd/V/Xv7rGGuTFvL0okMEl5J5HjXwo=; b=Hdzc4UGMzxzbquNnSvohltvoOG+DngDGZkUwo5++PT9osTsTj6fyraxVj+TQl9XOVhVs k6rvxHl+iWr6tB/pBeXzCk/ugDtrfaVZWolSRtTQkcCG/jphfWbu+XPj7kELEukjH4C6I fQ99WJmzlP8c0dL4fIVfP4IQ00bNyv4/W5M4XoyxqqRxKTLUKWNKUy7WN1YMjCrXr5bd4 oRt4bhg6ZchkSFFUnnKWmJ7WnRM/pEnJmf91otXwIfneEMWGzfW7oE+D7ZyS7VIAzq7pJ Rz8++zlDJpY3xG5f3FgDUq0BzP5OXyEjQppGDZAVpgsbQCly4O8PRGYlHx+pCblhM9Q== 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=alJa9AYi; 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 8A0E7606A31A for ; Wed, 2 Dec 2026 16:15:33 +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=alJa9AYi Received: by smtp.kernel.org (Postfix) with ESMTPSA id 53EA41F00923; Wed, 2 Dec 2026 16:15:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796228132; bh=gZjAoToBRIVokHd/V/Xv7rGGuTFvL0okMEl5J5HjXwo=; h=Subject:To:Cc:From:Date; b=alJa9AYikYWy4ctRnkHngnJTVLdiMqbrnq3gTUAEnUx3+SSQz5q6rp1cebzFEL/QH cRuqiFJ21bNznDM83jciB3xqLhccJtv8xwhAP5oVuRqQD9i7khzNd5cHgmxRWxh32d rY0K6E/vwrAYUz8268dHvblOvFqAmMNbqbEriKVw= Subject: FAILED: patch "[PATCH] ipv6: gro: limit the number of extension headers" failed to apply to 6.12-stable tree To: edumazet@kernel.org,aconole@redhat.com,daniel@iogearbox.net,dsahern@kernel.org,idosch@nvidia.com,imv4bel@gmail.com,justin.iurman@gmail.com,pabeni@redhat.com Cc: From: Date: Wed, 02 Dec 2026 16:07:32 +0100 Message-ID: <2026120232-ozone-exemplary-0302@gregkh> 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-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 6.12-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.12.y git checkout FETCH_HEAD git cherry-pick -x 050f2adb60434a2b4dee2cf3350269379a32cf72 # git commit -s git send-email --to '' --in-reply-to '2026120232-ozone-exemplary-0302@gregkh' --subject-prefix 'PATCH 6.12.y' 'HEAD^..' Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 050f2adb60434a2b4dee2cf3350269379a32cf72 Mon Sep 17 00:00:00 2001 From: Eric Dumazet Date: Fri, 13 Nov 2026 13:46:21 +0100 Subject: [PATCH] ipv6: gro: limit the number of extension headers Hyunwoo Kim reported that a long chain of IPv6 extension headers can push the transport header offset of a GRO packet beyond what the 16-bit skb->transport_header can store. The truncated offset is later used by gro_receive_network_flush() to locate the network header of a packet held in the GRO list, leading to an out-of-bounds read. Since commit 3744b0964d52 ("ipv6: Implement limits on extension header parsing"), ip6_protocol_deliver_rcu() drops packets carrying more than IP6_MAX_EXT_HDRS_CNT extension headers, but ipv6_gro_pull_exthdrs() was left unbounded. There is no point trying to aggregate packets that the stack is going to drop anyway if they are locally delivered. Apply the same limit in ipv6_gro_pull_exthdrs(). When the limit is hit, @proto still designates an extension header. Extension header offloads have no gro_receive() callback, so ipv6_gro_receive() takes its existing "goto out" path with flush set, and the packet is given to the normal receive path. Local delivery drops it with SKB_DROP_REASON_IPV6_TOO_MANY_EXTHDRS, while forwarded packets are simply not aggregated. An extension header being at most 2048 bytes, this bounds a chain to 24576 bytes. Note that offsets can still accumulate over nested encapsulations, so the places storing them should be hardened separately. Fixes: 4b0ebbca3e16 ("net: gro: move L3 flush checks to tcp_gro_receive and udp_gro_receive_segment") Cc: stable@vger.kernel.org Reported-by: Hyunwoo Kim Link: https://lore.kernel.org/netdev/avTTQNyvwPP6LtGx@v4bel/ Signed-off-by: Eric Dumazet Cc: Daniel Borkmann Cc: David Ahern Cc: Ido Schimmel Tested-by: Hyunwoo Kim Reviewed-by: Ido Schimmel Reviewed-by: Aaron Conole Link: https://patch.msgid.link/20261113124625.4010206-2-edumazet@kernel.org Reviewed-by: Justin Iurman Signed-off-by: Paolo Abeni diff --git a/net/ipv6/ip6_offload.c b/net/ipv6/ip6_offload.c index 700f1861d8eb..01642900c0fa 100644 --- a/net/ipv6/ip6_offload.c +++ b/net/ipv6/ip6_offload.c @@ -26,6 +26,7 @@ static int ipv6_gro_pull_exthdrs(struct sk_buff *skb, int off, int proto) { const struct net_offload *ops = NULL; struct ipv6_opt_hdr *opth; + int exthdr_cnt = 0; for (;;) { int len; @@ -38,6 +39,13 @@ static int ipv6_gro_pull_exthdrs(struct sk_buff *skb, int off, int proto) if (!(ops->flags & INET6_PROTO_GSO_EXTHDR)) break; + /* Same limit as ip6_protocol_deliver_rcu(). + * @proto is left pointing to an extension header, + * so that the caller does not aggregate this packet. + */ + if (unlikely(exthdr_cnt++ >= IP6_MAX_EXT_HDRS_CNT)) + break; + opth = skb_gro_header(skb, off + sizeof(*opth), off); if (unlikely(!opth)) break;