aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/sch_sfq.c
diff options
context:
space:
mode:
authorNogah Frankel <nogahf@mellanox.com>2017-12-04 13:31:11 +0200
committerDavid S. Miller <davem@davemloft.net>2017-12-05 14:37:13 -0500
commit8afa10cbe281b10371fee5a87ab266e48d71a7f9 (patch)
treef821390027974ff7b78d22df3862e181bea9d2ca /net/sched/sch_sfq.c
parent5c472203421ab4f928aa1ae9e1dbcfdd80324148 (diff)
downloadlinux-8afa10cbe281b10371fee5a87ab266e48d71a7f9.tar.gz
net_sched: red: Avoid illegal values
Check the qmin & qmax values doesn't overflow for the given Wlog value. Check that qmin <= qmax. Fixes: a783474591f2 ("[PKT_SCHED]: Generic RED layer") Signed-off-by: Nogah Frankel <nogahf@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/sch_sfq.c')
-rw-r--r--net/sched/sch_sfq.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/sched/sch_sfq.c b/net/sched/sch_sfq.c
index 09c1203c171198..930e5bd26d3d76 100644
--- a/net/sched/sch_sfq.c
+++ b/net/sched/sch_sfq.c
@@ -639,6 +639,9 @@ static int sfq_change(struct Qdisc *sch, struct nlattr *opt)
if (ctl->divisor &&
(!is_power_of_2(ctl->divisor) || ctl->divisor > 65536))
return -EINVAL;
+ if (ctl_v1 && !red_check_params(ctl_v1->qth_min, ctl_v1->qth_max,
+ ctl_v1->Wlog))
+ return -EINVAL;
if (ctl_v1 && ctl_v1->qth_min) {
p = kmalloc(sizeof(*p), GFP_KERNEL);
if (!p)