mirror of
https://github.com/hardkernel/linux.git
synced 2026-03-25 03:50:24 +09:00
UPSTREAM: netfilter: nft_set_pipapo: release elements in clone only from destroy path
[ 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:212ed75dc5("netfilter: nf_tables: integrate pipapo into commit protocol") which came after:9827a0e6e2("netfilter: nft_set_pipapo: release elements in clone from abort path"). Bug: 330876672 Fixes:9827a0e6e2("netfilter: nft_set_pipapo: release elements in clone from abort path") Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: Sasha Levin <sashal@kernel.org> (cherry picked from commitff90050771) Signed-off-by: Lee Jones <joneslee@google.com> Change-Id: I8c0811e69f82681c7fcfdca1111f1702e27bb80e
This commit is contained in:
committed by
Lee Jones
parent
6a45518094
commit
948f42ca2b
@@ -2234,8 +2234,6 @@ static void nft_pipapo_destroy(const struct nft_ctx *ctx,
|
||||
if (m) {
|
||||
rcu_barrier();
|
||||
|
||||
nft_set_pipapo_match_destroy(ctx, set, m);
|
||||
|
||||
#ifdef NFT_PIPAPO_ALIGN
|
||||
free_percpu(m->scratch_aligned);
|
||||
#endif
|
||||
@@ -2250,8 +2248,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);
|
||||
|
||||
#ifdef NFT_PIPAPO_ALIGN
|
||||
free_percpu(priv->clone->scratch_aligned);
|
||||
|
||||
Reference in New Issue
Block a user