]> git.ipfire.org Git - thirdparty/linux.git/commit
netfilter: ipset: Fix data race between add and dump in all hash types
authorJozsef Kadlecsik <kadlec@netfilter.org>
Fri, 8 May 2026 20:58:58 +0000 (22:58 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Sat, 16 May 2026 11:21:42 +0000 (13:21 +0200)
commit2358f7427ccd6ec8867a48205d8fcec973683a3f
tree9a5e015d743f16f4ebdfd069e84ec6c7f7704232
parentc0c42a0fb27144c1cd7509f94bec0d3bcca98c72
netfilter: ipset: Fix data race between add and dump in all hash types

When adding a new entry to the next position in the existing hash bucket,
the position index was incremented too early and parallel dump could
read it before the entry was populated with the value. Move the setting
of the position index after populating the entry.

v2: Position counting fixed, noticed by Florian Westphal.

Fixes: 18f84d41d34f ("netfilter: ipset: Introduce RCU locking in hash:* types")
Reported-by: syzbot+786c889f046e8b003ca6@syzkaller.appspotmail.com
Reported-by: syzbot+1da17e4b41d795df059e@syzkaller.appspotmail.com
Reported-by: syzbot+421c5f3ff8e9493084d9@syzkaller.appspotmail.com
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