summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Maltsev <keltar.gw@gmail.com>2024-04-17 18:51:41 +0500
committerJozsef Kadlecsik <kadlec@netfilter.org>2024-05-28 14:43:43 +0200
commit975403cda657f3ff8f1194b928afe974fc827490 (patch)
tree0b2cd23b4e26f51dd5f40ff98aba3bf853ca57ff
parent66422c27abfdc1c803e3d9a0f60f20d8dbefc95e (diff)
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. Signed-off-by: Alexander Maltsev <keltar.gw@gmail.com> Signed-off-by: Jozsef Kadlecsik <kadlec@netfilter.org>
-rw-r--r--kernel/net/netfilter/ipset/ip_set_list_set.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/net/netfilter/ipset/ip_set_list_set.c b/kernel/net/netfilter/ipset/ip_set_list_set.c
index cc2e5b9..0d15f4f 100644
--- a/kernel/net/netfilter/ipset/ip_set_list_set.c
+++ b/kernel/net/netfilter/ipset/ip_set_list_set.c
@@ -552,6 +552,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 = {