ipv6: Change allocation flags to match rcu_read_lock section requirements
Subsystems (3)
PATCH 1/1 ipv6: Change allocation flags to match rcu_read_lock section requirements
Since the call to __ip6_del_rt_siblings has been converted under rcu read lock and it only has one call point
we should no longer block or yield.
Our stack trace from the syzbot reproducer looks as follows:
__ip6_del_rt_siblings
rtnl_notify (Here we pass gfp_any() -> GFP_KERNEL)
nlmsg_notify
nlmsg_multicast
nlmsg_multicast_filtered
netlink_broadcast_filtered (GFP_KERNEL passed from earlier)
netlink_broadcast_filtered can yield if GFP_KERNEL is passed, which we do not want to happen.
Fix this by changing the allocation flag of rtnl_notify.
Also change the flag passed to nlmsg_new. Even though it is not related to the syzbot generated bug it still falls under the same requirements.
--- net/ipv6/route.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/ipv6/route.c +2 -2
@@ -4022,7 +4022,7 @@ static int __ip6_del_rt_siblings(struct fib6_info *rt, struct fib6_config *cfg)struct fib6_node *fn;/* prefer to send a single notification with all hops */ - skb =nlmsg_new (rt6_nlmsg_size (rt),gfp_any ()); + skb =nlmsg_new (rt6_nlmsg_size (rt),GFP_ATOMIC );if (skb) {u32 seq = info->nlh ? info->nlh->nlmsg_seq :0 ;
@@ -4078,7 +4078,7 @@ static int __ip6_del_rt_siblings(struct fib6_info *rt, struct fib6_config *cfg)if (skb) {rtnl_notify (skb, net, info->portid,RTNLGRP_IPV6_ROUTE , - info->nlh,gfp_any ()); + info->nlh,GFP_ATOMIC ); }return err; }
Signature · 1 line
2.54.0
Quoted 13 lines · Nikola Z. Ivanov
Since the call to
__ip6_del_rt_siblingshas been converted under rcu read lock and it only has one call point
we should no longer block or yield.Our stack trace from the syzbot reproducer looks as follows:
__ip6_del_rt_siblings
rtnl_notify(Here we passgfp_any()->GFP_KERNEL)
nlmsg_notify
nlmsg_multicast
nlmsg_multicast_filtered
netlink_broadcast_filtered(GFP_KERNELpassed from earlier)
Quoted 8 lines
netlink_broadcast_filteredcan yield ifGFP_KERNELis passed, which we do not want to happen.Fix this by changing the allocation flag of
rtnl_notify.Also change the flag passed to
nlmsg_new. Even though it is not related to the syzbot generated bug it still falls under the same requirements.
I believe that the nlmsg_new() change is a no-op given that gfp_any() evaluates to GFP_ATOMIC under spin_lock_bh(), but it makes __ip6_del_rt_siblings() consistent with inet6_rt_notify() which already uses GFP_ATOMIC for both nlmsg_new() and rtnl_notify().
Quoted 5 lines
Reported-by [email protected]Fixes bd11ff421d36 ("ipv6: Get rid of RTNL for SIOCDELRT and RTM_DELROUTE.")Signed-off-by Nikola Z. Ivanov <[email protected]>
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:
Quoted 6 lines · On Sun, 19 Jul 2026 13:57:59 +0300 you wrote:
Since the call to
__ip6_del_rt_siblingshas been converted under rcu read lock and it only has one call point
we should no longer block or yield.Our stack trace from the syzbot reproducer looks as follows:
Quoted 8 lines
__ip6_del_rt_siblings
rtnl_notify(Here we passgfp_any()->GFP_KERNEL)
nlmsg_notify
nlmsg_multicast
nlmsg_multicast_filtered
netlink_broadcast_filtered(GFP_KERNELpassed from earlier)[...]
Here is the summary with links:
- [net] ipv6: Change allocation flags to match rcu_read_lock section requirements
https://git.kernel.org/netdev/net/c/313a123e1fca
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html