netfilter: nf_tables: unbind non-anonymous set if rule construction fails
authorPablo Neira Ayuso <pablo@netfilter.org>
Sun, 25 Jun 2023 22:42:18 +0000 (00:42 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Jul 2023 14:22:16 +0000 (16:22 +0200)
commitf145373334054a8423fac198e0dcfeeb49b96ec8
treed82d0423ccf4c6382b28bc8c4dbf474d20b70a4d
parentad2928e7f3f6120a0bd18aa1056b3b24068027c5
netfilter: nf_tables: unbind non-anonymous set if rule construction fails

commit 3e70489721b6c870252c9082c496703677240f53 upstream.

Otherwise a dangling reference to a rule object that is gone remains
in the set binding list.

Fixes: 26b5a5712eb8 ("netfilter: nf_tables: add NFT_TRANS_PREPARE_ERROR to deal with bound set/chain")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/netfilter/nf_tables_api.c