Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3513770rwa; Tue, 23 Aug 2022 06:05:53 -0700 (PDT) X-Google-Smtp-Source: AA6agR5Q55O+aWd8Bo3Ctcjh8oUEKx6IF83Nni0yub4EoQ/GKrkSmsFc1u3VSHynSdXNfMfrnkCP X-Received: by 2002:a17:90b:4cc8:b0:1fb:e8c:3cec with SMTP id nd8-20020a17090b4cc800b001fb0e8c3cecmr3323765pjb.70.1661259953048; Tue, 23 Aug 2022 06:05:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661259953; cv=none; d=google.com; s=arc-20160816; b=ywrgZBi5kDjs5i0y+XuX7BIQu8KuiugaKqYgWBiSPuwz95+krpQ1VzWywL3NHRUu1l cdC/jlKDslHVp5YQDI3nd2Qgf4+5R1fEPAVHkBfw0JBP5KCt8/Q+ra7M6DO8+MFrnmvp xqpIr5kz5AFbIduZwMmq6SkrCJJBuVc0s9co/bom9EKXHmqGyD6G9SmupGy+SuzBFcHz 3cGLeUGTlmovaYS/U5PnGLUcilov47YS9xlbUrlznZY1rZjIDSwbiaVtpniTuQWSI6hH 6HHP+BaNa9sFWjIvnC5+N77Hvd8rrlFTqy4EFwfWm4ytcW/wcjm26UUWiQCbBQ4vqZct Zc9A== 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=Z7cRViJLhFnDu5iNOlqfmrw3ezlKSfqgIktu+5Mxtlc=; b=ohp0CWw84mTNG+Pro/0CqhoVl3HguP2Xpvs6zqW26PXxLoc+m6P6XxodP9fp5so439 c/7cfxN4R+i7k/REz67DHwlw1GGbHpqPQ8OySwRKcOqCoEO/InVCrbKmVVL/Xrm/5T6F ghMTgv5xSZNY0C8HYmeULshKgOtg/cYl36PdS2/0zCKxNnNhvQn2RUqB6Rw1av5BOM38 6K38t3ybHXSiyx/zMM/7Br8uAmicl29u7nH9nwRDVrshRh4Wkhx8hV0aaDRyOkUJSXDJ 3lo5p05V5KFlWi/8LmkZFmxpI73VHsuHHNoOdnpDV34JjhJ2bC2HQ/WU7QSGpkUFrJgB v6JQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="yLl/Vg9J"; 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 u7-20020a170902a60700b001614cd997a6si14429691plq.481.2022.08.23.06.05.41; Tue, 23 Aug 2022 06:05:53 -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="yLl/Vg9J"; 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 S1357085AbiHWK41 (ORCPT + 99 others); Tue, 23 Aug 2022 06:56:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1356967AbiHWKws (ORCPT ); Tue, 23 Aug 2022 06:52:48 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC0F9ABD7F; Tue, 23 Aug 2022 02:13:00 -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 47F13B81C4E; Tue, 23 Aug 2022 09:12:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7FBDBC43147; Tue, 23 Aug 2022 09:12:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661245976; bh=awAHgUEQnZ1gGsL11AJTOnkNx1LipDESO0/Lx/zo/xc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yLl/Vg9J1sh5E4AvL0zohC6VuQ/SAqtk/QHBucyIsqZqvvLyCsptlDbBzgZHogl1T 7HGN2pScJMvEynC8xS2zipTWI5+qC3Tdmy2JEwyFq/URBdGxLv5AHmZK/a7rkYVj3Z ZdT9y8zkCREUbZ3n6L27mKNG+q4KDbVfl4J2PYaE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pablo Neira Ayuso Subject: [PATCH 4.19 250/287] netfilter: nf_tables: really skip inactive sets when allocating name Date: Tue, 23 Aug 2022 10:26:59 +0200 Message-Id: <20220823080109.605467738@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080100.268827165@linuxfoundation.org> References: <20220823080100.268827165@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 @@ -3098,7 +3098,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;