Skip to content

Commit 3e70489

Browse files
committed
netfilter: nf_tables: unbind non-anonymous set if rule construction fails
Otherwise a dangling reference to a rule object that is gone remains in the set binding list. Fixes: 26b5a57 ("netfilter: nf_tables: add NFT_TRANS_PREPARE_ERROR to deal with bound set/chain") Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
1 parent f188d30 commit 3e70489

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

net/netfilter/nf_tables_api.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5343,6 +5343,8 @@ void nf_tables_deactivate_set(const struct nft_ctx *ctx, struct nft_set *set,
53435343
nft_set_trans_unbind(ctx, set);
53445344
if (nft_set_is_anonymous(set))
53455345
nft_deactivate_next(ctx->net, set);
5346+
else
5347+
list_del_rcu(&binding->list);
53465348

53475349
set->use--;
53485350
break;

0 commit comments

Comments
 (0)