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 E0A63257855; Sun, 7 Jun 2026 10:44:11 +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=1780829052; cv=none; b=A5Ou2KAcvcsEEcTsHwmVdNdcJj64nfTHG+/TumSpYM2oBD1JXC8cH0gMTagp6IEVp0R0zhss3WVWwREwXZo8er+yXQ/pfkLWXrkw0xrN8Tq1MJ4EFd1iQo/CS2JK9p0tEaBYWn2csrkCxlwr455D9Jd7I8GWCdWCaKk8hhqoyrs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780829052; c=relaxed/simple; bh=1ZjfhM6HlFXQ1iXnMpCsw9n2MuFK/jHt0PgewO3z9XU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tPrACPXEvT0GlCZj3Mz4PoMeFEfd3Zgh96mqQWc/Rgb/MqUEYHPGBU+JOuYlqzQpe6zHh0ud3G+HH/hSNEVeRLr9ttwJaOYyhOoiALCVFnr6g2nQ7Yd18nbwH5RreDS06lyGuCsve61Sc8qXEiTWGmrzi0SOFwJiAd+fxwCZFiE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=osheqW4m; 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="osheqW4m" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2D9241F00893; Sun, 7 Jun 2026 10:44:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1780829051; bh=a8m9D/KfHyFtvT3SNJ1mRde8KUyq6+Hd1A074E7R1kA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=osheqW4m4XKWYmC+NDKraEX6+9h7R3oOC2wen99kA4pH2tkGg5L4dtOW8cyiCguIn Ce1ALM0JOTnkdJ2zrUeXQaRsJT3jjYAzgYIlYfXGZiWge79mQDkyCMOrrubfX44rG5 EHKGwF5OW/g01BwF+jUQXyJ5RjYOHo7nFIVMJtNY= 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 7.0 214/332] ipv6: exthdrs: refresh nh after handling HAO option Date: Sun, 7 Jun 2026 11:59:43 +0200 Message-ID: <20260607095735.919676701@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260607095728.031258202@linuxfoundation.org> References: <20260607095728.031258202@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 7.0-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 @@ -203,6 +203,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: