🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #25403

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

#25403
From: David Ahern
Date: Tue, 01 Dec 2026 17:40
48 lines
9649 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 c41c5ca23fe1..31ebcf665216 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: <20261201174021.7211-3-dsahern@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-375254-linux-kernel-netdev=dewy.ru
References: <20261201174021.7211-1-dsahern@kernel.org>

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-375254-linux-kernel-netdev=dewy.ru
From: dsahern@kernel.org (David Ahern)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net-next v3 02/13] ipv6: keep a superseded pcpu dst working until its holders notice
Date: Tue,  1 Dec 2026 10:40:03 -0700
Organization: Usenet Network
Message-ID: <20261201174021.7211-3-dsahern@kernel.org>
References: <20261201174021.7211-1-dsahern@kernel.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="1781350"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:wpbbqW6glUTl+bb7GE8PAoYQppM= sha256:Fi3++qAevA3d5f2l6efiOtNOgR+1g6+80nfgk6CHQdU=
	sha1:OUcJoHFpRpVJGmT+dAYcFJFMEEg= sha256:Nidy9sYOafv1pVJzKNlTpezv8oFNYH32ahB3UapdJQw=
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 BCBF611741B; Tue,  1 Dec 2026 20:49:08 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.501
X-Spam-Status: No, score=-3.501 tagged_above=-9999 required=6.31
	tests=[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 p4z9qKp4wPC0;
	Tue,  1 Dec 2026 20:49:01 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-375254-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 sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
	by mail.dewy.ru (Postfix) with ESMTPS id 6A38A117408; Tue,  1 Dec 2026 20:48:55 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sto.lore.kernel.org (Postfix) with ESMTP id 420A1602AFC; Tue,  1 Dec 2026 17:41:04 +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=1796146859;
	b=Q/7kM9gjnpJVBBcPGKTzB5fD+BXz2aKly5mNYWtmbWLC+mOVWSP0GxVCQIgEa4IziM4C
	 iQVjjU3trHOE4GIlAS+0watLSiuMJrZhQt4PfcQO+4RH2vS7dElWmTt+IZuD+SuoCNqIt
	 Czj/ctGL+uOy840AOeFtVfntUZP4phijqOZ2sYlyQcOFm/gyuqRNjRRUY599L1IQQUViY
	 WKiRn53PSrOwe1D2DBWqdNWxHkiNYpvWE16kLFUfiDfGeZ4e2d4r1NJDhFZdbJ0rpBEAQ
	 EafLZDxJK1/Vo65sSL0FSN8sAr8+P6Y0aPQXaeBwNfKxPlbPRtpZ5tMdjS5+jozmVXw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796146859;
	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=7k6PgRKj+PxDTrpbxFovMn++qq63Ge2kNiy2Y1bIOVs=;
	b=u68gzQEPh3XTV9A6NPpW369WtzUa/auRXbReYE4TC9sF+mPXTOOWW10KYbHIAYosucOp
	 oKho/MOVCtWqvzPdYXBB7yoB+0lB5r6koceaKkTNQ/ZeZP5Evq4NcVX+hBcOyaCiukcmX
	 /mCVOc3/PBwfxl1GhyLW0ViinPeNlgntJojQiJMF38c+9QQ1yA2d39vo6DCxSFVLUPfOc
	 rD1RHeNTb8amQkhdwM3czEqZDcTMO8ZcLqezOQrTbolRbTiiqW/utQrYTGJsDrMXQZGw9
	 SAy9PdK2x876qwTliO29Qvv/PJv8Nis5MnjYXwVIPUtNbkQlZAwJK0IyhEwq1bs47hQ==
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="Q/fAnug9";
	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 9381A606A681;
	Tue,  1 Dec 2026 17:40:59 +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=Q/fAnug9
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=1796146858;
	b=um7nUrN65Demwkpu6TKlUK7mEIA+/7BsA1bpcNtU0uPt8FN3uvOVG3kyC9P2aKn4Lcys
	 ALuQh+fFs1f5/M26u0zpVm2S9EblGYWerCbtLBnWU0+NMeuCWZewtpPn4mVNGjdWRmz+P
	 u+wQroyLz4lFmN+WI3NeWvbxc3lCuiTZDUcVIpfrGFaS14tQ9NwNvXtZi5D8MfAmf71uF
	 JdwMSpcaikfeN9aGoaWQOjL4RS2kZLyXAInG9ODXRnjkPaWTd/Kg7iQd5YrYCl0YhMwtB
	 UTnFBJy8UvEbsIIY7POzdfrTMldeWUf5QfNvCgn0dfftOCayB+NHIqFL18kUlujSuhw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796146858;
	h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer:
	 In-Reply-To:References:MIME-Version:Content-Transfer-Encoding;
	bh=7k6PgRKj+PxDTrpbxFovMn++qq63Ge2kNiy2Y1bIOVs=;
	b=47l4X7Fa0s7hixXWjFXkoQBppIiHJ1T9CklpencJM5JCMpyomAC49/Cs95Y5VRhYLxRY
	 vlhTqbCbcGvzVwVjrY45/ghVkWzVlH6E2/Txnim2rCMmsrI9k7I9Woi6D+nm5wZka80pv
	 9b4iA4HWLcdYQ95EF0okG68CqumoayuGMFVSgNCSDKtvdSN6LmCFHqJ/pqzL5LtWbS1O0
	 2m157Pb06Q5U+CItmknUogjfQ7OP9orjD14NXESSg4a2/0/YcdZtvf4TH2D2y3fl/X4LF
	 kjqdSJyPS8BDQJmtIBD9DAUN6woqlYMTJXbUd8y1ShvpH8SUoMPYWdPslJEFFE/a1Xw==
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="Q/fAnug9";
	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 B11A1606A32F
	for <netdev@vger.kernel.org>; Tue,  1 Dec 2026 17:40:58 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 230941F00893;
	Tue,  1 Dec 2026 17:40:58 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1796146858;
	bh=7k6PgRKj+PxDTrpbxFovMn++qq63Ge2kNiy2Y1bIOVs=;
	h=From:To:Cc:Subject:Date:In-Reply-To:References;
	b=Q/fAnug9FEy8oHn6LOBFJsYDInodBw0cfH7mLVVRV9kjhJxnHUgHqwQm4A5eWIQil
	 0ooVTaC1o9lwRCLRXEXC1mD6F+LCYwtXhtvYBD6ge8W9RgPVYxoSX8+FkUriiljyvV
	 yO+EC4wDZurQ8BmzQlKmeBSrpOmr1E3/X5qIuFU3VlVYJFlRTNEoijz6cU0PsUudLQ
	 65ZUXSmCeDL70cuOvj10Z0KzRx3bRtel6RWk9ag7uhvMwP1u+AyqSI8hs6SF3mce8P
	 srL+BEgAl5IkDyLGemMw4pCaUeQpei3jzJz3AEHbUt7JUoqOjiNxlzrEmev7AH9WWe
	 9OUEekaPCvqIQ==
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: <20261201174021.7211-1-dsahern@kernel.org>
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