Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3293344rwa; Tue, 23 Aug 2022 02:08:50 -0700 (PDT) X-Google-Smtp-Source: AA6agR4zTkJH/I8Yxt1nHOMgA0+giC4xXcBPU2yfzGgZ46s6bPBkzOu+WIhrK45BdCHjjjko0KNQ X-Received: by 2002:a17:907:2c47:b0:73c:6312:a4e0 with SMTP id hf7-20020a1709072c4700b0073c6312a4e0mr13858769ejc.72.1661245730260; Tue, 23 Aug 2022 02:08:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661245730; cv=none; d=google.com; s=arc-20160816; b=VDVOQI04EOOMZli71zTrEQBw3X2e2oj88H3G4SOQbF/fSx87hdEd7q1AdhsnhO0j7Q K06MF+NWluRH+06Eer7U0rM7jkn7ZwNYnb0V6cVgaI1X+F+VhPwDxBu7cY7PWoCjNpA1 6O0pjxkpwW3Ai0tLewx7DGf3a9Zp4G+qLR9FToJnj6cxp9NsU5urt6I7uj719GDsqIbM RiuaUASfLQ4l8T5cxQJDcLnI0HmO1Fs6BdlDJN69Qs3pApzbF8K6DcPwKSX4oSEoQjYV Do+8s944Xds7c6TP+voDUifFhYJObV6Slq6aX7AohuEJOKc0OdD6Bz3cOZM6ayvS5DOp HYvQ== 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=vIuaKYW94CryXpWJet6ea5Gyoildq6TGb1I8pVnjxVg=; b=xlsBW9YThiLJ/qRC9ruDyoyCv2PzRf2AdoudCC70V8PJPVKBTyMtevH42pphSCFJtO Uyzn9lJApOqOl1CGbpB1p48zaY7ik5tdTyfdeP0cMegcc06oVE7JLeJIz8k86/sbkco+ sMfUaCpFUib3g4YcsSNIqa3qcmJ4XHmOyzhVbkEhtSlWUtKuzG2MdbFlx7xzQehICCkD vJnrX1frmp8fdlTx9z6lYT6ZaglgTBppaea+jPbBvC9IcCiVH/Dnim/qGlHsMOGmq1me kfDuRS2LR4ouSeOE8q5lCfwrdpj9hgtt1oM65A3CO9yzySIei1yf27r+UJmjq33uu0BC dpwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=2hvnzZur; 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 b10-20020a056402350a00b0043d32528589si1850871edd.549.2022.08.23.02.08.22; Tue, 23 Aug 2022 02:08:50 -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=2hvnzZur; 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 S239835AbiHWIrO (ORCPT + 99 others); Tue, 23 Aug 2022 04:47:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347241AbiHWIpO (ORCPT ); Tue, 23 Aug 2022 04:45:14 -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 9FACB6AA0C; Tue, 23 Aug 2022 01:21:04 -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 4AB7361344; Tue, 23 Aug 2022 08:19:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 53A74C433B5; Tue, 23 Aug 2022 08:19:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661242782; bh=E0HKijj/aYKxcTXDI4Rk1LFkMA9lUuelgim1kwX1ZEk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2hvnzZursvPNkPuFgte1iMJPLmOBW4Rtvb0TEmYeejdJ4OORqTXgTDEmIrvbUjWj5 d94qk4nGNiYVaegtNAQocY5V9z6HxZCjqUBWIzvA113+rb0VltBGFBP5QBJpxKM3KN Oqku4reJcFpZutS6TJgI5COtpzhItl5w3SorW9E0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pablo Neira Ayuso Subject: [PATCH 5.19 197/365] netfilter: nf_tables: really skip inactive sets when allocating name Date: Tue, 23 Aug 2022 10:01:38 +0200 Message-Id: <20220823080126.472216495@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080118.128342613@linuxfoundation.org> References: <20220823080118.128342613@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 @@ -3907,7 +3907,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;