Skip to content

Commit e2666f8

Browse files
Eric Dumazetdavem330
authored andcommitted
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 <[email protected]> Signed-off-by: Eric Dumazet <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent c031235 commit e2666f8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

net/ipv4/fib_frontend.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,6 +1068,7 @@ static void ip_fib_net_exit(struct net *net)
10681068
fib4_rules_exit(net);
10691069
#endif
10701070

1071+
rtnl_lock();
10711072
for (i = 0; i < FIB_TABLE_HASHSZ; i++) {
10721073
struct fib_table *tb;
10731074
struct hlist_head *head;
@@ -1080,6 +1081,7 @@ static void ip_fib_net_exit(struct net *net)
10801081
fib_free_table(tb);
10811082
}
10821083
}
1084+
rtnl_unlock();
10831085
kfree(net->ipv4.fib_table_hash);
10841086
}
10851087

0 commit comments

Comments
 (0)