netfilter: nft_set_pipapo: stop GC iteration if GC transaction allocation fails
authorSasha Levin <sashal@kernel.org>
Fri, 22 Sep 2023 17:01:16 +0000 (19:01 +0200)
committerSalvatore Bonaccorso <carnil@debian.org>
Fri, 29 Sep 2023 04:25:15 +0000 (05:25 +0100)
commit 6d365eabce3c018a80f6e0379b17df2abb17405e upstream.

nft_trans_gc_queue_sync() enqueues the GC transaction and it allocates a
new one. If this allocation fails, then stop this GC sync run and retry
later.

Fixes: 5f68718b34a5 ("netfilter: nf_tables: GC transaction API to avoid race with control plane")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name netfilter-nft_set_pipapo-stop-gc-iteration-if-gc-tra.patch

net/netfilter/nft_set_pipapo.c

index 80440ac5d44c6a258f5b993f4bdca418506879b7..fbfcc3275cadf902c010dd54d48f2a4d144a2f6d 100644 (file)
@@ -1595,7 +1595,7 @@ static void pipapo_gc(const struct nft_set *_set, struct nft_pipapo_match *m)
 
                        gc = nft_trans_gc_queue_sync(gc, GFP_ATOMIC);
                        if (!gc)
-                               break;
+                               return;
 
                        nft_pipapo_gc_deactivate(net, set, e);
                        pipapo_drop(m, rulemap);