Re: [PATCH net 1/2] nexthop: take nh->lock for f6i_list walks in replace check and notify
From: patchwork-bot+netdevbpf
Date: Fri Jul 24 2026 - 18:12:50 EST
Hello:
This series was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@xxxxxxxxxx>:
On Wed, 22 Jul 2026 00:29:50 +0000 you wrote:
> fib6_check_nh_list() and __nexthop_replace_notify() walk nh->f6i_list
> during an RTNL-serialized nexthop replace without holding nh->lock. IPv6
> RTM_NEWROUTE/RTM_DELROUTE run without RTNL and mutate that list under
> nh->lock (fib6_add_rt2node_nh(), fib6_purge_rt()), so both walks race a
> concurrent route delete that unlinks and frees a fib6_info:
>
> BUG: KASAN: slab-use-after-free in rt6_fill_node.isra.0 (net/ipv6/route.c:5799)
> Read of size 4 at addr ffff888014607e64 by task exploit/143
> rt6_fill_node.isra.0 (net/ipv6/route.c:5799)
> fib6_rt_update (net/ipv6/route.c:6412)
> __nexthop_replace_notify (net/ipv4/nexthop.c:2542)
> rtm_new_nexthop (net/ipv4/nexthop.c:2554)
> rtnetlink_rcv_msg (net/core/rtnetlink.c:7076)
>
> [...]
Here is the summary with links:
- [net,1/2] nexthop: take nh->lock for f6i_list walks in replace check and notify
https://git.kernel.org/netdev/net/c/072cd1f21819
- [net,2/2] nexthop: avoid unlocked f6i_list walk in nh_rt_cache_flush
https://git.kernel.org/netdev/net/c/4787a6d2629b
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html