🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #13215

[PATCH net v2 0/2] ipv4: do not write shared IP options when sending ICMP errors

#13215
From: Eric Dumazet
Date: Mon, 09 Nov 2026 13:17
43 lines
9074 bytes
__ip_options_compile() updates Record Route and Timestamp options in
place. Two callers recompile options on an skb that can be a clone
sharing its data with other skbs, and thus write into shared packet
data:

 - ipv4_send_dest_unreach(), called from ipv4_link_failure()
 - cipso_v4_error(), called from the LSM socket receive hooks

If clones are processed concurrently, an option pointer can change
after it has been checked, corrupting the next option's length, which
__ip_options_echo() then trusts when building the ICMP reply.

Patch 1 recompiles the options on a private pskb_copy(), because
callers of dst_link_failure() keep pointers into skb->head.
Patch 2 unclones the skb, as ip_rcv_options() already does.
The two patches are independent.

The issues were reported by Kyle Zeng and found by an AI code review
agent. They were not reproduced, and the fixes were only build-tested.

v2:
 - patch 1: use pskb_copy() instead of skb_unclone(), since callers of
   dst_link_failure() such as ip_tunnel_xmit() cache pointers into
   skb->head across the call (Sashiko).
 - patch 2: no change.

v1: https://lore.kernel.org/netdev/20261106234313.2537882-1-edumazet@kernel.org/

Eric Dumazet (2):
  ipv4: recompile IP options on a private copy in
    ipv4_send_dest_unreach()
  cipso: unshare headers before recompiling IP options in
    cipso_v4_error()

 net/ipv4/cipso_ipv4.c |  3 +++
 net/ipv4/route.c      | 15 ++++++++++++++-
 2 files changed, 17 insertions(+), 1 deletion(-)


base-commit: 1d5e2c57e9ffc134e14b3f837c8d7c53b508bd22
-- 
2.53.0
Technical Details
Message-ID: <20261109131736.3060756-1-edumazet@kernel.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-359324-linux-kernel-netdev=dewy.ru

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-359324-linux-kernel-netdev=dewy.ru
From: edumazet@kernel.org (Eric Dumazet)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net v2 0/2] ipv4: do not write shared IP options when sending ICMP errors
Date: Mon,  9 Nov 2026 14:17:34 +0100
Organization: Usenet Network
Message-ID: <20261109131736.3060756-1-edumazet@kernel.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="366014"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:xXR9qTQlBgcshhHRZ+zWZ7aaYzk= sha256:pfKbjw9laeYZs4tj9UkDnAoZmqeTBVcWAo7YRvzdl7c=
	sha1:udbeoRVK2mSZtNR4ufzDJexqEIA= sha256:/zf5EbXn2wflvu/qeQuwQ2XMZRGsY3nwvCit0CPYJWo=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 5609C113803; Mon,  9 Nov 2026 16:31:17 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.401
X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id ICgN2s_LcsaR;
	Mon,  9 Nov 2026 16:31:11 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-359324-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4])
	by mail.dewy.ru (Postfix) with ESMTPS id 88A17113780; Mon,  9 Nov 2026 16:31:00 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sin.lore.kernel.org (Postfix) with ESMTP id C92862ED48; Mon,  9 Nov 2026 13:17:49 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1794230268;
	b=r22ySb8P9OBW7Dxu41BhLpm86IOsWFPtT0L+x5jCl0KNCLCBo2hc1+SraszKpmJ55gp4
	 ei6ZuWLZDYQ2o4U3liZXKAlQzaa9230QwUBznOz1aiNmoUXpGmMeMywkfZWrFxI7rwK9E
	 RcwDXF/8YvOnmg3xRfV25ghiNYtfyg50qYQfPPxkzr/eG2UowSCHW0iUb0nrVOQo8fs+b
	 iomFMXd6P922ZP4/E0NBEA63q5hH8PVDxQU3oE6XHw9F4dlWcR+uqEDngE4ej1muy8sI0
	 MX8cQjLxh51dI06D37FqG5YMHOxVEVm2s63CNup2CWALNgVL5xjrFhp+DFWAvKu3JCw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794230268;
	h=X-Original-To:Received:Received:DKIM-Signature:From:To:Cc:Subject:
	 Date:Message-ID:X-Mailer:X-Mailing-List:List-Id:List-Post:List-Help:
	 List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version:
	 Content-Transfer-Encoding;
	bh=Ida3Yygzy1UUVlawgmaaIzpSHIax/rpFOE3aZbkzj/o=;
	b=TiqH40m8Eedg/Xwcchg0yaqQVyguT7NVmhbL5Wb0It4mKnV5ZTrdCoSEBOZeo7vWnWRX
	 ctPgELqvygMTmw60lOpGWEr8wjgmkB5uvumOOplORhA2xK3DpA50dcoRNy6ybHvVRNDTv
	 6U0SbuX4yghlIGElwhGlGm5q2tV60Q/8MYfM25UmdWQUnUunQxeFqEZ1R6dGsXj6/fyib
	 dyGpALwTJjJLg0o0Clgb+iA6MFLaEXEP2iApLIq96pbUqUvf45mmhALEVDoxzAWMM44lC
	 UqBOmqy1i6D/nS1qbKcJj98k7SK3u8pn899VToL4RJ80jsABwSxEOv6PdgZrGholX4g==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=jz4C9B05;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 0EACF606A336;
	Mon,  9 Nov 2026 13:17:48 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=jz4C9B05
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1794230262;
	b=sPIsLZSB3Ul1BOk8c1o9lfXZRQCpf6oZazBd0G0R5RD3NZUOXb5kGdek8otcalc3P5Vz
	 vaO1C+jLz2BmATFxko5u2hi5n4OBsVrS6NN9pIPOln6pwfPI3YFls85MjRq3FN1sUul0i
	 kP/BL7U2H16kw2mXXVeukZ8ML2YsVK3YYDE0cBl2Na0gqjjwIrZsO81Vino5g7Rj72vK2
	 Wq4m/eV9wvLn4lN1rFTJw4hcOgJ2NMKbngjOi96/bluBeX550sPYEG1EZlyXVUoFoZil4
	 BR91rnNAb6Ib0rIYIVhncrEaZZwOvJ8SWT2WlJ9QeKbq+k1EQ/8BM+pNCzGXaYIEp7Q==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794230262;
	h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer:
	 MIME-Version:Content-Transfer-Encoding;
	bh=Ida3Yygzy1UUVlawgmaaIzpSHIax/rpFOE3aZbkzj/o=;
	b=Wk49XrWtCd711APM7Smm2q0BoyWHU1EgrFp87luzSrEXqvXYKBCN9mrTvJ4k4PSBo265
	 KLJfO1aJUDp/0fVewTxEyH6GSWy2jY+F1iAOI0TEeRIeygs9OhCl2+dMSsmONyd6FpMXG
	 cZ9F9IDvTCfjmBVaIz4LNqLDO/7/oyCcg88RauHWodLRqURmcIW7OCpy3utBxyQ7Zbvs7
	 2TTLoq1TX24xK+ZAm2ZfVzaBpPi3o0UeQrcynYtHok21lyWMdmzArGVUEXHWx7Bw46EXh
	 CX6HxbBXdiNJ2Azm8sqDMn2YGHZSwU555Kf+NXNyAX6NZFpMUNO+v1dZUVfv/q3flJA==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=jz4C9B05;
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id E37BA606A31C;
	Mon,  9 Nov 2026 13:17:41 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 60F4F1F0089F;
	Mon,  9 Nov 2026 13:17:39 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1794230261;
	bh=Ida3Yygzy1UUVlawgmaaIzpSHIax/rpFOE3aZbkzj/o=;
	h=From:To:Cc:Subject:Date;
	b=jz4C9B05hpP7qBtUm2s8DuWRulge1rhaJylcjcRBxHVUHMTOoVZDGgfHQw+2Ayyi5
	 ZqttTwST+G/2dE9F3yKOLfHlwCqA4rlaL37CSpm622ouoCFpAJCgD0/csjYzcnC+pL
	 tL+ec2cFWsXXXwBYCxdOFzNwwxIa+5K8KTPLfUImmK81mG7iUJOpKZ8FO4tU8L7+0G
	 Fu3rsu6cpBRUxbBIoOwzS5dH++yAcs4Z9G26wgjMdNYWj8Iynzbxbv6CrVyM5r+DSp
	 YffBJUqA9HKcs81T5nmDPMxlcgrtU1+vm5DSsabfvaAx1UtdhfQNbCZ0t90LbpTFio
	 O5/zUo8jmpIAA==
X-Cc: Simon Horman <horms@kernel.org>,
	David Ahern <dsahern@kernel.org>,
	Ido Schimmel <idosch@nvidia.com>,
	netdev@vger.kernel.org,
	Eric Dumazet <edumazet@kernel.org>,
	Paul Moore <paul@paul-moore.com>,
	linux-security-module@vger.kernel.org,
	Kyle Zeng <kylebot@openai.com>
X-Mailer: git-send-email 2.53.0
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list