Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 4E59941F5CD; Mon, 17 Aug 2026 15:28:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786980511; cv=none; b=Elm16Yb94B1VKNAdFjr+5YYiy8KzayLzj7tfbrJ7tcERXQLi/oL9lfiMZdPYIp1eoX1WMYnkmCrvK5zxMMHTplm1B3Ejnd4LAmQOIA9qeqoJIS2tQ7bcUZ/OQxhxpK9Hucm8ovrcbtc4tJ7OxGYB5LIpJKM7fxrP1nmrZgQsHhw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786980511; c=relaxed/simple; bh=9QkETuLNOm+VXwggJjV05ZLMU9UNfoJy98KOmLxUED8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rhRCtxUvG6IUhjo94nEffBDXRbgjAnKMlSEGYGnk5NKteMK8MOoE9HiuB8r115oWNkWAS5xnVx1v9JRJKFSzdKLYDGHa9E5X1Spt6hixpZPdSbS0jCpxVgb5UErT7fC/HI4f1u4nsY4dh+c1LD/HMEf1STiZHC9Aq8u4mD8JDOk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=TepfKYa/; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="TepfKYa/" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A85AE1F000E9; Mon, 17 Aug 2026 15:28:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1786980510; bh=kSlmc97NVyr0o8780laCOfCQw14nXQEXEKoax+BRKeQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=TepfKYa/efOMtN+IfTM8locC8HUn+kmVqQDa99rkDeXwdSyvHFXNgTV9rxjOsplWM yiBBzxjgCknJjMNL2rnGVRyzZ/Lw8miQej0HNJq/80fqIe8lnpggIsXIbe96Y8Rzv/ DoOH81y03C+E+WH4Ixh6xGcSyk4AAhYi39Udfs2s= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Vega , Zhiling Zou , Ido Schimmel , Jakub Kicinski Subject: [PATCH 6.1 598/609] ip6_tunnel: clear skb2->cb[] in ip6ip6_err() Date: Mon, 17 Aug 2026 15:34:54 +0200 Message-ID: <20260817132603.650354581@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260817132543.039278408@linuxfoundation.org> References: <20260817132543.039278408@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Zhiling Zou commit f803c086399da277b5d0ff36a107d0f162751800 upstream. ip6ip6_err() clones an outer IPv6 ICMP error skb, pulls it to the quoted inner IPv6 packet, and then passes the clone to icmpv6_send(). The clone still carries the outer packet's inet6_skb_parm in skb->cb. If the outer packet had a Home Address Option, IP6CB(skb2)->dsthao remains non-zero after skb_pull(). icmpv6_send() later calls mip6_addr_swap(), which uses that stale dsthao offset against the quoted inner packet. A malformed inner destination-options header can then make the HAO lookup and address swap run past the end of the quoted packet and corrupt skb_shared_info. Clear skb2->cb[] before pulling the quoted inner IPv6 packet so the reply path does not reuse metadata left by the outer IPv6 stack. Fixes: e490d1d85cf5 ("[IPV6] IP6TUNNEL: Split out generic routine in ip6ip6_err().") Cc: stable@vger.kernel.org Reported-by: Vega Signed-off-by: Zhiling Zou Reviewed-by: Ido Schimmel Link: https://patch.msgid.link/fe1a5e765fbca88d69391887f0ed26a19e3e4d39.1785736562.git.zhilinz@nebusec.ai Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- net/ipv6/ip6_tunnel.c | 3 +++ 1 file changed, 3 insertions(+) --- a/net/ipv6/ip6_tunnel.c +++ b/net/ipv6/ip6_tunnel.c @@ -675,6 +675,9 @@ ip6ip6_err(struct sk_buff *skb, struct i if (!skb2) return 0; + /* Remove debris left by outer IPv6 stack. */ + memset(IP6CB(skb2), 0, sizeof(*IP6CB(skb2))); + skb_dst_drop(skb2); skb_pull(skb2, offset); skb_reset_network_header(skb2);