]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
netfilter: ipset: Don't use test_bit() in lockless RCU readers in hash types
authorJozsef Kadlecsik <kadlec@netfilter.org>
Wed, 17 Jun 2026 08:41:22 +0000 (10:41 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Sat, 20 Jun 2026 22:18:26 +0000 (00:18 +0200)
commite4b4984e28c16406ecb318444dea4a8bf47def3e
tree81cc2d70e9364e5a896ebcd6f418f2884c77e8cc
parentf4c2d8668d85ed125985da663c824a9c25498257
netfilter: ipset: Don't use test_bit() in lockless RCU readers in hash types

Sashiko pointed out that there are a few lockless RCU readers
using test_bit() which is a relaxed atomic operation and
provides no memory barrier guarantees. Use test_bit_acquire()
instead where the operation may run parallel with add/del/gc,
i.e. is not one from the next cases

- protected by region lock
- in a set destroy phase
- in a new/temporary set creation phase

Fixes: 18f84d41d34f ("netfilter: ipset: Introduce RCU locking in hash:* types")
Signed-off-by: Jozsef Kadlecsik <kadlec@netfilter.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/ipset/ip_set_hash_gen.h