]> git.hungrycats.org Git - linux/commit
netfilter: ipset: fix hash:net,port,net hang with /0 subnet
authorJozsef Kadlecsik <kadlec@netfilter.org>
Fri, 30 Dec 2022 12:24:37 +0000 (13:24 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Jan 2023 11:00:39 +0000 (12:00 +0100)
commitcc8f96fb7a53c64c7f3c39ba81a81cc596b95581
tree465a82b3c66d57816f9ebdc3adad8e7952e4aad2
parentbb913f51f2f0648bb67e5aa3135aa166c030755b
netfilter: ipset: fix hash:net,port,net hang with /0 subnet

[ Upstream commit a31d47be64b9b74f8cfedffe03e0a8a1f9e51f23 ]

The hash:net,port,net set type supports /0 subnets. However, the patch
commit 5f7b51bf09baca8e titled "netfilter: ipset: Limit the maximal range
of consecutive elements to add/delete" did not take into account it and
resulted in an endless loop. The bug is actually older but the patch
5f7b51bf09baca8e brings it out earlier.

Handle /0 subnets properly in hash:net,port,net set types.

Fixes: 5f7b51bf09ba ("netfilter: ipset: Limit the maximal range of consecutive elements to add/delete")
Reported-by: Марк Коренберг <socketpair@gmail.com>
Signed-off-by: Jozsef Kadlecsik <kadlec@netfilter.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/netfilter/ipset/ip_set_hash_netportnet.c