Skip to content

Commit c1193d9

Browse files
keltarummakynes
authored andcommitted
netfilter: ipset: Add list flush to cancel_gc
Flushing list in cancel_gc drops references to other lists right away, without waiting for RCU to destroy list. Fixes race when referenced ipsets can't be destroyed while referring list is scheduled for destroy. Fixes: 97f7cf1 ("netfilter: ipset: fix performance regression in swap operation") Signed-off-by: Alexander Maltsev <[email protected]> Acked-by: Jozsef Kadlecsik <[email protected]> Signed-off-by: Pablo Neira Ayuso <[email protected]>
1 parent dc21c6c commit c1193d9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

net/netfilter/ipset/ip_set_list_set.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,9 @@ list_set_cancel_gc(struct ip_set *set)
549549

550550
if (SET_WITH_TIMEOUT(set))
551551
timer_shutdown_sync(&map->gc);
552+
553+
/* Flush list to drop references to other ipsets */
554+
list_set_flush(set);
552555
}
553556

554557
static const struct ip_set_type_variant set_variant = {

0 commit comments

Comments
 (0)