netfilter: nf_tables: add NFT_TRANS_PREPARE_ERROR to deal with bound set/chain
authorPablo Neira Ayuso <pablo@netfilter.org>
Fri, 16 Jun 2023 12:45:26 +0000 (14:45 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 20 Jun 2023 20:43:40 +0000 (22:43 +0200)
commit26b5a5712eb85e253724e56a54c17f8519bd8e4e
tree88b087c5fb5438d52c62b4758d58450ea00fc219
parent4bedf9eee016286c835e3d8fa981ddece5338795
netfilter: nf_tables: add NFT_TRANS_PREPARE_ERROR to deal with bound set/chain

Add a new state to deal with rule expressions deactivation from the
newrule error path, otherwise the anonymous set remains in the list in
inactive state for the next generation. Mark the set/chain transaction
as unbound so the abort path releases this object, set it as inactive in
the next generation so it is not reachable anymore from this transaction
and reference counter is dropped.

Fixes: 1240eb93f061 ("netfilter: nf_tables: incorrect error path handling with NFT_MSG_NEWRULE")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/net/netfilter/nf_tables.h
net/netfilter/nf_tables_api.c
net/netfilter/nft_immediate.c