Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ipmr: Call fib_rules_unregister() without RTNL.

fib_rules_unregister() removes ops from net->rules_ops under
spinlock, calls ops->delete() for each rule, and frees the ops.

ipmr_rules_ops_template does not have ->delete(), and any
operation does not require RTNL there.

Let's move fib_rules_unregister() from ipmr_rules_exit_rtnl()
to ipmr_net_exit().

Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20260228221800.1082070-12-kuniyu@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Kuniyuki Iwashima and committed by
Jakub Kicinski
478c2add 4a11adcd

+11 -2
+11 -2
net/ipv4/ipmr.c
··· 282 282 return err; 283 283 } 284 284 285 + static void __net_exit ipmr_rules_exit(struct net *net) 286 + { 287 + fib_rules_unregister(net->ipv4.mr_rules_ops); 288 + } 289 + 285 290 static void __net_exit ipmr_rules_exit_rtnl(struct net *net, 286 291 struct list_head *dev_kill_list) 287 292 { ··· 296 291 list_del(&mrt->list); 297 292 ipmr_free_table(mrt, dev_kill_list); 298 293 } 299 - 300 - fib_rules_unregister(net->ipv4.mr_rules_ops); 301 294 } 302 295 303 296 static int ipmr_rules_dump(struct net *net, struct notifier_block *nb, ··· 349 346 return PTR_ERR(mrt); 350 347 net->ipv4.mrt = mrt; 351 348 return 0; 349 + } 350 + 351 + static void __net_exit ipmr_rules_exit(struct net *net) 352 + { 352 353 } 353 354 354 355 static void __net_exit ipmr_rules_exit_rtnl(struct net *net, ··· 3293 3286 remove_proc_entry("ip_mr_vif", net->proc_net); 3294 3287 proc_vif_fail: 3295 3288 ipmr_rules_exit_rtnl(net, &dev_kill_list); 3289 + ipmr_rules_exit(net); 3296 3290 #endif 3297 3291 ipmr_rules_fail: 3298 3292 ipmr_notifier_exit(net); ··· 3307 3299 remove_proc_entry("ip_mr_cache", net->proc_net); 3308 3300 remove_proc_entry("ip_mr_vif", net->proc_net); 3309 3301 #endif 3302 + ipmr_rules_exit(net); 3310 3303 ipmr_notifier_exit(net); 3311 3304 } 3312 3305