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

Commit e0c1b352 authored by Pablo Neira Ayuso's avatar Pablo Neira Ayuso Committed by Greg Kroah-Hartman
Browse files

netfilter: nf_tables: hold mutex on netns pre_exit path



[ 3923b1e4406680d57da7e873da77b1683035d83f ]

clean_net() runs in workqueue while walking over the lists, grab mutex.

Fixes: 767d1216bff8 ("netfilter: nftables: fix possible UAF over chains from packet path in netns")
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 6236af69
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -7866,7 +7866,9 @@ static int __net_init nf_tables_init_net(struct net *net)

static void __net_exit nf_tables_pre_exit_net(struct net *net)
{
	mutex_lock(&net->nft.commit_mutex);
	__nft_release_hooks(net);
	mutex_unlock(&net->nft.commit_mutex);
}

static void __net_exit nf_tables_exit_net(struct net *net)