[
a669e8adb86a13fd522e3f4619d80500123fc268 ]
clean_net() runs in workqueue while walking over the lists, grab mutex.
Fixes: 815fac68e781 ("netfilter: nftables: fix possible UAF over chains from packet path in netns")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
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)