Skip to content

Commit 121604f

Browse files
committed
netfilter: nf_tables: mark newset as dead on transaction abort
JIRA: https://issues.redhat.com/browse/RHEL-21443 Upstream Status: commit 08e4c8c commit 08e4c8c Author: Florian Westphal <fw@strlen.de> Date: Mon Nov 27 11:00:37 2023 +0100 netfilter: nf_tables: mark newset as dead on transaction abort If a transaction is aborted, we should mark the to-be-released NEWSET dead, just like commit path does for DEL and DESTROYSET commands. In both cases all remaining elements will be released via set->ops->destroy(). The existing abort code does NOT post the actual release to the work queue. Also the entire __nf_tables_abort() function is wrapped in gc_seq begin/end pair. Therefore, async gc worker will never try to release the pending set elements, as gc sequence is always stale. It might be possible to speed up transaction aborts via work queue too, this would result in a race and a possible use-after-free. So fix this before it becomes an issue. Fixes: 5f68718 ("netfilter: nf_tables: GC transaction API to avoid race with control plane") Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: Florian Westphal <fwestpha@redhat.com>
1 parent 7395d33 commit 121604f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

net/netfilter/nf_tables_api.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10046,6 +10046,7 @@ static int __nf_tables_abort(struct net *net, enum nfnl_abort_action action)
1004610046
nft_trans_destroy(trans);
1004710047
break;
1004810048
}
10049+
nft_trans_set(trans)->dead = 1;
1004910050
list_del_rcu(&nft_trans_set(trans)->list);
1005010051
break;
1005110052
case NFT_MSG_DELSET:

0 commit comments

Comments
 (0)