Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e2666f84 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller
Browse files

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: default avatarDaniel J Blueman <daniel.blueman@gmail.com>
Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c031235b
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1068,6 +1068,7 @@ static void ip_fib_net_exit(struct net *net)
	fib4_rules_exit(net);
#endif

	rtnl_lock();
	for (i = 0; i < FIB_TABLE_HASHSZ; i++) {
		struct fib_table *tb;
		struct hlist_head *head;
@@ -1080,6 +1081,7 @@ static void ip_fib_net_exit(struct net *net)
			fib_free_table(tb);
		}
	}
	rtnl_unlock();
	kfree(net->ipv4.fib_table_hash);
}