Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2405623lqp; Sun, 24 Mar 2024 18:10:48 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVivTZeKeEgaLZDNpQXLiPI+rtoQQwfat2L8O+IBhJEw+v29V+elaXrN+9e+pE99VciimbDoJdDaGHdMqbcUomF/ttfas78rMB7kvlbiA== X-Google-Smtp-Source: AGHT+IGT1jzF1db0wze9CXyVbq5i2g/R1MorDNWpkbqw5ecNdZLmUlYtRvmh70aqWGJXRvOUZ7qd X-Received: by 2002:a05:6358:3416:b0:17e:6a4c:e96d with SMTP id h22-20020a056358341600b0017e6a4ce96dmr2724381rwd.30.1711329047996; Sun, 24 Mar 2024 18:10:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711329047; cv=pass; d=google.com; s=arc-20160816; b=CQ6eWqxowXTtuMTl4GiZVtD1O145x5ZcuAv/Nj3L4w8XSPdpXlbUDN90dKRNt6VEN/ ScVIThyyzkiK1RsKy3hm3E7V2erQSygbVUCO8OVMB5AJawoIh6IVdkqvDHhCJu1q51aP zZVA4x8fzSnvkn7F7Usnbs8d+qHXm11OgTlU8Og0gn4xHYwaYP/M1rRO9xdJKJSxw1ZG z5a8mk98wpG/ViZf+v+FjvuBrvWsyhYYKED7YKxr4ru6t1DR6I9nithUIQ99Tsvl3Lsg 0qaTbvwGMfG4ooonv4/+tzaqZ6fQoI4Mm0f0U8XTHNjcM8u0ldOLYHxmItdzdX5kldIV az8A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=EBRmmBNP9BRTKjS9ZpI+UicDO/e2pnT1+2NxsLZ8K6g=; fh=JCupzcIQwtmyJ2C2xrsc2nqgcJfRphMLLtiVBgyhfvk=; b=XcLtBTe0MhM7qUkjRBuHGdGNdE2FqKprbeKI4J/8lNrJifkS4lYYR/DwKEnY4TMmkE 9IoB3QF6sUSS+TNdXWLhjZ71FkiuxD5BzVu1Yk4Ejqa9rElqKIZg8y6/yWhFhXeDqTan tfKX869Q8yhcUrPiRiKP+4ydjvfKZzlkDLqN29kNTvYVxtPQBcZOM1k0wOMVkJRX36Y2 bs/uvAVZyHugdROpCXSzspH8IK5vSGqXj1FKJ+eAtMH6X3n4dOcdA3dIzghvzPAqoU0t YjguUzTew/E+LaE5EwgsD2a82g0+JmM+1v7A6yj8cpK1QvBOluVNbyDNWSKE7Fa4mpkA y1dQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QlGJemNe; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113592-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113592-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id t18-20020a634612000000b005dbde0102b0si6647144pga.288.2024.03.24.18.10.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Mar 2024 18:10:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-113592-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QlGJemNe; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113592-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113592-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id A005D284C91 for ; Mon, 25 Mar 2024 01:10:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0FF311CC601; Sun, 24 Mar 2024 22:46:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="QlGJemNe" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2D3591CADB7; Sun, 24 Mar 2024 22:46:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320395; cv=none; b=XJUzNDxWalvECHTGnBMx0b2dWiH6rmyvOPNc2DXNpEp8jZ0CKEKhMbg6XV0XNObauoUL3FwDqxPZ0AVfbSCUYQgwTZ/TYFD/6dMv7tDphhoeUvAJYyZ74yXGlO6htCCzRKoOevzQWQ9b1PXO2ipXy7XCLzFpWKgAdqIQZ5VQW48= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320395; c=relaxed/simple; bh=3cugA918L+ok7yRN6AhqP9YapzoDWyzLrD3lHQaYdFM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KvzPUnTxOVEQr2hJyYMvDWV6/FoUASR3cqCL3/6Xy5+7zvcyXXpDCZ5Yt9iJBLekCTt0pmgZCIXMn3IxHJFzByFb24P6RI+gD9Bpw9YymtB3AER9LG6x/VU9s25MnamU0nLzY4k3kWhqOVSOtPYi7Y9U5orSNlBG6jZhOLLIoG4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=QlGJemNe; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 810A2C43399; Sun, 24 Mar 2024 22:46:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711320395; bh=3cugA918L+ok7yRN6AhqP9YapzoDWyzLrD3lHQaYdFM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QlGJemNeYiJAG1YE2ydlnckwhtJL6tGvaTYF7GLASwEPsC7T3BKX/WAuTwzl9Dv1g yj50NqxlVu4Y2sVI7b2OzHHRQLGGMQD+Yy0uTpiSWzoKpaHVCpRJDELD6COCDn8G13 jlsnzstX+mclmQ6GiOeInVzGE7od/aMc6aLXayTEtYch8nzSKW3t2ERj0Uy+QorK8R 8CFrcKzn2z3Cyx0Hogxnk+VPbLZ9f59TjBzDBM1mBsXy+F7fCLYTwxvw/Kkt1oYXE0 XNUPO3ZWQSrGd0QJIAU/2Oyj+GbYeDnkG7Js+AIWXfs1B6ZIbKXFXCIQTZkImz6RVl ANqlBcv8WajyQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Pablo Neira Ayuso , Sasha Levin Subject: [PATCH 6.8 701/715] netfilter: nft_set_pipapo: release elements in clone only from destroy path Date: Sun, 24 Mar 2024 18:34:40 -0400 Message-ID: <20240324223455.1342824-702-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324223455.1342824-1-sashal@kernel.org> References: <20240324223455.1342824-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Pablo Neira Ayuso [ Upstream commit b0e256f3dd2ba6532f37c5c22e07cb07a36031ee ] Clone already always provides a current view of the lookup table, use it to destroy the set, otherwise it is possible to destroy elements twice. This fix requires: 212ed75dc5fb ("netfilter: nf_tables: integrate pipapo into commit protocol") which came after: 9827a0e6e23b ("netfilter: nft_set_pipapo: release elements in clone from abort path"). Fixes: 9827a0e6e23b ("netfilter: nft_set_pipapo: release elements in clone from abort path") Signed-off-by: Pablo Neira Ayuso Signed-off-by: Sasha Levin --- net/netfilter/nft_set_pipapo.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/net/netfilter/nft_set_pipapo.c b/net/netfilter/nft_set_pipapo.c index aa1d9e93a9a04..b3b282de802de 100644 --- a/net/netfilter/nft_set_pipapo.c +++ b/net/netfilter/nft_set_pipapo.c @@ -2244,8 +2244,6 @@ static void nft_pipapo_destroy(const struct nft_ctx *ctx, if (m) { rcu_barrier(); - nft_set_pipapo_match_destroy(ctx, set, m); - for_each_possible_cpu(cpu) pipapo_free_scratch(m, cpu); free_percpu(m->scratch); @@ -2257,8 +2255,7 @@ static void nft_pipapo_destroy(const struct nft_ctx *ctx, if (priv->clone) { m = priv->clone; - if (priv->dirty) - nft_set_pipapo_match_destroy(ctx, set, m); + nft_set_pipapo_match_destroy(ctx, set, m); for_each_possible_cpu(cpu) pipapo_free_scratch(priv->clone, cpu); -- 2.43.0