From nobody Sat Sep 27 20:21:56 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A2034C32772 for ; Tue, 23 Aug 2022 10:10:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353030AbiHWKKJ (ORCPT ); Tue, 23 Aug 2022 06:10:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352742AbiHWKC1 (ORCPT ); Tue, 23 Aug 2022 06:02:27 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B39E17C1FA; Tue, 23 Aug 2022 01:50:44 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id D91ABB81B90; Tue, 23 Aug 2022 08:50:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 20478C433D6; Tue, 23 Aug 2022 08:50:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661244641; bh=CWth068DYf27Hhh4Is+eyfbC9ynjtu8WDAcxtajfpdo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l4GNbn7l3ww3S6+4RDiGlZu8P90ivYZ1C97xHKkRjmmYtNM7tz8r9AoyTlj/NcbzT KbXEmMgke7CabvBq3OIjI2hmA7XCKLUo+IuArwjH0sBZbU7CY5+8LG6piPUXKal99v u1oBY8Q4hbkxIjIHcaNCY6+BgJYWgmRgAKH7JNZk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pablo Neira Ayuso Subject: [PATCH 5.15 127/244] netfilter: nf_tables: really skip inactive sets when allocating name Date: Tue, 23 Aug 2022 10:24:46 +0200 Message-Id: <20220823080103.320842901@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080059.091088642@linuxfoundation.org> References: <20220823080059.091088642@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Pablo Neira Ayuso commit 271c5ca826e0c3c53e0eb4032f8eaedea1ee391c upstream. While looping to build the bitmap of used anonymous set names, check the current set in the iteration, instead of the one that is being created. Fixes: 37a9cc525525 ("netfilter: nf_tables: add generation mask to sets") Signed-off-by: Pablo Neira Ayuso Signed-off-by: Greg Kroah-Hartman --- net/netfilter/nf_tables_api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c @@ -3810,7 +3810,7 @@ cont: list_for_each_entry(i, &ctx->table->sets, list) { int tmp; =20 - if (!nft_is_active_next(ctx->net, set)) + if (!nft_is_active_next(ctx->net, i)) continue; if (!sscanf(i->name, name, &tmp)) continue;