summaryrefslogtreecommitdiff
path: root/net/sched/sch_red.c
diff options
context:
space:
mode:
authorNogah Frankel <nogahf@mellanox.com>2017-12-04 14:31:11 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-02-25 13:03:40 +0300
commit27d2bda4f592e1cc838d93f1d94eb8ddb372fceb (patch)
tree73d3775228d4c1b92249be1ecbbd05fde80b2722 /net/sched/sch_red.c
parentba51edae4b38ed49fafd7276440b43faf5cde29e (diff)
downloadlinux-27d2bda4f592e1cc838d93f1d94eb8ddb372fceb.tar.xz
net_sched: red: Avoid illegal values
[ Upstream commit 8afa10cbe281b10371fee5a87ab266e48d71a7f9 ] 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> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/sched/sch_red.c')
-rw-r--r--net/sched/sch_red.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/sched/sch_red.c b/net/sched/sch_red.c
index 8c0508c0e287..0505b8408c8b 100644
--- a/net/sched/sch_red.c
+++ b/net/sched/sch_red.c
@@ -199,6 +199,8 @@ static int red_change(struct Qdisc *sch, struct nlattr *opt)
max_P = tb[TCA_RED_MAX_P] ? nla_get_u32(tb[TCA_RED_MAX_P]) : 0;
ctl = nla_data(tb[TCA_RED_PARMS]);
+ if (!red_check_params(ctl->qth_min, ctl->qth_max, ctl->Wlog))
+ return -EINVAL;
if (ctl->limit > 0) {
child = fifo_create_dflt(sch, &bfifo_qdisc_ops, ctl->limit);