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_delay value.
Fixes: f4661458116b ("ipvlan: Introduce local xmit queue for l2e mode") Signed-off-by: Keefe Liu liuqifa@huawei.com Reviewed-by: Wei Yongjun weiyongjun1@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 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 637290e9cb59..135e1e0e3ac1 100644 --- a/drivers/net/ipvlan/ipvlan_main.c +++ b/drivers/net/ipvlan/ipvlan_main.c @@ -6,6 +6,9 @@
#include "ipvlan.h"
+static int one = 1; +static int delay_max = 100; + int sysctl_ipvlan_loop_qlen = 131072; int sysctl_ipvlan_loop_delay = 10; static int ipvlan_default_mode = IPVLAN_MODE_L3; @@ -19,7 +22,9 @@ static struct ctl_table ipvlan_table[] = { .data = &sysctl_ipvlan_loop_delay, .maxlen = sizeof(int), .mode = 0644, - .proc_handler = proc_dointvec, + .proc_handler = proc_dointvec_minmax, + .extra1 = &one, + .extra2 = &delay_max, }, { .procname = "loop_qlen",