From: Kuniyuki Iwashima Date: Fri, 12 Jun 2026 06:32:05 +0000 (+0000) Subject: ipv4: fib: Call fib_proc_exit() and nl_fib_lookup_exit() at ->pre_exit(). X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c993bd0102aac43deea38f72fc1e909030b1c6ed;p=thirdparty%2Flinux.git ipv4: fib: Call fib_proc_exit() and nl_fib_lookup_exit() at ->pre_exit(). We will call ip_fib_net_exit() from ->exit_rtnl(). Since the exit callbacks are called in the following order, 1. ->pre_exit() ~~~ synchronize_rcu() ~~~ 2. ->exit_rtnl() : ip_fib_net_exit() 3. ->exit() : fib_proc_exit() / nl_fib_lookup_exit() 4. ->exit_batch() : fib4_semantics_exit() the reverse order of fib_net_init() would get messed up. Let's move fib_proc_exit() and nl_fib_lookup_exit() to ->pre_exit(). This is fine because procfs/netlink access from userspace cannot occur at this point and synchronize_rcu() is not needed. Signed-off-by: Kuniyuki Iwashima Reviewed-by: Ido Schimmel Reviewed-by: Eric Dumazet Link: https://patch.msgid.link/20260612063225.455191-3-kuniyu@google.com Signed-off-by: Jakub Kicinski --- diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c index ceeb87b13b93a..3b1bd53c7357f 100644 --- a/net/ipv4/fib_frontend.c +++ b/net/ipv4/fib_frontend.c @@ -1656,7 +1656,7 @@ out_semantics: goto out; } -static void __net_exit fib_net_exit(struct net *net) +static void __net_exit fib_net_pre_exit(struct net *net) { fib_proc_exit(net); nl_fib_lookup_exit(net); @@ -1680,7 +1680,7 @@ static void __net_exit fib_net_exit_batch(struct list_head *net_list) static struct pernet_operations fib_net_ops = { .init = fib_net_init, - .exit = fib_net_exit, + .pre_exit = fib_net_pre_exit, .exit_batch = fib_net_exit_batch, };