diff options
author | Nogah Frankel <nogahf@mellanox.com> | 2017-12-04 12:31:11 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-12-05 20:37:13 +0100 |
commit | 8afa10cbe281b10371fee5a87ab266e48d71a7f9 (patch) | |
tree | f821390027974ff7b78d22df3862e181bea9d2ca /net/sched/sch_choke.c | |
parent | net_sched: red: Avoid devision by zero (diff) | |
download | linux-8afa10cbe281b10371fee5a87ab266e48d71a7f9.tar.xz linux-8afa10cbe281b10371fee5a87ab266e48d71a7f9.zip |
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_choke.c')
-rw-r--r-- | net/sched/sch_choke.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/sched/sch_choke.c b/net/sched/sch_choke.c index b30a2c70bd48..531250fceb9e 100644 --- a/net/sched/sch_choke.c +++ b/net/sched/sch_choke.c @@ -369,6 +369,9 @@ static int choke_change(struct Qdisc *sch, struct nlattr *opt) ctl = nla_data(tb[TCA_CHOKE_PARMS]); + if (!red_check_params(ctl->qth_min, ctl->qth_max, ctl->Wlog)) + return -EINVAL; + if (ctl->limit > CHOKE_MAX_QUEUE) return -EINVAL; |