Skip to content

Commit

Permalink
netfilter: ipset: Add list flush to cancel_gc
Browse files Browse the repository at this point in the history
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 <keltar.gw@gmail.com>
Acked-by: Jozsef Kadlecsik <kadlec@netfilter.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
  • Loading branch information
Alexander Maltsev authored and Pablo Neira Ayuso committed May 20, 2024
1 parent dc21c6c commit c1193d9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/netfilter/ipset/ip_set_list_set.c
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,9 @@ list_set_cancel_gc(struct ip_set *set)

if (SET_WITH_TIMEOUT(set))
timer_shutdown_sync(&map->gc);

/* Flush list to drop references to other ipsets */
list_set_flush(set);
}

static const struct ip_set_type_variant set_variant = {
Expand Down

0 comments on commit c1193d9

Please sign in to comment.