Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=195.10.208.40 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796383793; b=NUqLyacIj/me+xwNODjIdJt//GwpOMxZz8jNU7ZInUT6KHL9HMhhgSP3zM6eVXGA4EpH C+OO11f/mvTE0kA+4o6g5yxV7PFwePT8DDyBpq/PkO7HkdxPcEGTIfS4knGCHfeFk5eKG Cg6zwowj38NC28OK/YpoxXFAmWsL45Digax/BgpekJ1tgwuEoovJFysa9nuSZZMf/g2s+ PvunA4f29Li3swcrzO8Sz5CyqlKfBan3SCwvEL3o7daFX4FWLUzZg8jNXTy3TvHGwrAbq svRd7CFqAiTAARIq3xtZ2QJ77Si+LjPmE16TgCmmaDVyla3VWqznberG2m1HiOgI0/g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796383793; h=DMARC-Filter:Received:DKIM-Signature:From:To:Cc:Subject:Date: Message-ID:X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding:X-Rspamd-Queue-Id; bh=C9xq2XUPUQAnEfPhKzRjdxEmqc5wShkVIz+yyGgSDYM=; b=C61BSvP84GafN9KfDeCKc8r9WHLdSL/QoQ4hOV8L3/QBP8BuOhTLDE1pnMTuJZFTpg4q nongjM4+ypt+A++/8V6ftAJjgM1y7eFyq4ky1sU4hQvqzmxH7sb+hTWaH375F68a9TGOG asPodl3AT0EDkc1jXr4HUPJdEq6OCKLBXo6voqt9SszX83k+JOJanSz8ZRsl1JxqPSHS4 Nvc+OIbsXzt2IwmoRI7x13ncAlRpa3p0STy0N8Uj3XHS9jjfiFZLeWwHh2IuQXpcMbp9X 8TAzrBj7Iu22OjIpv4vOfoa2blwv7yTrUieLm0QqO5ZsDSxoM8tD7RItnFs/boZf6pw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none header.from=mandelbit.com; spf=pass smtp.mailfrom=mandelbit.com; dkim=pass header.d=mandelbit.com header.i=@mandelbit.com header.a=rsa-sha256 header.s=MBO0001 header.b=J9c1Eg0m; arc=none smtp.remote-ip=195.10.208.40 Received: from mout-b-210.mailbox.org (mout-b-210.mailbox.org [195.10.208.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6BDEC606A32D; Fri, 4 Dec 2026 11:29:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 6BDEC606A32D Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=mandelbit.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mandelbit.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=mandelbit.com header.i=@mandelbit.com header.a=rsa-sha256 header.s=MBO0001 header.b=J9c1Eg0m Received: from smtp1.mailbox.org (smtp1.mailbox.org [IPv6:2001:67c:2050:b231:465::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519MLKEM768 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-b-210.mailbox.org (Postfix) with ESMTPS id 4jgq5y70LvzFr26; Fri, 04 Dec 2026 12:29:42 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandelbit.com; s=MBO0001; t=1796383783; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=C9xq2XUPUQAnEfPhKzRjdxEmqc5wShkVIz+yyGgSDYM=; b=J9c1Eg0m30u348T5SEHRcy3BBadC8jiQlOnbunC1EmyaTUCwMe1vPmw12+ovN4i7ZlOORD PgHMC5Uff6lQG8t2QxFYkZcAxDiLaAEbcujAIk+J7no+VXEKVeFCtw8IwvHR2AFzpy/DYB JYT62nRUdJ+mAeZ/ZWApOkvVlboWnY1tRxzMvNPuPrYqsgyTpqMDrhpPv9cEHZG5pSQkWq pkJW1nRFOBycbo95f3Mk3gMLa2VjEvnb7B5ourgBrayXVEFliGPr6rcIXbLl44/iL64r1P x+Q6XTdFjvAf4VbddW3/C0ZlwT+N2Hn9FYCLtE8Hl9HfdonwiG8LupX8M4dZng== Authentication-Results: outgoing_mbo_mout; dkim=none; spf=pass (outgoing_mbo_mout: domain of ralf@mandelbit.com designates 2001:67c:2050:b231:465::1 as permitted sender) smtp.mailfrom=ralf@mandelbit.com From: Ralf Lici To: netdev@vger.kernel.org Cc: David Ahern , Ido Schimmel , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Willem de Bruijn , Simon Horman , linux-kernel@vger.kernel.org, David Ahern , Andrea Mayer , Antonio Quartulli Subject: [PATCH net-next 2/2] ipv6: keep a superseded pcpu dst working until its holders notice Date: Fri, 4 Dec 2026 12:29:28 +0100 Message-ID: X-Mailer: git-send-email 2.56.1 In-Reply-To: References: X-Mailing-List: linux-kernel@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 X-Rspamd-Queue-Id: 4jgq5y70LvzFr26 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. Drop the slot's reference after a grace period too. A lookup with RT6_LOOKUP_F_DST_NOREF may have taken the dst from the slot without a reference, and when the only other reference is the child reference of an xfrm bundle, dst_destroy releases it with dst_release_immediate and frees the dst under that lookup. A later change to dst validation replaces the per-CPU dsts of all routes the same way. Reported-by: Ralf Lici Closes: https://lore.kernel.org/netdev/20261124204623.45969-1-ralf@mandelbit.com/ Signed-off-by: David Ahern Link: https://lore.kernel.org/netdev/20261201174021.7211-3-dsahern@kernel.org/ [ralf: drop the slot's reference after a grace period, drop the comment and the Fixes tag] Signed-off-by: Ralf Lici --- net/ipv6/route.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 39bcfa1ce01b..df4d670bcfa6 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -1499,8 +1499,8 @@ 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); - dst_release(&prev->dst); + rt6_uncached_list_add(prev); + rt6_dst_release_deferred(prev); } pcpu_rt = NULL; -- 2.56.1