Re: [PATCH 6.12 189/220] ipv4: start using dst_dev_rcu()

Sasha Levin <[email protected]>
Newsgroups dev.linux.lists.patches,org.kernel.vger.stable
Message-ID <[email protected]>
On Fri, Aug 21, 2026 at 11:45:50AM +0200, Miguel Gazquez wrote:
> > +	dev = skb->dev ? : skb_dst_dev_rcu(skb);
> > +	vif = l3mdev_master_ifindex_rcu(dev);
>
> Here, the upstream version has a `rcu_read_lock();` that I think should
> be added. I will send an updated version.

Agreed, and confirmed here. Upstream that hunk lands after the
rcu_read_lock() introduced by ca0359df45a5 ("inet: frags: save a pair of
atomic operations in reassembly", v6.15), which isn't in 6.12 - so as
backported, ip_defrag() reaches skb_dst_dev_rcu() -> dst_dev_rcu() ->
rcu_dereference() with no RCU read-side critical section of its own,
where the pre-patch 6.12 code used skb_dst_dev() -> READ_ONCE() and had
no such requirement.

In practice every in-tree ip_defrag() caller already runs under RCU
(netfilter hooks or the NAPI receive path), so this is a lockdep /
correctness defect rather than a guaranteed CONFIG_PROVE_RCU splat, but
it does defeat the point of the conversion.

Dropped from the 6.12 queue, thanks - please do send the v2.

-- 
Thanks,
Sasha
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.