ip6_dst_neigh_lookup() can be called without an RCU read lock. One such caller is irdma_addr_resolve_neigh_ipv6(), after its route lookup. The callback loads the egress device with dst_dev() and passes the pointer to __ip6_dst_neigh_lookup(). On a neighbour-cache miss, that helper calls ipv6_neigh_create(), which dereferences the device and can invoke its operations. Concurrent route teardown can replace dst->dev with blackhole_netdev, drop the route's reference to the old net_device, and free it while the lookup is still using the pointer. Hold the RCU read lock across the lookup and use dst_dev_rcu() to load the device, matching the protection in ipv4_dst_neigh_lookup(). Ido Schimmel identified this unprotected callback during review. The lifetime and non-RCU caller were validated by source inspection; this path has not been triggered independently at runtime. Fixes: 9514528d92d4 ("ipv6: call dst_dev_put() properly") Cc: stable@vger.kernel.org Suggested-by: Ido Schimmel Link: https://lore.kernel.org/netdev/20261125190113.GA421469@shredder/ Signed-off-by: Zhou Qiuyue --- net/ipv6/route.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 6bdd4423c..a9f197bf5 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -249,9 +249,16 @@ static struct neighbour *ip6_dst_neigh_lookup(const struct dst_entry *dst, const void *daddr) { const struct rt6_info *rt = dst_rt6_info(dst); + struct net_device *dev; + struct neighbour *n; + + rcu_read_lock(); + dev = dst_dev_rcu(dst); + n = __ip6_dst_neigh_lookup(rt6_nexthop(rt, &in6addr_any), + dev, skb, daddr); + rcu_read_unlock(); - return __ip6_dst_neigh_lookup(rt6_nexthop(rt, &in6addr_any), - dst_dev(dst), skb, daddr); + return n; } static void ip6_confirm_neigh(const struct dst_entry *dst, const void *daddr) -- 2.56.1.windows.1