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 29E2D43D4E9; Tue, 16 Jun 2026 16:50:04 +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=1781628606; cv=none; b=bYYl8BnRFEk9E/QoGgZPkHkr1CiKI1lNWjYwpnSdwyHUtM+QnmsxjbPmurDEP5cTDisEUz/rqG9ly2liS7E4TOERm58Qg7/firIupv4zbJiWl/b725pz2oeAv7xTAIT+juq6gWzZT5y1/NbIGUjpO5K3ty+hXDF3WeC4ysZme+I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781628606; c=relaxed/simple; bh=bzsGmZtRyd1dC3fUUtAxnU2apKVAHeQvO6dG+kPn+SI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VR96PwN8USG3hlL2cijtPZtPN0+6FEz41ntHY1gcVMlG2/+viQG0NLLGQvVRs5Ls0SUg/gYiPjAwm/+swSXC4xPCXeZE/N/2sCBv7DqMfTKE4uB7VigZDjq2YhQK6xEwq+njdJYW2P0pG0w8mokt5cdhuds3/FFBlNjLzxRFosw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Ww14bdAN; 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="Ww14bdAN" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DE3ED1F000E9; Tue, 16 Jun 2026 16:50:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1781628604; bh=mXMvquBL7JgM/HLNzoAe6vPqCWXsOWhTOM9MSva3r2k=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Ww14bdANpdbcYy2Hkxy/Fk5F3y0fhVjV0PIslIe2RAI2CxM0kkVNkfhz0tliNKk/p IxCANdk0lDlMGpeGoEPRKRdBl6d368/qqewIL+6XiDoKXrtZnSa1vh5ttjUVWfqA9Y dt1zSWT4EM/14ELDUbGu8DEIparNBH3U03a5VlKM= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, stable@kernel.org, Yuan Tan , Xin Liu , Luxing Yin , Zhengchuan Liang , Ren Wei , Justin Iurman , Ido Schimmel , Jakub Kicinski Subject: [PATCH 6.6 128/452] ipv6: exthdrs: refresh nh after handling HAO option Date: Tue, 16 Jun 2026 20:25:55 +0530 Message-ID: <20260616145124.468572247@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260616145117.796205997@linuxfoundation.org> References: <20260616145117.796205997@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.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Zhengchuan Liang commit f7b52afe3592eae66e160586b45a3f2242972c63 upstream. ip6_parse_tlv() caches skb_network_header(skb) in nh while walking IPv6 TLVs. ipv6_dest_hao() may call pskb_expand_head() for a cloned skb, which can move the skb head and invalidate the cached network header pointer. Refresh nh after ipv6_dest_hao() returns so any trailing padding or TLVs are parsed from the current skb head. This matches the existing pattern used in ip6_parse_tlv() after helpers that can modify skb header storage. Fixes: a831f5bbc89a ("[IPV6] MIP6: Add inbound interface of home address option.") Cc: stable@kernel.org Reported-by: Yuan Tan Reported-by: Xin Liu Co-developed-by: Luxing Yin Signed-off-by: Luxing Yin Signed-off-by: Zhengchuan Liang Signed-off-by: Ren Wei Reviewed-by: Justin Iurman Reviewed-by: Ido Schimmel Link: https://patch.msgid.link/7aba1debc2196189172499e5769802b026f8caf8.1779247873.git.zcliangcn@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- net/ipv6/exthdrs.c | 2 ++ 1 file changed, 2 insertions(+) --- a/net/ipv6/exthdrs.c +++ b/net/ipv6/exthdrs.c @@ -202,6 +202,8 @@ static bool ip6_parse_tlv(bool hopbyhop, case IPV6_TLV_HAO: if (!ipv6_dest_hao(skb, off)) return false; + + nh = skb_network_header(skb); break; #endif default: