Skip to content
Commit e632d09d authored by Kyle Zeng's avatar Kyle Zeng Committed by Greg Kroah-Hartman
Browse files

netfilter: ipset: add the missing IP_SET_HASH_WITH_NET0 macro for ip_set_hash_netportnet.c

commit 050d91c0 upstream.

The missing IP_SET_HASH_WITH_NET0 macro in ip_set_hash_netportnet can
lead to the use of wrong `CIDR_POS(c)` for calculating array offsets,
which can lead to integer underflow. As a result, it leads to slab
out-of-bound access.
This patch adds back the IP_SET_HASH_WITH_NET0 macro to
ip_set_hash_netportnet to address the issue.

Fixes: 886503f3

 ("netfilter: ipset: actually allow allowable CIDR 0 in hash:net,port,net")
Suggested-by: default avatarJozsef Kadlecsik <kadlec@netfilter.org>
Signed-off-by: default avatarKyle Zeng <zengyhkyle@gmail.com>
Acked-by: default avatarJozsef Kadlecsik <kadlec@netfilter.org>
Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 76ce657a
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment