From: Keefe LIU liuqifa@huawei.com
hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I8KDQE 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 Signed-off-by: Zhengchao Shao shaozhengchao@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 135e1e0e3ac1..073e135cd9c9 100644 --- a/drivers/net/ipvlan/ipvlan_main.c +++ b/drivers/net/ipvlan/ipvlan_main.c @@ -8,6 +8,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; @@ -31,7 +34,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, }, { } };