Skip to content

Commit 9ef4dc2

Browse files
committed
netfilter: nf_tables: GC transaction race with abort path
jira VULN-430 cve CVE-2023-4244 commit-author Pablo Neira Ayuso <pablo@netfilter.org> commit 7203443 Abort path is missing a synchronization point with GC transactions. Add GC sequence number hence any GC transaction losing race will be discarded. Fixes: 5f68718 ("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> (cherry picked from commit 7203443) Signed-off-by: Marcin Wcisło <marcin.wcislo@conclusive.pl>
1 parent 63df531 commit 9ef4dc2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

net/netfilter/nf_tables_api.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9998,8 +9998,12 @@ static int nf_tables_abort(struct net *net, struct sk_buff *skb,
99989998
enum nfnl_abort_action action)
99999999
{
1000010000
struct nftables_pernet *nft_net = nft_pernet(net);
10001-
int ret = __nf_tables_abort(net, action);
10001+
unsigned int gc_seq;
10002+
int ret;
1000210003

10004+
gc_seq = nft_gc_seq_begin(nft_net);
10005+
ret = __nf_tables_abort(net, action);
10006+
nft_gc_seq_end(nft_net, gc_seq);
1000310007
mutex_unlock(&nft_net->commit_mutex);
1000410008

1000510009
return ret;

0 commit comments

Comments
 (0)