Commit e56bee92 authored by Andrea Claudi's avatar Andrea Claudi Committed by Zheng Zengkai
Browse files

ipvs: check that ip_vs_conn_tab_bits is between 8 and 20

stable inclusion
from stable-5.10.71
commit 12cbdaeeb5d4dfde7a8c2f9eed93bcfa4f4653cd
bugzilla: 182981 https://gitee.com/openeuler/kernel/issues/I4I3KD

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=12cbdaeeb5d4dfde7a8c2f9eed93bcfa4f4653cd



--------------------------------

[ Upstream commit 69e73dbf ]

ip_vs_conn_tab_bits may be provided by the user through the
conn_tab_bits module parameter. If this value is greater than 31, or
less than 0, the shift operator used to derive tab_size causes undefined
behaviour.

Fix this checking ip_vs_conn_tab_bits value to be in the range specified
in ipvs Kconfig. If not, simply use default value.

Fixes: 6f7edb48 ("IPVS: Allow boot time change of hash size")
Reported-by: default avatarYi Chen <yiche@redhat.com>
Signed-off-by: default avatarAndrea Claudi <aclaudi@redhat.com>
Acked-by: default avatarJulian Anastasov <ja@ssi.bg>
Acked-by: default avatarSimon Horman <horms@verge.net.au>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarChen Jun <chenjun102@huawei.com>
Acked-by: default avatarWeilong Chen <chenweilong@huawei.com>

Signed-off-by: default avatarChen Jun <chenjun102@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent dac0b3a4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment