Skip to content

Commit b5c6baa

Browse files
committed
netfilter: nft_set_hash: try later when GC hits EAGAIN on iteration
jira VULN-430 cve CVE-2023-4244 commit-author Pablo Neira Ayuso <[email protected]> commit b079155 Skip GC run if iterator rewinds to the beginning with EAGAIN, otherwise GC might collect the same element more than once. Fixes: f6c383b ("netfilter: nf_tables: adapt set backend to use GC transaction API") Signed-off-by: Pablo Neira Ayuso <[email protected]> (cherry picked from commit b079155) Signed-off-by: Marcin Wcisło <[email protected]>
1 parent 7bb1720 commit b5c6baa

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

net/netfilter/nft_set_hash.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -338,12 +338,9 @@ static void nft_rhash_gc(struct work_struct *work)
338338

339339
while ((he = rhashtable_walk_next(&hti))) {
340340
if (IS_ERR(he)) {
341-
if (PTR_ERR(he) != -EAGAIN) {
342-
nft_trans_gc_destroy(gc);
343-
gc = NULL;
344-
goto try_later;
345-
}
346-
continue;
341+
nft_trans_gc_destroy(gc);
342+
gc = NULL;
343+
goto try_later;
347344
}
348345

349346
/* Ruleset has been updated, try later. */

0 commit comments

Comments
 (0)