Skip to content

Commit 7203443

Browse files
ummakynesFlorian Westphal
authored andcommitted
netfilter: nf_tables: GC transaction race with abort path
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 <[email protected]> Signed-off-by: Florian Westphal <[email protected]>
1 parent 2c9f029 commit 7203443

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
@@ -10337,8 +10337,12 @@ static int nf_tables_abort(struct net *net, struct sk_buff *skb,
1033710337
enum nfnl_abort_action action)
1033810338
{
1033910339
struct nftables_pernet *nft_net = nft_pernet(net);
10340-
int ret = __nf_tables_abort(net, action);
10340+
unsigned int gc_seq;
10341+
int ret;
1034110342

10343+
gc_seq = nft_gc_seq_begin(nft_net);
10344+
ret = __nf_tables_abort(net, action);
10345+
nft_gc_seq_end(nft_net, gc_seq);
1034210346
mutex_unlock(&nft_net->commit_mutex);
1034310347

1034410348
return ret;

0 commit comments

Comments
 (0)