Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3473647rwa; Tue, 23 Aug 2022 05:28:13 -0700 (PDT) X-Google-Smtp-Source: AA6agR7qdWU4oL4LqJBaoPB/ctE7ZOV8vAkjLAI5lqkBUkySIozGNvQimrrl5lyztBZNrC8/TDhx X-Received: by 2002:a17:90b:483:b0:1fb:137e:4bb9 with SMTP id bh3-20020a17090b048300b001fb137e4bb9mr3010612pjb.188.1661257692716; Tue, 23 Aug 2022 05:28:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661257692; cv=none; d=google.com; s=arc-20160816; b=E/6VwaSlzmWmI5hTbBxH7WGG4rupwXpe5RmP4baE0IBEGSiNDqrRm5BRuvYt78GY2l lm9YN8cDChgywdWp2Oomz/2IF/KfXrzjF20vgGwDUg2KTJ8pehZNC0vniLYcqCtF59jU eknDunuhOeM42m/fpvmIBhHOBKuT2yYPAtJ1ugLm2MzVG9F/XuIIJgUoF+usoM9RUKyJ 3TTWnr/uewrz7Yi4KHJLgmN0miJdGh0jLx7JkkGsqtTrZ+fz59R/09xEE+bcUxSqy500 mh/fUxRmnNmc6skRpvPAHCjcSveKDDZ65vIHVAOXpkEMRzVmliG3uD6jzu1fJZJqIuaP Rn2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=86TzjWJGM1tEvT+EReETtHcLJJPM144S9QGVNNf9MXU=; b=V2UvqpH4QETijwBael0swJZmXXfNV78lIwERdd3M7g1cGJCPWQNRBQTGECAG+BQSbj DUYOenGctrL+65dd6Cw6bE+PfDYXD6HrleTJQtQjBbHHHQepiYH0znkpBoVu3seZKIYQ yBctTrcu19uzE6bzkjb008yZwnwfws9OV1/btYXcfLVhjfaTFixZU2HQRcuD3rpxonhx d9YJtZA7PntCRTI7vtqz9JnZxzGkCPfPkRnQ1o0xv3ekGtXAd1LIz88U5QzBFbNddlGI 24IGS4O33xdAyyzy1Bq54euCLX68uPm5PYQa1PrS5KPSZByks15XCwS+LMKZTaMMU903 MZdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=nh9XG+Jh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o136-20020a62cd8e000000b005362ac517e3si11177590pfg.60.2022.08.23.05.28.00; Tue, 23 Aug 2022 05:28:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=nh9XG+Jh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244053AbiHWKS2 (ORCPT + 99 others); Tue, 23 Aug 2022 06:18:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33934 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352558AbiHWKIE (ORCPT ); Tue, 23 Aug 2022 06:08:04 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E1C45A2E8; Tue, 23 Aug 2022 01:54:24 -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 dfw.source.kernel.org (Postfix) with ESMTPS id C1A036150F; Tue, 23 Aug 2022 08:54:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C3474C433D6; Tue, 23 Aug 2022 08:54:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661244863; bh=GEkDlFdYejgeBRE8yTQaw/+MTKzDAMTi3p29YjlsrMw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nh9XG+JhwsHb/LfruR06+fRs8aT7Bl7L79CyK4hTg/N/UUVsNo8qS0WgMXLljRNTF Glm+uDjU13XzMIICMfO7cczdnZ0GSexPTRZCl/e8NpzuhV/HL4nxJEMPruWwFc0bqx I1yApGaja+HfKjcKVAMmSGv66+L7EwDHl9qu5rvM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pablo Neira Ayuso Subject: [PATCH 4.14 203/229] netfilter: nf_tables: really skip inactive sets when allocating name Date: Tue, 23 Aug 2022 10:26:04 +0200 Message-Id: <20220823080100.902840174@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080053.202747790@linuxfoundation.org> References: <20220823080053.202747790@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 @@ -2797,7 +2797,7 @@ cont: list_for_each_entry(i, &ctx->table->sets, list) { int tmp; - if (!nft_is_active_next(ctx->net, set)) + if (!nft_is_active_next(ctx->net, i)) continue; if (!sscanf(i->name, name, &tmp)) continue;