Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 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== 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== 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 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 ; Tue, 1 Dec 2026 17:40:58 +0000 (UTC) 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 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 230941F00893; Tue, 1 Dec 2026 17:40:58 +0000 (UTC) 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== From: David Ahern To: netdev@vger.kernel.org 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 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 Message-ID: <20261201174021.7211-3-dsahern@kernel.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20261201174021.7211-1-dsahern@kernel.org> References: <20261201174021.7211-1-dsahern@kernel.org> X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: David Ahern 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 Signed-off-by: David Ahern --- 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)