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 8F8272FB97B; Sun, 7 Jun 2026 10:44:08 +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=1780829049; cv=none; b=npthu+lJXEEhtZsHilEAKsxNkbvzStN+m832e8lL6BNAMKFKu3i0HsIDIqt7n8GWUEzpqxcTWYPRZNw9GkP+VmPgYQiDHLGBU0FPk1wWUYiaj6Fx+1EfskuWErIyCBAO3GF8ygU6iojMmWr/blanMfqG99Jp6kY6pKgsWRSxYdQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780829049; c=relaxed/simple; bh=53ns/gK0JbzIsm5v6I8YanQ2afqDPl3zYilUW5GxJNc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RnYHMbL7IWlw0iXwKN18LlHtGf7J59R1phJarXlhGlLc7IHlNAil3TbQ98z2Al0OQU76R0lV9TPo77LRooBiWkJWLM05bbNc5S3Zr9JME32n2AHLgEpUVIPIOJIizh5jqQqAHd1PNDWR8Wywk/F47R82vRWdAcWVLBUGyDTjMmY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=E0EKS+At; 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="E0EKS+At" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C8C8C1F00893; Sun, 7 Jun 2026 10:44:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1780829048; bh=JIp5Bqn0FVC3onfH9C3lSNJL9k3f8r6YAJjrU9CJOO8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=E0EKS+At4HNen5TuD7mKxlkEnfNILEyjRxmAr7qF3IbOl+gfhMBOGziuajnZ3BCaw 2Z9IDrA8e2XXWgNHeDYymr7lqBfnZrDpL5TGixIx9oxWr8EY3ZHmSapT4yp6Z/5D9h gdeEcW7ez84u3G5MpoIYcuTRVlEupg4CfuiuL2vk= 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.18 189/315] ipv6: exthdrs: refresh nh after handling HAO option Date: Sun, 7 Jun 2026 11:59:36 +0200 Message-ID: <20260607095734.518289025@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260607095727.528828913@linuxfoundation.org> References: <20260607095727.528828913@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.18-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: