]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Fixes for 6.1
authorSasha Levin <sashal@kernel.org>
Wed, 7 Aug 2024 19:08:58 +0000 (15:08 -0400)
committerSasha Levin <sashal@kernel.org>
Wed, 7 Aug 2024 19:09:49 +0000 (15:09 -0400)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-6.1/netfilter-ipset-add-list-flush-to-cancel_gc.patch [new file with mode: 0644]
queue-6.1/series

diff --git a/queue-6.1/netfilter-ipset-add-list-flush-to-cancel_gc.patch b/queue-6.1/netfilter-ipset-add-list-flush-to-cancel_gc.patch
new file mode 100644 (file)
index 0000000..cf3984b
--- /dev/null
@@ -0,0 +1,39 @@
+From 463e65cd03753cc09f9c79547a830ffbe652c057 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 17 Apr 2024 18:51:41 +0500
+Subject: netfilter: ipset: Add list flush to cancel_gc
+
+From: Alexander Maltsev <keltar.gw@gmail.com>
+
+[ Upstream commit c1193d9bbbd379defe9be3c6de566de684de8a6f ]
+
+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: 97f7cf1cd80e ("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>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ net/netfilter/ipset/ip_set_list_set.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/net/netfilter/ipset/ip_set_list_set.c b/net/netfilter/ipset/ip_set_list_set.c
+index e839c356bcb56..902ff2f3bc72b 100644
+--- a/net/netfilter/ipset/ip_set_list_set.c
++++ b/net/netfilter/ipset/ip_set_list_set.c
+@@ -547,6 +547,9 @@ list_set_cancel_gc(struct ip_set *set)
+       if (SET_WITH_TIMEOUT(set))
+               del_timer_sync(&map->gc);
++
++      /* Flush list to drop references to other ipsets */
++      list_set_flush(set);
+ }
+ static const struct ip_set_type_variant set_variant = {
+-- 
+2.43.0
+
index 19b65df23eea32b7bea9954b46f1080f01cd0a9b..b98ed62a2766821e2928487458260895508b56cd 100644 (file)
@@ -84,3 +84,4 @@ mptcp-fix-bad-rcvpruned-mib-accounting.patch
 mptcp-pm-only-set-request_bkup-flag-when-sending-mp_prio.patch
 mptcp-fix-duplicate-data-handling.patch
 selftests-mptcp-always-close-input-s-fd-if-opened.patch
+netfilter-ipset-add-list-flush-to-cancel_gc.patch