linux/net/netfilter/ipset
Jozsef Kadlecsik 97f7cf1cd8 netfilter: ipset: fix performance regression in swap operation
The patch "netfilter: ipset: fix race condition between swap/destroy
and kernel side add/del/test", commit 28628fa9 fixes a race condition.
But the synchronize_rcu() added to the swap function unnecessarily slows
it down: it can safely be moved to destroy and use call_rcu() instead.

Eric Dumazet pointed out that simply calling the destroy functions as
rcu callback does not work: sets with timeout use garbage collectors
which need cancelling at destroy which can wait. Therefore the destroy
functions are split into two: cancelling garbage collectors safely at
executing the command received by netlink and moving the remaining
part only into the rcu callback.

Link: https://lore.kernel.org/lkml/C0829B10-EAA6-4809-874E-E1E9C05A8D84@automattic.com/
Fixes: 28628fa952 ("netfilter: ipset: fix race condition between swap/destroy and kernel side add/del/test")
Reported-by: Ale Crismani <ale.crismani@automattic.com>
Reported-by: David Wang <00107082@163.com>
Tested-by: David Wang <00107082@163.com>
Signed-off-by: Jozsef Kadlecsik <kadlec@netfilter.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2024-01-31 23:13:57 +01:00
..
ip_set_bitmap_gen.h netfilter: ipset: fix performance regression in swap operation 2024-01-31 23:13:57 +01:00
ip_set_bitmap_ip.c netfilter: ipset: Fix overflow before widen in the bitmap_ip_create() function. 2023-01-11 19:18:04 +01:00
ip_set_bitmap_ipmac.c netfilter: ipset: call ip_set_free() instead of kfree() 2020-06-30 19:09:56 +02:00
ip_set_bitmap_port.c netfilter: ipset: call ip_set_free() instead of kfree() 2020-06-30 19:09:56 +02:00
ip_set_core.c netfilter: ipset: fix performance regression in swap operation 2024-01-31 23:13:57 +01:00
ip_set_getport.c netfilter: ipset: move ip_set_get_ip_port() to ip_set_bitmap_port.c. 2019-10-07 23:59:02 +02:00
ip_set_hash_gen.h netfilter: ipset: fix performance regression in swap operation 2024-01-31 23:13:57 +01:00
ip_set_hash_ip.c netfilter: ipset: Rework long task execution when adding/deleting entries 2023-01-02 15:10:05 +01:00
ip_set_hash_ipmac.c netfilter: ipset: Expose the initval hash parameter to userspace 2020-10-31 11:55:38 +01:00
ip_set_hash_ipmark.c netfilter: ipset: Rework long task execution when adding/deleting entries 2023-01-02 15:10:05 +01:00
ip_set_hash_ipport.c netfilter: ipset: Rework long task execution when adding/deleting entries 2023-01-02 15:10:05 +01:00
ip_set_hash_ipportip.c netfilter: ipset: Rework long task execution when adding/deleting entries 2023-01-02 15:10:05 +01:00
ip_set_hash_ipportnet.c netfilter: ipset: Rework long task execution when adding/deleting entries 2023-01-02 15:10:05 +01:00
ip_set_hash_mac.c netfilter: ipset: Expose the initval hash parameter to userspace 2020-10-31 11:55:38 +01:00
ip_set_hash_net.c netfilter: ipset: Rework long task execution when adding/deleting entries 2023-01-02 15:10:05 +01:00
ip_set_hash_netiface.c netfilter: propagate net to nf_bridge_get_physindev 2024-01-17 12:02:48 +01:00
ip_set_hash_netnet.c netfilter: ipset: Rework long task execution when adding/deleting entries 2023-01-02 15:10:05 +01:00
ip_set_hash_netport.c netfilter: ipset: Rework long task execution when adding/deleting entries 2023-01-02 15:10:05 +01:00
ip_set_hash_netportnet.c netfilter: ipset: add the missing IP_SET_HASH_WITH_NET0 macro for ip_set_hash_netportnet.c 2023-09-06 18:09:12 +02:00
ip_set_list_set.c netfilter: ipset: fix performance regression in swap operation 2024-01-31 23:13:57 +01:00
Kconfig net: Kconfig: fix spellos 2023-01-25 22:39:56 -08:00
Makefile
pfxlen.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00