]> git.itanic.dy.fi Git - linux-stable/commit
netfilter: ipset: Fix forceadd evaluation path
authorJozsef Kadlecsik <kadlec@netfilter.org>
Sat, 22 Feb 2020 11:01:43 +0000 (12:01 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Mar 2020 15:45:17 +0000 (16:45 +0100)
commitd2997d64dfa65082236bca1efd596b6c935daf5e
treebd6e4b4fdf353461ae4f7abbfbf8d1e90c7350ca
parent54cd3ad4d9ccad89b986248a670eab359ef9b8dd
netfilter: ipset: Fix forceadd evaluation path

commit 8af1c6fbd9239877998c7f5a591cb2c88d41fb66 upstream.

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: 23c42a403a9c ("netfilter: ipset: Introduction of new commands and protocol version 7")
Signed-off-by: Jozsef Kadlecsik <kadlec@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/netfilter/ipset/ip_set_hash_gen.h