]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: ipset: Fix forceadd evaluation path
authorJozsef Kadlecsik <kadlec@netfilter.org>
Sat, 22 Feb 2020 11:01:43 +0000 (12:01 +0100)
committerJozsef Kadlecsik <kadlec@netfilter.org>
Sat, 22 Feb 2020 11:13:45 +0000 (12:13 +0100)
commit532d2d914ae4a297e77b9a58237ddbe14ae6081e
tree3dd963d34f4d280fe5c878f0a96be6ab7a4d3f72
parent83ac0900d9a0e08be5ecc96f120c7cd1577017a9
netfilter: ipset: Fix forceadd evaluation path

When the forceadd option is enabled, the hash:* types should find and replace
the first entry in the bucket with the new one if there are no reuseable
(deleted or timed out) entries. However, the position index was just not set
to zero and remained the invalid -1 if there were no reuseable entries.

Reported-by: syzbot+6a86565c74ebe30aea18@syzkaller.appspotmail.com
Fixes: e1758582b764 ("netfilter: ipset: Introduction of new commands and protocol version 7")
Signed-off-by: Jozsef Kadlecsik <kadlec@netfilter.org>
net/netfilter/ipset/ip_set_hash_gen.h