Loading
netfilter: conntrack: clamp maximum hashtable size to INT_MAX
stable inclusion from stable-v6.6.72 commit d5807dd1328bbc86e059c5de80d1bbee9d58ca3d category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/IBIQQN CVE: CVE-2025-21648 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=d5807dd1328bbc86e059c5de80d1bbee9d58ca3d -------------------------------- [ Upstream commit b541ba7d1f5a5b7b3e2e22dc9e40e18a7d6dbc13 ] Use INT_MAX as maximum size for the conntrack hashtable. Otherwise, it is possible to hit WARN_ON_ONCE in __kvmalloc_node_noprof() when resizing hashtable because __GFP_NOWARN is unset. See: 0708a0af ("mm: Consider __GFP_NOWARN flag for oversized kvmalloc() calls") Note: hashtable resize is only possible from init_netns. Fixes: 9cc1c73a ("netfilter: conntrack: avoid integer overflow when resizing") Signed-off-by:Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by:
Sasha Levin <sashal@kernel.org> Signed-off-by:
Dong Chenchen <dongchenchen2@huawei.com>