🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #12376

[PATCH net 0/2] ipv4: unclone skbs before recompiling IP options

#12376
From: Eric Dumazet
Date: Fri, 06 Nov 2026 23:43
33 lines
8680 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.

Both patches unclone the skb before recompiling the options, 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.

Eric Dumazet (2):
  ipv4: unshare headers before recompiling IP options 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      | 3 ++-
 2 files changed, 5 insertions(+), 1 deletion(-)


base-commit: 30c71476d842b094651bd7712f6c8ee8716147d0
-- 
2.53.0
Technical Details
Message-ID: <20261106234313.2537882-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-358238-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-358238-linux-kernel-netdev=dewy.ru
From: edumazet@kernel.org (Eric Dumazet)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net 0/2] ipv4: unclone skbs before recompiling IP options
Date: Sat,  7 Nov 2026 00:43:11 +0100
Organization: Usenet Network
Message-ID: <20261106234313.2537882-1-edumazet@kernel.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="4003453"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:INk4ikYxry/ZwKBgJke1rD7a1ms= sha256:aglZoYAhG8YY07S986WodOWOTXbx+L09lk7bMGcNz6M=
	sha1:9T1yz4VF83X6ls1zVvZN1vuPF2o= sha256:N2e3Q/82UUGrTKOBdDTRU1mqQ3n9pZh9kKEv9450DDw=
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 D968911337D; Sat,  7 Nov 2026 02:43:52 +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 afpzC1lCvTbm;
	Sat,  7 Nov 2026 02:43:50 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-358238-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 sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 9E439113357; Sat,  7 Nov 2026 02:43:37 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id D09F528498; Fri,  6 Nov 2026 23:43:24 +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=1794008604;
	b=gJzi2umaP4pAHkg/Y5hU43l8WFv7XTtpkxs7e+KqYHFbNgUuMdN9usYMz2EXe+fO3K5O
	 0lDVTYlxHR4dM8BmjCWYGR0NTndd44qxIXZqMVG3HIPIL4eBSzxc9QZyT56m7MVyGtE63
	 SHK8hcI19UmoO/wwigmQaXzPeVB5ulUSW3J2+REhaUPDQeXRyN5alWK/PeePWjjnoa2pn
	 NkqYxWFkqWL5nmTKLecmOo/p7OW+NiFc+x5xUUa8d28Q50V22t84KebZY4qva2JUbbo9P
	 gngTvG4kmQTKL6/UV6/AuXojEmjLUHG46siXXIVX4cyDAIcem0bWxgIOxHzTadRoD+Q==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794008604;
	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=yRwbTzc+4Y4nBQrHleaku/vP6Zwjg6n1YmCmiprmN7s=;
	b=f+Jgh/rmY6jmsC+dtCqJ/Ec9U/EMHHkyM5KSx3lv0TrQKAUbzCxTIAx5yjjOKTLO/Atf
	 5gMNv6hD581w418JnBsxRhydAG7sUz5giEu3gjiSBWafje6ujgp+k+mVqwA9VEPjOR8kS
	 arK2a268bh4d1nZL4huVDcBqx1eaSNQU5H280gDYoyUrmrXDVwMf2vIM+nTjrfD53zJnC
	 AJypP0i/8LB0CY6grjjqa8WRASXP8f34z1wpeEX9QwlzHNitm/Ob6CQuJbVtnCt5VnP7L
	 kbMIC4YZ9/W81YR8jIIbTgLRblEUaLGTKvy6id0eekClGJJr6rukFNReKw3D6Wpljxw==
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=HttAHTo1;
	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 72697606A338;
	Fri,  6 Nov 2026 23:43:24 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=HttAHTo1
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=1794008600;
	b=unCbKx895kQH3ZZpjIKHwqaQ26O0QEV/tn6GiMDichQAnV/D7HNfSAfHonieWDdnBmQW
	 5EwTYBbZTxyJhXkQErjCt8/b7mUn5WPFvoYNhWu/U1FAYAu6Yw8KZmhyWb5nrABkZLeuJ
	 +8YaLMSxHPRsmZlfeY5auVVDleMPB+VpZ6REKcvThQkVdsxjsvTsvv8Frv6E6eAEiniGv
	 KQwd1Bu72xDaAZ+YjCR6PrbitdoKKfWpk4p5T2JXKd9/fcdzxOCoW5ZBsOhuRCCynPGep
	 wDUaqaKQC4fyC1R0lyajkhOKLb6vAmpKWhhOBXiHMihI7wmpETM27UiaIwfQZ1skMtw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794008600;
	h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer:
	 MIME-Version:Content-Transfer-Encoding;
	bh=yRwbTzc+4Y4nBQrHleaku/vP6Zwjg6n1YmCmiprmN7s=;
	b=EONJJSSM+LRlshHP20hNO8yzkmjlnpt/EKVJi4YizPTTABZR+xDgh8t33DWVVrAiGzL/
	 5YHlegahFg+Njdg1/aO49NqT3YJXr+8n5bB3A+8+h5HkJ1/39/oGtbRebYau/csMhjT8J
	 scsTUX9hT5vduc0eJ4xazP2yYM+M8NT4kNSbh0VFDyqHnkjORAYaGu9RsUBSrPKy0T4ry
	 NumMUz35TimJ7acQWIbxMTkgavmDfyoW6/hU/gMStz97gJ7BbeFw/nxQQnWQugE7RML0M
	 7HnuzqBthBk9cujcuhwi/10al6REVyJx3VBGBfudtFX1dssWmFezF7XOZgs0inJJ87g==
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=HttAHTo1;
	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 09694606A326;
	Fri,  6 Nov 2026 23:43:19 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 310CF1F0089F;
	Fri,  6 Nov 2026 23:43:17 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1794008599;
	bh=yRwbTzc+4Y4nBQrHleaku/vP6Zwjg6n1YmCmiprmN7s=;
	h=From:To:Cc:Subject:Date;
	b=HttAHTo1Krfn+EPfX8TGj5Hd/bq71p9tNL+7aVVxz8wOhH3qRVJ7uyxqOkWsOAV4d
	 872ycw1NDAgM81yNWTsRWUceHRskn52JZlgA/4oDWXxKFgzK/JrHaYJ1CV0R0E6Pom
	 wZbooZA2ryFGyqq3G0nd11yOGtppV2UA2KOAnFBtU8A/jOMvPxEiVBeQEIQ7iYnR6H
	 +1uCchxZaIzwJVudjKY9TE+zzTLSnOAu+XtgPR5Ryg8Sa3zwY7MezccDqlfVx0fEhR
	 esY4if3VOc+avKpd0/8s5k7MWJ5yQKeO+ISBo6cXDV8dwRzx8lr2NDRXn/FrK4hf8Q
	 B/47I+TjTRRTw==
X-Cc: Eric Dumazet <edumazet@kernel.org>,
	Simon Horman <horms@kernel.org>,
	David Ahern <dsahern@kernel.org>,
	Ido Schimmel <idosch@nvidia.com>,
	Paul Moore <paul@paul-moore.com>,
	linux-security-module@vger.kernel.org,
	Kyle Zeng <kylebot@openai.com>,
	netdev@vger.kernel.org
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