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 8B20242FCB7; Fri, 7 Aug 2026 14:50:22 +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=1786114226; cv=none; b=Mn67H5Ppb0Sx+B+JFkvAiUKo+ttjG2Lg3rGNHIyC/Frk6rghJEAleKWpFLdOeWlpUO4Dzvpa8nJHwvMPIitB7kOBFUkakFzfEfsBlzsN5NLayUv8j5syC5N4r5MwDoQBxNwcSCzn7+KouiSLboicqQTk+Y68yds5qcR++1BNDi8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786114226; c=relaxed/simple; bh=2GV+EbTwn39fEWO/hDohPXQivf/fQH79crAo1sPmcfA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MojAMGLRbbRc21WgV0n0itzG1VDQaEjKFFmtR2Jt2gz1r8QajOGq5QMUIORlAKRqSfIBnn/d+LbtQa9+DcJK2/IUz3AW1xTU0/77Uz3JEW67l8Wd3MBlmH9AirlVz4IY/9nKWXKEq4GHEKs2dVKrAAXBkVK7OQqfo7Qekh9WhVw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=R6Is0zdS; 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="R6Is0zdS" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8950C1F00A3A; Fri, 7 Aug 2026 14:50:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1786114221; bh=QqcxGiRUtq9voVv9TJncuk2Ae8b76pNBWF/wWlzKmC0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=R6Is0zdSR3UCj6IaRhTq9VLB2W7L8tsk5S/cFvt9XxB9FVJexeF2Fkjt2D9spI3ku Wc7HIrPStUdHnvf7eY4YW0umqw2o6/is3LUCDTjynr5JyQv6yCFFCb7cpANKPGok4Q tmTuLUN27yDX733jCeJP6pG0DRQvMBmb4mvLhklM= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Eric Dumazet , Jakub Kicinski Subject: [PATCH 6.12 188/337] vxlan: unclone skb head before modifying eth header in route_shortcircuit() Date: Fri, 7 Aug 2026 16:36:31 +0200 Message-ID: <20260807143422.631341102@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260807143418.516897842@linuxfoundation.org> References: <20260807143418.516897842@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.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Eric Dumazet commit 760d36e737f2b3867762f42af36c663f55babcc4 upstream. When route_shortcircuit() performs L3 short-circuit routing, it modifies the Ethernet header of the skb in-place: memcpy(eth_hdr(skb)->h_source, eth_hdr(skb)->h_dest, dev->addr_len); memcpy(eth_hdr(skb)->h_dest, n->ha, dev->addr_len); If the incoming skb is cloned (for example by packet sockets, tcpdump, or dev_queue_xmit), modifying the Ethernet header without uncloning can corrupt the packet header for other readers holding a reference to the cloned skb. Ensure the skb header is writable and unshared by calling skb_cow_head(skb, 0) prior to updating the Ethernet header. If skb_cow_head() fails, abort short-circuiting and return false to allow standard packet processing fallback. Fixes: e4f67addf158 ("add DOVE extensions for VXLAN") Cc: stable@vger.kernel.org Signed-off-by: Eric Dumazet Link: https://patch.msgid.link/20260723144249.759100-3-edumazet@google.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/net/vxlan/vxlan_core.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/drivers/net/vxlan/vxlan_core.c +++ b/drivers/net/vxlan/vxlan_core.c @@ -2190,6 +2190,10 @@ static bool route_shortcircuit(struct ne diff = !ether_addr_equal(eth_hdr(skb)->h_dest, n->ha); if (diff) { + if (skb_cow_head(skb, 0)) { + neigh_release(n); + return false; + } memcpy(eth_hdr(skb)->h_source, eth_hdr(skb)->h_dest, dev->addr_len); memcpy(eth_hdr(skb)->h_dest, n->ha, dev->addr_len);