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=1796228145; b=z4MGJPbObCDW3AqgTJC88jofbREKDA/fYSMwniRunV20qaKYlE2Y/eYmWqDjcdrmcIwW PHIAZ5JzdrPskUQ5Y2DlgdDrsST3NolJgF7TDLgOqug2+JNi11SIJFq9cLLATpc6vBni+ R47nDksVcjLpflWWS/NJynA0mw2LMP2TLI1x12m6DxHLr1NwYaLqioSZH10lGF/gdCY2U rCvFiM4sv5ntSlfEfAWoz2qgIhEQk4zLudBnwBOu3kvnGLRg5YGR1vjiurWiUMWr36L3Z ry4TJciYP8DWnvt+pY7EXw3QKU96x0JfGE1BZuQo3UwgviHXteYDrAmN2dxYn0HYODA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796228145; h=Received:DKIM-Signature:Subject:To:Cc:From:Date:Message-ID: MIME-Version:Content-Type:Content-Transfer-Encoding; bh=xJrHEvCwX0p1lLPg/lKwRj24Ne1XJKSVuEZvFDApR/4=; b=cg7BPN31DNaA7eaYs7U3xg3oCaANDDIILGaFaEceJmXkvDmLZucQcYmieggMxHMnEbSu h3f7nY9qytvmuAtimtyH97cKqEnNYsZ/4rZ6iRs+JKBbxR6wZ+k5u3R8FTvK2UgCzmOKX MN9S/2YBiVTG2Zke67wprV4OEyYBpb7q/7H41BI7+mokQBg9CYSeB97BNbbSvNNCXD9aT IvRo5xGWPlhKJmrqmhKYSkC74qWAHVzvfrwuyKMjev3mvqaX+OB+VnL/gGTdz7QDZT5oA yrnRluVoSD9iOGSsWZOu/FDBHz15sOHDRIv5wmDHKDmzxnSAfabI5Ao0dlaFEXevljA== 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=PQu8Gzf2; 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 AB4C0606A31A for ; Wed, 2 Dec 2026 16:15:45 +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=PQu8Gzf2 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 40B381F0092A; Wed, 2 Dec 2026 16:15:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796228144; bh=xJrHEvCwX0p1lLPg/lKwRj24Ne1XJKSVuEZvFDApR/4=; h=Subject:To:Cc:From:Date; b=PQu8Gzf2iilAcIxMNB6duzc4Vp7SkIsuLOc4pTItpC/lRE3FKBlol37XkOOuz68O/ o2VeJrAOP2uyVkr535TVr/+jeiILkCA2FHm3phwYnE3bv/nmM60bMMqEC47ADc18c1 J7GkKuMhWmW+zNL7hBEN9DlMs8NaB51BIyLF4XbA= Subject: FAILED: patch "[PATCH] ipv6: mcast: use skb_set_transport_header_careful() in" failed to apply to 6.1-stable tree To: edumazet@kernel.org,idosch@nvidia.com,justin.iurman@gmail.com,pabeni@redhat.com Cc: From: Date: Wed, 02 Dec 2026 16:10:23 +0100 Message-ID: <2026120223-thud-skimpily-4afd@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.1-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.1.y git checkout FETCH_HEAD git cherry-pick -x 425b1fe50b71628299d33faff28057e7fa4c60c7 # git commit -s git send-email --to '' --in-reply-to '2026120223-thud-skimpily-4afd@gregkh' --subject-prefix 'PATCH 6.1.y' 'HEAD^..' Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 425b1fe50b71628299d33faff28057e7fa4c60c7 Mon Sep 17 00:00:00 2001 From: Eric Dumazet Date: Fri, 13 Nov 2026 13:46:22 +0100 Subject: [PATCH] ipv6: mcast: use skb_set_transport_header_careful() in ipv6_mc_check_exthdrs() skb->transport_header is a 16-bit offset from skb->head, and U16_MAX is reserved as the "not set" value. skb_set_transport_header() silently truncates an offset that does not fit. ipv6_mc_check_exthdrs() stores the offset returned by ipv6_skip_exthdr(), which depends on the extension headers found in the packet. Should the value be truncated, ipv6_mc_check_icmpv6() and ipv6_mc_check_mld_msg() would then validate and parse the MLD message at the wrong place. Since commit 3744b0964d52 ("ipv6: Implement limits on extension header parsing") a single chain is bounded to IP6_MAX_EXT_HDRS_CNT headers (24576 bytes), so this needs a large skb->data - skb->head on top of it, for instance after several nested decapsulations, each of them possibly pulling its own extension header chain. No reproducer was written, this is hardening. Use skb_set_transport_header_careful() and treat such a packet as broken (-EINVAL). Fixes: 9afd85c9e455 ("net: Export IGMP/MLD message validation code") Cc: stable@vger.kernel.org Signed-off-by: Eric Dumazet Reviewed-by: Ido Schimmel Link: https://patch.msgid.link/20261113124625.4010206-3-edumazet@kernel.org Reviewed-by: Justin Iurman Signed-off-by: Paolo Abeni diff --git a/net/ipv6/mcast_snoop.c b/net/ipv6/mcast_snoop.c index 04d5fcdfa6e0..7abf79815aa2 100644 --- a/net/ipv6/mcast_snoop.c +++ b/net/ipv6/mcast_snoop.c @@ -56,7 +56,8 @@ static int ipv6_mc_check_exthdrs(struct sk_buff *skb) if (nexthdr != IPPROTO_ICMPV6) return -ENOMSG; - skb_set_transport_header(skb, offset); + if (!skb_set_transport_header_careful(skb, offset)) + return -EINVAL; return 0; }