Skip to content

Commit 819d0ed

Browse files
committed
netfilter: nf_tables: GC transaction race with netns dismantle
jira VULN-430 cve CVE-2023-4244 commit-author Pablo Neira Ayuso <[email protected]> commit 02c6c24 Use maybe_get_net() since GC workqueue might race with netns exit path. Fixes: 5f68718 ("netfilter: nf_tables: GC transaction API to avoid race with control plane") Signed-off-by: Pablo Neira Ayuso <[email protected]> Signed-off-by: Florian Westphal <[email protected]> (cherry picked from commit 02c6c24) Signed-off-by: Marcin Wcisło <[email protected]>
1 parent ca02f6e commit 819d0ed

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

net/netfilter/nf_tables_api.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9170,9 +9170,14 @@ struct nft_trans_gc *nft_trans_gc_alloc(struct nft_set *set,
91709170
if (!trans)
91719171
return NULL;
91729172

9173+
trans->net = maybe_get_net(net);
9174+
if (!trans->net) {
9175+
kfree(trans);
9176+
return NULL;
9177+
}
9178+
91739179
refcount_inc(&set->refs);
91749180
trans->set = set;
9175-
trans->net = get_net(net);
91769181
trans->seq = gc_seq;
91779182

91789183
return trans;

0 commit comments

Comments
 (0)