
From: Keefe LIU <liuqifa@huawei.com> hulk inclusion category: bugfix bugzilla: 4411, https://gitee.com/openeuler/kernel/issues/I4IHL1 CVE: NA ------------------------------------------------- In order to avoid integer overflow, we should limit the ranges of loop_qlen value. Fixes: 997518dea253 ("ipvlan: Introduce local xmit queue for l2e mode") Signed-off-by: Keefe Liu <liuqifa@huawei.com> Reviewed-by: Yang Yingliang <yangyingliang@huawei.com> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Signed-off-by: Lu Wei <luwei32@huawei.com> Reviewed-by: Yue Haibing <yuehaibing@huawei.com> Reviewed-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Zheng Zengkai <zhengzengkai@huawei.com> --- drivers/net/ipvlan/ipvlan_main.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/ipvlan/ipvlan_main.c b/drivers/net/ipvlan/ipvlan_main.c index 03812c95356b..d6edc6cf057c 100644 --- a/drivers/net/ipvlan/ipvlan_main.c +++ b/drivers/net/ipvlan/ipvlan_main.c @@ -6,6 +6,9 @@ static int one = 1; static int delay_max = 100; +/* set loop queue length from 0 to 10 big packets(65536) */ +static int qlen_min; +static int qlen_max = 655360; int sysctl_ipvlan_loop_qlen = 131072; int sysctl_ipvlan_loop_delay = 10; @@ -29,7 +32,9 @@ static struct ctl_table ipvlan_table[] = { .data = &sysctl_ipvlan_loop_qlen, .maxlen = sizeof(int), .mode = 0644, - .proc_handler = proc_dointvec, + .proc_handler = proc_dointvec_minmax, + .extra1 = &qlen_min, + .extra2 = &qlen_max, }, { } }; -- 2.20.1