Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3395772rwa; Tue, 23 Aug 2022 04:11:53 -0700 (PDT) X-Google-Smtp-Source: AA6agR5vX1c+vCiQm2lKaXxTTTeCEe8QK7W+jllfBNUiBi6SvqAzx6Y8Uj4YF7gaqEtXaDMOKZIO X-Received: by 2002:a17:902:e5c6:b0:16e:f3b6:ddb5 with SMTP id u6-20020a170902e5c600b0016ef3b6ddb5mr23901897plf.122.1661253113039; Tue, 23 Aug 2022 04:11:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661253113; cv=none; d=google.com; s=arc-20160816; b=q48gYWRcImIBAjjv6Qm1J2tnOuXKlWy54+iz/ppwTkYq16Gry5s950GoMFVGZLu/vO fGOKAp0XSq6I/5HzNlYEzYdh8M2Pkfd+c0Wc/j0IuzzQbevZGteE+5CtsuUi8TusmUGQ Yi+EDBsxSQDqQVRsMbVZj5TrWrm1sZVr63Yk6tVv6Rplt9szZBJ85MATsgiqUYvV7p1e YIAFGFBXWMtM1vtbaVAzT2WAipVR/SthSEIg1ENoC9vDt+Ar4kqiPuykN0xb3u746nCP alzz2ggjejSw3m+IAszW2IJ0GUSIr39h5OIzLEK9kADEuSKrdK4ija79r1wzWnLNEQt8 NLrA== 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=aT3FScIgrT89aIZenI4IJSM9+ftcLKaA6jaXfucUCnA=; b=DbJM0PEgX6ftehop3gU1EDeZiXJ7LwxsgNBwpyfQVkIGZCa3LuXi6Z/miiyIhsrg1b XgPysk9P/Q3y7pXHM8vuy74aLiddpypo6RQfO5yNNNrvV+XLZ5gCZHtxVzAE5jRl52vl FoSiYvstvfGY6bj/+1WRJ3LI4CsjMN2PpV2TDLB+5mpx1N24T2FYCRgv7vDjll/3F0K+ AT/fpWb6AwCAJxGCZ+dmV+CE5dEIISJ9uJbbtXwpaTNLlhGejIWH1DeAVRCldeWE5cys M1DsLGxOqmNu9Ctka4GGK+2xlCHMuZ3louz4Aq4bXS38/DoYYLHEdakWtZHIvyBfFaFl m/8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=l4GNbn7l; 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 j2-20020a056a00234200b005184ae7a3c4si17516734pfj.140.2022.08.23.04.11.39; Tue, 23 Aug 2022 04:11: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=l4GNbn7l; 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 S1353028AbiHWKKI (ORCPT + 99 others); Tue, 23 Aug 2022 06:10:08 -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-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 @@ -3810,7 +3810,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;