🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #22284

Re: [RFC net-next v2 0/7] ipv6: validate dsts against the netns route generation at lookup

#22284
From: David Ahern
Date: Wed, 25 Nov 2026 04:11
49 lines
10307 bytes
On 11/24/26 1:46 PM, Ralf Lici wrote:
> On Tue, 24 Nov 2026 10:15:40 -0700, David Ahern <dsahern@kernel.org> wrote:
>> IPv6's finer grained invalidation of fib changes is why this whole
>> cookie caching mess exists. It is a performance optimization that to me
>> has gotten out of hand and as you reported is the cause of functional
>> incorrectness with both xfrm and other caching.
>>
>> I spent the morning doing a deep dive on the claude assisted patches and
>> really like the direction. Making ipv6 fib management and invalidation
>> align with ipv4 should remove the need for all of the cookie stashing on
>> sockets and elsewhere plus remove the cookie argument to the dst APIs
>> including sockets. ie., it is a good cleanup and simplification of the
>> code base with the cost of more invalidations on ipv6 fib changes.
>>
> 
> Understood. My goal is to get the race fixed, so if this is the
> direction you want to take, I'll drop my series. FTR, I don't think the
> finer grained invalidation is the culprit here so much as reading the
> cookie after the lookup instead of during it, and I still think the
> per-node scope might be worth keeping (v5 shows that it can be kept with
> validity in the dst), but the trade-off is yours to make.
> 
> Whichever way it goes, a few things I found while working on this apply
> to your series as well, some more broadly since any FIB change in the
> netns makes every pcpu dst stale:
> 
> - A found pcpu or exception dst has to match the lookup's sample,
>   otherwise a lookup can return a dst rebuilt after the route it
>   selected changed.
> - A replaced pcpu dst released with dst_dev_put discards packets for
>   holders that use it without validating it again, such as a corked UDP
>   socket.
> - Dropping the slot's reference with dst_release while an xfrm bundle
>   holds the dst as its child can free it under a lookup that read the
>   slot without taking a reference, as the bundle drops its own reference
>   without waiting for a grace period. 4/4 of my v5 defers the slot's
>   release with call_rcu.
> - Stale exceptions need to keep their PMTU and redirect information
>   instead of being treated as misses.
> - The forwarding sysctl is read in ip6_pol_route before the generation
>   is sampled.
> 
> 

My set kept growing. I told claude not to add the order switching; you
have a patch for that which can go in as is. Not sure how much of the
above list is covered by my non-RFC set. That one kept growing through
the iterations with claude and sashiko/codex.
Technical Details
Message-ID: <f57bd1af-fac3-49e1-b0ce-4b980289fdd5@kernel.org>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-371014-linux-kernel-netdev=dewy.ru
References: <20261123212623.106153-1-dsahern@kernel.org> <20261124163553.783988-1-ralf@mandelbit.com> <72ade685-ecce-4215-a30b-25be7666e299@kernel.org> <20261124204623.45969-1-ralf@mandelbit.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-371014-linux-kernel-netdev=dewy.ru
From: dsahern@kernel.org (David Ahern)
Newsgroups: linux.kernel.netdev
Subject: Re: [RFC net-next v2 0/7] ipv6: validate dsts against the netns route
 generation at lookup
Date: Tue, 24 Nov 2026 21:11:28 -0700
Organization: Usenet Network
Message-ID: <f57bd1af-fac3-49e1-b0ce-4b980289fdd5@kernel.org>
References: <20261123212623.106153-1-dsahern@kernel.org>
 <20261124163553.783988-1-ralf@mandelbit.com>
 <72ade685-ecce-4215-a30b-25be7666e299@kernel.org>
 <20261124204623.45969-1-ralf@mandelbit.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
	logging-data="107096"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:HbhsVsikD2LYQlpZ+low9sNPiCc= sha256:InIxrmBaud/a+pqHCnCnPIxb7OljdSjd3Bi33yH5L3U=
	sha1:tmPmAMhebknuqeFKekHipoy0aC4= sha256:np4dMDT7L8nnpR2pm9FvrOXQ8DKy0DBILUymlsACagY=
Content-Language: en-US
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 D9436125E39; Wed, 25 Nov 2026 07:11:50 +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 VCQo0GzWpD7b;
	Wed, 25 Nov 2026 07:11:43 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-371014-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 F2371125E35; Wed, 25 Nov 2026 07:11:33 +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 43B65294B8; Wed, 25 Nov 2026 04:11:31 +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=1795579891;
	b=uTQQgmbfFPvbTgRoyL1SxbPywx+UW+1mGfl/MYfO1vJUxouo00aYMoiYcu1TGaqez6Vh
	 Tod0/7mYPlwlhgwU3YFKX8Gaob4d1lyQU0vn1sSrUy2Y99MZlRNMnwDGiztcOcLVG0MhZ
	 lbP0nfaigIi7cHJTs/26gMYcDZmiiCBjkY0wLCIIDdSSjvQYo2+6AnJC9BzcsfCrRLCAL
	 lZLpUS355aLkA2XBX+SOK7jvP3W8A3oB9ZGJ22Me+RFQjimTOu8/UAFW4l70jQ72S0Dgb
	 fRh/mR5fnv3lSce8CLKoZH9T+LIUmWHtUV3OaZ+6jiObUVijM71psJWtuQ65myIdj6g==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795579891;
	h=X-Original-To:Received:Received:DKIM-Signature:Message-ID:Date:
	 X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:User-Agent:
	 Subject:Content-Language:To:Cc:References:From:In-Reply-To:
	 Content-Type:Content-Transfer-Encoding;
	bh=RuWBxqmlNzoGpyn58kI2cHzyi/kIZ/Boh+P0A/056Nw=;
	b=m1rwL4xw4w494NSgnP0jV1iv5ukRfudHliJaJL6B82my4vfUjCasXBGMjcJIoUsP9ULT
	 lEOTlZX7CeD/U77VH0LH90647K5/DRBomDEjmkwigOywSvnoEOAkIUXwl2icriaqxLIBO
	 45MpRyp4LWLNjsH8I//2WSMIMYNbh2VG1QXOPLcXdsgaD6eekBWDcnpFAdzYIf7NH1JZ+
	 NxJLvcdpeDI92cGHDsbRJgA1jSid/2D+bBstj3c43rYqfeV+kpMmogB8mA+A18ACC4ex/
	 dw4Q+hfJJHRxkx1itc0a7BtGjlyiXTUEE+N2uRg2uxWb6l4l151d3go/otYizzIi6rg==
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=QAFrcbIR;
	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 1B23D606A32A;
	Wed, 25 Nov 2026 04:11:31 +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=QAFrcbIR
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=1795579890;
	b=QqPbp4RuBnClN0G0WRoGJHOuCJUXjwWPUc/2/KrneX5HqO1188/qbKISjQWWSphw2oSp
	 ASNXb/XCvP40PFsCU0TyhZsGKK48YjYqOj6Kb/57sjz1w5D/7iq27rXjAVYv29TM+fw00
	 3P+MSLsIT4OGX3FRCGvaU/Z6AQQNdf8kBwG5j/6xwXIEgXJuOknE22lQek0HHlf7VlQOW
	 5Mnkar1yr0WtvknJ3qaV2aDBEbfpos1j53N5PYLWf/TT39QNZwpi/arT4m1SfZUjIHzIJ
	 QGLfHKdHGq2Rxdmq+1yDV2g6sRKAfyiaxCQIWAsH8Mftx6JhMlhb6fhjSkYWDaEJvtA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795579890;
	h=Received:DKIM-Signature:Message-ID:Date:MIME-Version:User-Agent:
	 Subject:Content-Language:To:Cc:References:From:In-Reply-To:
	 Content-Type:Content-Transfer-Encoding;
	bh=RuWBxqmlNzoGpyn58kI2cHzyi/kIZ/Boh+P0A/056Nw=;
	b=rNotp8d9t+S/Ny5TVZhxTS+GRXa6WKmkbwulIGNd74IqJCDGRWIGrbNUOt3Ht7ypwz9u
	 1c0nOY9sEHxMKn5XCf5VVh4+1yQN5MhmHtUHQD0IvJNUdFeCcnmlWE1l5QQTbc+ze7d79
	 yKfneRSObqBjbGw+SmcvDgAlzeCgX0RmCWZpif1WHrgvD0gDGEBgjmitHE9/e1dfGUWSv
	 MqY6dJlkYeEgqtOmFAxQiNaVlowWe89jlsabkFGVHI/MxpU+xQjZ0owNefWaPhjPMqTab
	 KcPavmuEXGbHCP7ABH8rIb3KRqiFFdhI4jn0G3txjy5t8RHEfbRncNSkJuplM4DWdIQ==
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=QAFrcbIR;
	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 38C2C606A327
	for <netdev@vger.kernel.org>; Wed, 25 Nov 2026 04:11:29 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id B84F31F000D0;
	Wed, 25 Nov 2026 04:11:29 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1795579889;
	bh=RuWBxqmlNzoGpyn58kI2cHzyi/kIZ/Boh+P0A/056Nw=;
	h=Date:Subject:To:Cc:References:From:In-Reply-To;
	b=QAFrcbIRsGdYvPZlmvqjwV1L0L4bKuzfNt0vaA8mVyUptjEgkdG7Umwv5ZYqm1Nyy
	 ++hPIjjGVGazwwZTX2PJnoc+dhQoGvRHwv26UPcZTH3lDK7W1v04oDezmYyci1G/cI
	 eXfu7GItZGuw3JO7awgmvZvsktBM8gfPcNsCsFiypKr49yCfi3btwuZ+aWO/r7th5K
	 /edZlXI+CU/Fz9/DZFbTgibzG6c5BT2Y6V862haX+XgQXYNdK9yKUs88/thWeG+B+o
	 ZpWS0K7itBJptHAn7wsW4mSop6mWj09LoSmUyhT7k2p0IZVa/SbhmMgNFC9Nea32Px
	 o/hLtFabSV1YQ==
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
X-User-Agent: Mozilla Thunderbird
X-Cc: netdev@vger.kernel.org
X-In-Reply-To: <20261124204623.45969-1-ralf@mandelbit.com>