aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2011-03-30 19:57:46 -0400
committerDavid S. Miller <davem@davemloft.net>2011-03-30 19:57:46 -0400
commite2666f84958adb3a034b98e99699b55705117e01 (patch)
treef8fdca8163bf15d98468c63d4d98932ded0ec96f /net/ipv4
parentc031235b395433350f25943b7580a5e343c7b7b2 (diff)
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>
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/fib_frontend.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
index f116ce8f1b46..451088330bbb 100644
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@ -1068,6 +1068,7 @@ static void ip_fib_net_exit(struct net *net)
1068 fib4_rules_exit(net); 1068 fib4_rules_exit(net);
1069#endif 1069#endif
1070 1070
1071 rtnl_lock();
1071 for (i = 0; i < FIB_TABLE_HASHSZ; i++) { 1072 for (i = 0; i < FIB_TABLE_HASHSZ; i++) {
1072 struct fib_table *tb; 1073 struct fib_table *tb;
1073 struct hlist_head *head; 1074 struct hlist_head *head;
@@ -1080,6 +1081,7 @@ static void ip_fib_net_exit(struct net *net)
1080 fib_free_table(tb); 1081 fib_free_table(tb);
1081 } 1082 }
1082 } 1083 }
1084 rtnl_unlock();
1083 kfree(net->ipv4.fib_table_hash); 1085 kfree(net->ipv4.fib_table_hash);
1084} 1086}
1085 1087