🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #22831

[PATCH net-next v2 02/13] ipv6: keep a superseded pcpu dst working until its holders notice

#22831
From: David Ahern
Date: Thu, 26 Nov 2026 01:33
48 lines
9695 bytes
From: David Ahern <dahern@nvidia.com>

When rt6_get_pcpu_route() finds that a pcpu dst of a route using a
nexthop object has been invalidated, it takes the dst out of its slot
and calls dst_dev_put() on it. That points the dst at the blackhole
device and makes its output a discard, although the dst may still be
held: by a socket, a tunnel dst_cache, an xfrm bundle, or an skb that
has not reached dst_output() yet (a queued or NFQUEUE reinjected
packet, async crypto). Those packets are dropped, where the holder
would have noticed that the dst is stale at its next check and looked
the route up again.

The dst does have to be detached from its device when the device is
unregistered: it is no longer reachable from the FIB, and a holder
such as an idle socket can keep it indefinitely, which would hold the
device. Put it on the uncached list instead. It keeps working until its
holders let go, and rt6_uncached_list_flush_dev() detaches it on
unregister like any other uncached dst.

Fixes: 8f34e53b60b3 ("ipv6: Use global sernum for dst validation with nexthop objects")
Reported-by: Ralf Lici <ralf@mandelbit.com>
Signed-off-by: David Ahern <dahern@nvidia.com>
---
 net/ipv6/route.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 6f0af090c606..3337a8fe2550 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -1483,7 +1483,13 @@ static struct rt6_info *rt6_get_pcpu_route(const struct fib6_result *res)
 		/* Paired with READ_ONCE() in __fib6_drop_pcpu_from() */
 		prev = xchg(p, NULL);
 		if (prev) {
-			dst_dev_put(&prev->dst);
+			/* Holders may still be using it until they notice it
+			 * is stale, so keep it working rather than dst_dev_put()
+			 * it, which would turn the packets of anyone who has
+			 * not rechecked yet into drops. Device unregister
+			 * detaches it like any other uncached dst.
+			 */
+			rt6_uncached_list_add(prev);
 			dst_release(&prev->dst);
 		}
 
-- 
2.54.0 (Apple Git-157)
Technical Details
Message-ID: <9a45f4107473a2ab534f0c17ee237ff5344573bc.1795642432.git.dahern@nvidia.com>
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-371785-linux-kernel-netdev=dewy.ru
References: <cover.1795642432.git.dahern@nvidia.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-371785-linux-kernel-netdev=dewy.ru
From: dsahern@kernel.org (David Ahern)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net-next v2 02/13] ipv6: keep a superseded pcpu dst working until its holders notice
Date: Wed, 25 Nov 2026 18:33:28 -0700
Organization: Usenet Network
Message-ID: <9a45f4107473a2ab534f0c17ee237ff5344573bc.1795642432.git.dahern@nvidia.com>
References: <cover.1795642432.git.dahern@nvidia.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="352837"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:pcX8mij+u5/ln6g9jFXjkjwzC2k= sha256:sbNlgaXb8Q7wgIaDij8x2SHoyLrTOBvrIJAlFLoEi00=
	sha1:5s3Q30xi0oP1w5OM+cZK8D6y+pA= sha256:4cq4YUJfbLdUMHoFZ9PIQUBM7IDjjpg6jO0eMvcb6eo=
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 E0E7D125EAD; Thu, 26 Nov 2026 04:34:08 +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 J0gMmQqNXpBw;
	Thu, 26 Nov 2026 04:34:01 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-371785-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 tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id 0A7E8125EA1; Thu, 26 Nov 2026 04:33:51 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by tor.lore.kernel.org (Postfix) with ESMTP id D70A3305C2; Thu, 26 Nov 2026 01:33: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=1795656828;
	b=LHqDg/fPbL8Yxsf2Y2rZ/TzSzVz/xCH3lqt+wk7XeXEGQVyQOp0fwgSZ/MniMaRbmaXg
	 crzNI0OEDPkqay4QFqNq+QL3czvCPGsUQIJRiTf9XpcW+hMLr0P1ghW405zkWGfw3dFJh
	 Bu+01FZJ0s9UBDlcL3QET2Ec87N6BO5PAUM5zx/4ihFgTbM+qXRxoEJYn9Dj5Pe2qWPGG
	 IfnEFrMcmGkjwTFercnzex8ae32z9L4RSg60705Zqi63/jNgpO/fPALDtYT/wmllPaVYL
	 Bvuj1YDD30cRt0ySieGvYOogwuu2V4YiXoWgfd9uxUGUInGCJFnDbO0uQXrAsaXaoDQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795656828;
	h=X-Original-To:Received:Received:DKIM-Signature:From:To:Cc:Subject:
	 Date:Message-ID:X-Mailer:In-Reply-To:References:X-Mailing-List:
	 List-Id:List-Post:List-Help:List-Subscribe:List-Unsubscribe:
	 List-Owner:Precedence:MIME-Version:Content-Transfer-Encoding;
	bh=eROQXAitMwlUKrlvTmxWuJSOdzqhAnG4G6zvGu/Wb3k=;
	b=umJoGp9FlOMpoFESablDoDfGszWaWNCiJMOjQyLDLfXKHv0Suy71SA11Ad9s0/HJgz2C
	 DHAAANAkcocCw460SwxsqC4OruQ3qVhJJYzrsH3yOQUBiAYn3TCguPMo3ljm9+dI9xB4G
	 +a82+a6FGPiTXG3HWm6WY9Fsa+MLP5TRxzopke854SKe3mI1QUA75MV7DfghDxM4ppjVl
	 AfXWzrTT7mEi8gReKjkQHD2v1UwseJFew3dqCphz7dyMIvmNN0yVUuyC8WKodhTg/22/n
	 X83110ZZh8UHUE5mttZLqUZ42jI7FBklMsB/SlZ3PIoMcEeNsvi5QS2MtNO0xJuvSlw==
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=kcO69hlu;
	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 CF164606A32A;
	Thu, 26 Nov 2026 01:33: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=kcO69hlu
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=1795656828;
	b=qepvtMVDYIQoTk6onDV/DCO8FSxZogwXW5y/sV/NnhfqxyjRyuAt/s9h7vlHWCGxwfwq
	 jVIxUnEPuptYiDgQoNNququVWPne5eIiHmGji6DMl5ZfpAyyrVXC41nwkoaFNdcmA98C4
	 UXv/sKiA7NtBigE66LF++SlkJyjPTpUr6+eWPTuoAYoZHqR9RcWWABX3LeHEz9Bgkp6ti
	 0ntdnC88t2rRaAaMefkvWytfD5gp8QnoLPnt0sAZSjwE+SpdzTGFfs8wc8/WHUlQNhUsv
	 8RCKIBz7bTncOEtGDDlzstNWlRkgsGzOMVZY+H7N680tMA2eZQw/C6frtWnnuI1yUgg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795656828;
	h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer:
	 In-Reply-To:References:MIME-Version:Content-Transfer-Encoding;
	bh=eROQXAitMwlUKrlvTmxWuJSOdzqhAnG4G6zvGu/Wb3k=;
	b=H+r/S/BzzhrnoW8v1fiGNa/E1sfjFtQ5MxSxU2oRuHlovZJjytEK8TXd1/tK7Ya6wSyD
	 Jc3SEeTF/HbiRhVuJYpVeiAYHlf2++k49nwgrtF9SOOnO7525IPiC/8HyAjirqzvzEgiO
	 BJj/obyRChV1YOKkH1CbJcnvp1MrYX88dRrF35Py+CLkCTsN/57jzdrI98XYkI5m55pS6
	 wJZr7WwopGCEQQTiNkSFX860alqwlA8HxeM6dFzpP8CxVP2IVKwgCbd2E91858cqUaGTb
	 AMt4RMoJLNclTiss0ZzQhfnjxnkarCq+VhY4isvElW6EKgmalKXTcfUYB15APlxV3Gg==
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=kcO69hlu;
	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 F091B606A338
	for <netdev@vger.kernel.org>; Thu, 26 Nov 2026 01:33:47 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 189521F000D2;
	Thu, 26 Nov 2026 01:33:47 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1795656827;
	bh=eROQXAitMwlUKrlvTmxWuJSOdzqhAnG4G6zvGu/Wb3k=;
	h=From:To:Cc:Subject:Date:In-Reply-To:References;
	b=kcO69hluBN09refb6uN01/F0JDYIyFKR1ILcHI6pxaw9IEiuCEg18++V0xYEyURfw
	 ScG6lhGUt8DZVE/cAXcwqM+Jl/j4nYysRcPoQ4U9MAT7A4tSsdX0QCrIB/lPgFpSSj
	 7VSPLvcpvu+lU5BFiKdvAXI1nz+BMmVJEkVmqGqdbuZWf+5YFBID66GmUTyZiwXFc7
	 jCm88oTTuShmXW7YLMDfGZQgYY3hSRFMRQX7+7U+kLsLuVkavruTLXnG+yhAv/2nep
	 a4kF94LOBG7Hqt/RyHPZClY3aaG+S/UutySZZzTHc59oweweVJkQS4hOIEnlER3jVX
	 Fa2vuKgOO4t/Q==
X-Cc: dsahern@kernel.org,
	idosch@nvidia.com,
	davem@davemloft.net,
	edumazet@kernel.org,
	kuba@kernel.org,
	pabeni@redhat.com,
	horms@kernel.org,
	ralf@mandelbit.com,
	ja@ssi.bg,
	David Ahern <dahern@nvidia.com>
X-Mailer: git-send-email 2.54.0
X-In-Reply-To: <cover.1795642432.git.dahern@nvidia.com>
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