[Jammy, OEM-5.17, OEM-6.0, Lunar 3/3] netfilter: nf_tables: unbind non-anonymous set if rule construction fails
Thadeu Lima de Souza Cascardo
cascardo at canonical.com
Thu Aug 3 18:31:03 UTC 2023
From: Pablo Neira Ayuso <pablo at netfilter.org>
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 at netfilter.org>
(cherry picked from commit 3e70489721b6c870252c9082c496703677240f53)
CVE-2023-4015
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo at canonical.com>
---
net/netfilter/nf_tables_api.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index c38658b7491f..329ed9138b4f 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -5077,6 +5077,8 @@ void nf_tables_deactivate_set(const struct nft_ctx *ctx, struct nft_set *set,
nft_set_trans_unbind(ctx, set);
if (nft_set_is_anonymous(set))
nft_deactivate_next(ctx->net, set);
+ else
+ list_del_rcu(&binding->list);
set->use--;
break;
--
2.34.1
More information about the kernel-team
mailing list