From mboxrd@z Thu Jan 1 00:00:00 1970 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 81DC74315F; Mon, 17 Aug 2026 14:20:56 +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=1786976457; cv=none; b=C8nIAkMccLSQHf7Cg6UhZNCdgqu5tECmzN1ReXR0NfyupR2OT8+71rATgM3i0R6wcEQpr/7aEEY93ix3AmHYyqd1b83v5SX/NaIKymy5VMVjKN02HDWI5gVZpXq694AheK7sfLwgGJ6rr6arZHXPY8JGHNHoAa7IViwuTTXTs68= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786976457; c=relaxed/simple; bh=HuULhykHAT23h1H/zGqGswm2MMbxP6vssbpw5PRHo5s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=b6t3Bcsl+D8DcR57bIBzhnHQ1DEPXGKqJwsX4o9NpdwlqtmCAkCTOqWDGgmxI6lehfSS7Co07fkNIND9XcYYo1XxPiYGk7GW6UbAki9FpV54uPzuGymK6Hk22c+yETSFvzoLYHBtwxPcsTO5QlFZ/TirIM/+9xLaxo8B1koKbTw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=DD/CKWO8; 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="DD/CKWO8" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D27EC1F000E9; Mon, 17 Aug 2026 14:20:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1786976456; bh=JWsB9/XqLxcrXcJv1QT9fXWLly82mkC4PWBT56CJatQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=DD/CKWO8WbNZrX1Nbc9tLzFsZzH2InH3MhjTyPtdR0ces4SZU9QyzxV8M1Kp4nCg2 tFRHl/oNgSf8uwoBeomk0JFYuc1QYN8bn2ZCM05+hKgPdgoPdTVwv1Z2hjNTMgovIT QnxCWszZwRGkN7xefacCET0SOTJiM9RT9Ujjt0BI= 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 5.10 380/389] ip6_tunnel: clear skb2->cb[] in ip6ip6_err() Date: Mon, 17 Aug 2026 15:33:39 +0200 Message-ID: <20260817132553.503462137@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260817132538.796021292@linuxfoundation.org> References: <20260817132538.796021292@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 5.10-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 @@ -708,6 +708,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);