Skip to content

Commit 82b6a36

Browse files
pvts-matPlaidCat
authored andcommitted
netfilter: ipset: add the missing IP_SET_HASH_WITH_NET0 macro for ip_set_hash_netportnet.c
jira VULN-6670 cve CVE-2023-42753 commit-author Kyle Zeng <[email protected]> commit 050d91c 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: 886503f ("netfilter: ipset: actually allow allowable CIDR 0 in hash:net,port,net") Suggested-by: Jozsef Kadlecsik <[email protected]> Signed-off-by: Kyle Zeng <[email protected]> Acked-by: Jozsef Kadlecsik <[email protected]> Signed-off-by: Florian Westphal <[email protected]> (cherry picked from commit 050d91c) Signed-off-by: Marcin Wcisło <[email protected]>
1 parent 0fcfced commit 82b6a36

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

net/netfilter/ipset/ip_set_hash_netportnet.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ MODULE_ALIAS("ip_set_hash:net,port,net");
3636
#define IP_SET_HASH_WITH_PROTO
3737
#define IP_SET_HASH_WITH_NETS
3838
#define IPSET_NET_COUNT 2
39+
#define IP_SET_HASH_WITH_NET0
3940

4041
/* IPv4 variant */
4142

0 commit comments

Comments
 (0)