mirror of
https://github.com/hardkernel/linux.git
synced 2026-03-26 12:30:23 +09:00
netfilter: nf_tables: GC transaction race with netns dismantle
commit02c6c24402upstream. Use maybe_get_net() since GC workqueue might race with netns exit path. Fixes:5f68718b34("netfilter: nf_tables: GC transaction API to avoid race with control plane") Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
6796800f0d
commit
24707fa1e1
@@ -8949,9 +8949,14 @@ struct nft_trans_gc *nft_trans_gc_alloc(struct nft_set *set,
|
||||
if (!trans)
|
||||
return NULL;
|
||||
|
||||
trans->net = maybe_get_net(net);
|
||||
if (!trans->net) {
|
||||
kfree(trans);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
refcount_inc(&set->refs);
|
||||
trans->set = set;
|
||||
trans->net = get_net(net);
|
||||
trans->seq = gc_seq;
|
||||
|
||||
return trans;
|
||||
|
||||
Reference in New Issue
Block a user