mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-06 06:37:59 +00:00
fib: add rtnl locking in ip_fib_net_exit
Daniel J Blueman reported a lockdep splat in trie_firstleaf(), caused by RTNL being not locked before a call to fib_table_flush() Reported-by: Daniel J Blueman <daniel.blueman@gmail.com> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
c031235b39
commit
e2666f8495
1 changed files with 2 additions and 0 deletions
|
@ -1068,6 +1068,7 @@ static void ip_fib_net_exit(struct net *net)
|
||||||
fib4_rules_exit(net);
|
fib4_rules_exit(net);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
rtnl_lock();
|
||||||
for (i = 0; i < FIB_TABLE_HASHSZ; i++) {
|
for (i = 0; i < FIB_TABLE_HASHSZ; i++) {
|
||||||
struct fib_table *tb;
|
struct fib_table *tb;
|
||||||
struct hlist_head *head;
|
struct hlist_head *head;
|
||||||
|
@ -1080,6 +1081,7 @@ static void ip_fib_net_exit(struct net *net)
|
||||||
fib_free_table(tb);
|
fib_free_table(tb);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
rtnl_unlock();
|
||||||
kfree(net->ipv4.fib_table_hash);
|
kfree(net->ipv4.fib_table_hash);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue