]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
netfilter: ipset: add missing range check in bitmap_ip_uadt
authorJeongjun Park <aha310510@gmail.com>
Wed, 13 Nov 2024 13:02:09 +0000 (22:02 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Dec 2024 09:59:39 +0000 (10:59 +0100)
commit3c20b5948f119ae61ee35ad8584d666020c91581
treebab722c8313be13a5590783079421ed54228bd58
parent80cf84dd61babdf011dd79dbb8d4d85e1315a012
netfilter: ipset: add missing range check in bitmap_ip_uadt

commit 35f56c554eb1b56b77b3cf197a6b00922d49033d upstream.

When tb[IPSET_ATTR_IP_TO] is not present but tb[IPSET_ATTR_CIDR] exists,
the values of ip and ip_to are slightly swapped. Therefore, the range check
for ip should be done later, but this part is missing and it seems that the
vulnerability occurs.

So we should add missing range checks and remove unnecessary range checks.

Cc: <stable@vger.kernel.org>
Reported-by: syzbot+58c872f7790a4d2ac951@syzkaller.appspotmail.com
Fixes: 72205fc68bd1 ("netfilter: ipset: bitmap:ip set type support")
Signed-off-by: Jeongjun Park <aha310510@gmail.com>
Acked-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/netfilter/ipset/ip_set_bitmap_ip.c