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 C43A73C09E1; Tue, 16 Jun 2026 18:05:23 +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=1781633124; cv=none; b=kJUfGNBeL9c0QmrVu+DhkEi4BoBjNFltkR2KsYmNbx2LzVgSf8fTYIhTI3VFPp0HC9yvOWIYKGXJVlwKjhx4J4klqjBFgZsFqggwUI2YtYZkWxLXGYKRLFB858REH3cL1tLm8g0q14ia9ZFk7MBH9alJHC57gsZqG01E10ZYBEs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781633124; c=relaxed/simple; bh=T9v900E6Js1aZPU/wL3va1+Xn08ddYAu5zDjus865eM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DQCBD5VgSYcmfuYWccHSJi//LgqD0qU3QpPDn1o9tde51+LBAAzSyIDIf/+hBmWvbPpJvJF4kz/0foz3mbisUPFOfkXqVhgkCKiLyYZpkv+y6/5N2hpRcnP1/Z5iXR5snjDvypxYIR5C2mvhEIrkk0gbQW8n5dXP1y5xVRsHe7s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Ckvd+eZz; 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="Ckvd+eZz" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4AB091F000E9; Tue, 16 Jun 2026 18:05:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1781633123; bh=rfpFQZ/c79bhCG40KOvDhnF3/mT9YGS6FgJ7heXU3G4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Ckvd+eZz8Edl9DnRwLx2OMgFlNsYze3WShonBaPuSCU+HJKIti+wSdIZObUH64grC tkah/Dg4p66X87mZZwYnxoOoFzNCbPSBObiiFCwliT0JRyfx+LPdkqKPR75YuRc4ai G7XT9oLCmQ1EwAhtfxDlx1RvUKsMNBrYIwuboVuk= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Eric Dumazet , Stefano Brivio , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.15 023/411] vxlan: do not reuse cached ip_hdr() value after skb_tunnel_check_pmtu() Date: Tue, 16 Jun 2026 20:24:21 +0530 Message-ID: <20260616145101.606348280@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260616145100.376842714@linuxfoundation.org> References: <20260616145100.376842714@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.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Eric Dumazet [ Upstream commit 7d9ef0cb271555d8cf39fefe6c981e1493b25ecf ] skb_tunnel_check_pmtu() can change skb->head. Reusing old_iph afer skb_tunnel_check_pmtu() can cause an UAF. Use instead ip_hdr(skb) as done in drivers/net/bareudp.c and drivers/net/geneve.c. Found by Sashiko. Fixes: 4cb47a8644cc ("tunnels: PMTU discovery support for directly bridged IP packets") Signed-off-by: Eric Dumazet Reviewed-by: Stefano Brivio Link: https://patch.msgid.link/20260525203642.2389723-1-edumazet@google.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/vxlan/vxlan_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/vxlan/vxlan_core.c b/drivers/net/vxlan/vxlan_core.c index bd2b44071781ca..7967b429dfcf5f 100644 --- a/drivers/net/vxlan/vxlan_core.c +++ b/drivers/net/vxlan/vxlan_core.c @@ -2753,7 +2753,7 @@ static void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev, goto out_unlock; } - tos = ip_tunnel_ecn_encap(tos, old_iph, skb); + tos = ip_tunnel_ecn_encap(tos, ip_hdr(skb), skb); ttl = ttl ? : ip4_dst_hoplimit(&rt->dst); err = vxlan_build_skb(skb, ndst, sizeof(struct iphdr), vni, md, flags, udp_sum); @@ -2816,7 +2816,7 @@ static void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev, goto out_unlock; } - tos = ip_tunnel_ecn_encap(tos, old_iph, skb); + tos = ip_tunnel_ecn_encap(tos, ip_hdr(skb), skb); ttl = ttl ? : ip6_dst_hoplimit(ndst); skb_scrub_packet(skb, xnet); err = vxlan_build_skb(skb, ndst, sizeof(struct ipv6hdr), -- 2.53.0