From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=195.10.208.50 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796316942; b=zefajpVVW8/LWW8iFGvwGH6DIXndxqoJYRKF2xapK6PsJovdHHRE//TJHBZrWq3BXwc1 +FLwSwCUSguek+f4vXxAuN0ag9lwne8b/HrRkWU41cpYFgthGy6S94Kb4WUITQTMfhmYO D8C4t9/uFF9BGi/GO86pd9p8gYWUupIn3ypUKmhTubxL+0nqo8eE65s7go/sE/wPgsUot 7xH1P9qPyNZy21P86MQVL/xMhCamPmqWSbemWlT7LHYfTXA4ujFC7o/Fsv2pLZiNLn1DR +ZKfapfqUsJx73JL2G/BDEEHuvBhFv0IigMsu066l+4OFKuITCQdKton5r4tzw/5fuQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796316942; 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=ej34cbr8tOrEnhqQGeE6WcxCxpWat2FcFjmtTxNMl+s=; b=YJPE6EVz1idBkMrPXxiBbpfVDBm43dH0LYfVoXYPy6cBuF8xB9qQUl+ESFBzkzF7vD6u vvwcpprIc7eKcP+GcWWqA8u8L4GLQ4E/Q8N0J+CuyQ141yw0MxJIyxlMGAYwvt2/dAJYO O5WEhyTR9PK32BNaDm99IvJPyejtzdq+W5fRMrLY1qG+flTveO0/AMyHwLzjoAyCB7tsK Q0YnpdZuBe+nBO3PHcme1cSgQ3zW3HwREGKdpKPhjt4lAQGsc1sVGZGwdMEKtj627A8kZ Uc7w1hyev79ZenJoTeiAJlp+qtarvelISaLEYOruY+uo09DwiEzxIEwmq3mV6Ab/DYg== 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=igo75IqH; arc=none smtp.remote-ip=195.10.208.50 Received: from mout-b-105.mailbox.org (mout-b-105.mailbox.org [195.10.208.50]) (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 8B50B606A322 for ; Thu, 3 Dec 2026 16:55:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 8B50B606A322 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=igo75IqH Received: from smtp102.mailbox.org (smtp102.mailbox.org [IPv6:2001:67c:2050:b231:465::102]) (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-105.mailbox.org (Postfix) with ESMTPS id 4jgLNS1PCXz9tmd; Thu, 03 Dec 2026 17:55:36 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandelbit.com; s=MBO0001; t=1796316936; 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=ej34cbr8tOrEnhqQGeE6WcxCxpWat2FcFjmtTxNMl+s=; b=igo75IqHgvIRzNZnklweDVTyhVWGoOGPJHQKjKxarQSOglyK/haNdiJ0eJ6r3LvmaR1+1W +rwTBGw0hyYg8CJ5Bga95xGbXVWFzzgVc9ItMhq3t2JW8wGfuX3xfM4V4fKWL8TPePkPsx oS7H9iY0MmphCXfteRf1kK9bvS0z5QChpvfOanS0eH+aBaGMuMaqe+Om46mryLCbTOnx4h LX+9eXZArUIg21NKDlnhKvfsgYMh7HmcCCZ7vcjN8FeYnYuGAOjQUpvRkjWyS3cjdaLT62 oCqnufpyNzb5nKIqSDQIOmk1qCxxDE1DPvufcrd4ovrl2h3xo/IyWX5B4xC5fA== Authentication-Results: outgoing_mbo_mout; dkim=none; spf=pass (outgoing_mbo_mout: domain of ralf@mandelbit.com designates 2001:67c:2050:b231:465::102 as permitted sender) smtp.mailfrom=ralf@mandelbit.com From: Ralf Lici To: Ido Schimmel Cc: David Ahern , netdev@vger.kernel.org, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, horms@kernel.org, ja@ssi.bg Subject: Re: [PATCH net-next v3 00/13] ipv6: validate cached dsts against the netns route generation Date: Thu, 3 Dec 2026 17:55:28 +0100 Message-ID: <20261203165528.848776-1-ralf@mandelbit.com> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261203153447.GA3201592@shredder> References: <20261201174021.7211-1-dsahern@kernel.org> <20261203153447.GA3201592@shredder> 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 X-Rspamd-Queue-Id: 4jgLNS1PCXz9tmd On Thu, 03 Dec 2026 17:34:47 +0200, Ido Schimmel wrote: > So, I think Ralf's v5 [1] is a better approach and also easier to > review: Keep the per-node validation for inline nexthops and per-netns > validation for nexthop objects. > Thanks Ido for the review, and thanks David. I'll respin my series with your comments addressed. > A few comments on his series: > > 1. "ipv6: stamp the default route node with a fresh serial on link > failure" is not strictly related to the other patches and should be > submitted separately and without a Fixes: tag given this is not a > regression. Will do, ahead of the series, since the ordered comparison below relies on node serials never going backwards. I'll also drop 2/4, which was merged in net in the meantime. > > 2. Invalidating live per-CPU dst entries by calling dst_dev_put() > introduces the same problem that was fixed in IPv4 by commit > 5018c59607a5 ("ipv4: fix race condition between route lookup and > invalidation") and commit ae89f2724db1 ("ipv4: route: don't blackhole > in-use routes when retiring fnhe routes"). > > Better to move these dst entries to the uncached list, which requires > handling [2] first. > Agreed. I tried putting replaced pcpu dsts on the uncached list before posting v5 and dropped it because of the ownership problem you describe in [2]. I'll start the series with the change you suggest there, basing the ownership on RT6_LOOKUP_F_DST_NOREF. > 3. In patch 3, stamping a dst entry with 0 due to a mismatch in the > per-netns counter is too coarse. Any FIB change in the netns (e.g., a > route inserted into a different table) causes the lookup to replace a > valid per-CPU dst entry whose route did not change. > > We can sample the per-netns counter before the lookup and use it to > stamp new dst entries. A dst entry is then valid as long as its serial > number is equal or newer than the node's serial number, and the per-CPU > dst entry is only replaced when it is no longer valid. This also avoids > the second read of the counter. > Agreed. I considered stamping with the generation sampled before the lookup in the RFC [3], but validated by equality to avoid a wrap-aware comparison. The ordered comparison is simpler. [3] https://lore.kernel.org/netdev/20260901122501.482920-1-ralf@mandelbit.com/ Thanks! -- Ralf Lici Mandelbit Srl