From: Pablo Neira Ayuso Date: Fri, 12 Jan 2024 22:28:45 +0000 (+0100) Subject: netfilter: nf_tables: check if catch-all set element is active in next generation X-Git-Tag: v6.7.2~198 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7e0f5f8ae3e5f17e367f7040ade7a467f1f0e3b9;p=thirdparty%2Fkernel%2Fstable.git netfilter: nf_tables: check if catch-all set element is active in next generation commit b1db244ffd041a49ecc9618e8feb6b5c1afcdaa7 upstream. When deactivating the catch-all set element, check the state in the next generation that represents this transaction. This bug uncovered after the recent removal of the element busy mark a2dd0233cbc4 ("netfilter: nf_tables: remove busy mark and gc batch API"). Fixes: aaa31047a6d2 ("netfilter: nftables: add catch-all set element support") Cc: stable@vger.kernel.org Reported-by: lonial con Signed-off-by: Pablo Neira Ayuso Signed-off-by: Greg Kroah-Hartman --- diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c index d5f76e26ae03e..5e7994898c765 100644 --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c @@ -6487,7 +6487,7 @@ static int nft_setelem_catchall_deactivate(const struct net *net, list_for_each_entry(catchall, &set->catchall_list, list) { ext = nft_set_elem_ext(set, catchall->elem); - if (!nft_is_active(net, ext)) + if (!nft_is_active_next(net, ext)) continue; kfree(elem->priv);