linux-brain/net/netfilter/ipset
Vasily Averin c8dd8af4b3 netfilter: ipset: fixes possible oops in mtype_resize
[ Upstream commit 2b33d6ffa9e38f344418976b06057e2fc2aa9e2a ]

currently mtype_resize() can cause oops

        t = ip_set_alloc(htable_size(htable_bits));
        if (!t) {
                ret = -ENOMEM;
                goto out;
        }
        t->hregion = ip_set_alloc(ahash_sizeof_regions(htable_bits));

Increased htable_bits can force htable_size() to return 0.
In own turn ip_set_alloc(0) returns not 0 but ZERO_SIZE_PTR,
so follwoing access to t->hregion should trigger an OOPS.

Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
Acked-by: Jozsef Kadlecsik <kadlec@netfilter.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-01-19 18:26:14 +01:00
..
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ip_set_bitmap_gen.h netfilter: ipset: use bitmap infrastructure completely 2020-01-29 16:45:33 +01:00
ip_set_bitmap_ip.c netfilter: ipset: call ip_set_free() instead of kfree() 2020-07-16 08:16:37 +02:00
ip_set_bitmap_ipmac.c netfilter: ipset: call ip_set_free() instead of kfree() 2020-07-16 08:16:37 +02:00
ip_set_bitmap_port.c netfilter: ipset: call ip_set_free() instead of kfree() 2020-07-16 08:16:37 +02:00
ip_set_core.c netfilter: ipset: prevent uninit-value in hash_ip6_add 2020-12-11 13:23:32 +01:00
ip_set_getport.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2019-06-25 01:32:59 +02:00
ip_set_hash_gen.h netfilter: ipset: fixes possible oops in mtype_resize 2021-01-19 18:26:14 +01:00
ip_set_hash_ip.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2019-06-25 01:32:59 +02:00
ip_set_hash_ipmac.c netfilter: ipset: Copy the right MAC address in hash:ip,mac IPv6 sets 2019-11-04 20:45:53 +01:00
ip_set_hash_ipmark.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2019-06-25 01:32:59 +02:00
ip_set_hash_ipport.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2019-06-25 01:32:59 +02:00
ip_set_hash_ipportip.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2019-06-25 01:32:59 +02:00
ip_set_hash_ipportnet.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2019-06-25 01:32:59 +02:00
ip_set_hash_mac.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2019-06-25 01:32:59 +02:00
ip_set_hash_net.c netfilter: ipset: Fix nla_policies to fully support NL_VALIDATE_STRICT 2019-11-04 20:46:13 +01:00
ip_set_hash_netiface.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2019-06-25 01:32:59 +02:00
ip_set_hash_netnet.c netfilter: ipset: Fix nla_policies to fully support NL_VALIDATE_STRICT 2019-11-04 20:46:13 +01:00
ip_set_hash_netport.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2019-06-25 01:32:59 +02:00
ip_set_hash_netportnet.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2019-06-25 01:32:59 +02:00
ip_set_list_set.c netfilter: ipset: Fix subcounter update skip 2020-06-03 08:21:34 +02:00
pfxlen.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00