aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/net/sched/sch_choke.c
diff options
context:
space:
mode:
authorRandy Dunlap <rdunlap@infradead.org>2020-12-24 22:23:44 -0800
committerDavid S. Miller <davem@davemloft.net>2020-12-28 14:52:54 -0800
commitbd1248f1ddbc48b0c30565fce897a3b6423313b8 (patch)
treec08520951cacf6b5c2912d59a138662a68fcd962 /net/sched/sch_choke.c
parentnet: neighbor: fix a crash caused by mod zero (diff)
downloadwireguard-linux-bd1248f1ddbc48b0c30565fce897a3b6423313b8.tar.xz
wireguard-linux-bd1248f1ddbc48b0c30565fce897a3b6423313b8.zip
net: sched: prevent invalid Scell_log shift count
Check Scell_log shift size in red_check_params() and modify all callers of red_check_params() to pass Scell_log. This prevents a shift out-of-bounds as detected by UBSAN: UBSAN: shift-out-of-bounds in ./include/net/red.h:252:22 shift exponent 72 is too large for 32-bit type 'int' Fixes: 8afa10cbe281 ("net_sched: red: Avoid illegal values") Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Reported-by: syzbot+97c5bd9cc81eca63d36e@syzkaller.appspotmail.com Cc: Nogah Frankel <nogahf@mellanox.com> Cc: Jamal Hadi Salim <jhs@mojatatu.com> Cc: Cong Wang <xiyou.wangcong@gmail.com> Cc: Jiri Pirko <jiri@resnulli.us> Cc: netdev@vger.kernel.org Cc: "David S. Miller" <davem@davemloft.net> Cc: Jakub Kicinski <kuba@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/sch_choke.c')
-rw-r--r--net/sched/sch_choke.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/sched/sch_choke.c b/net/sched/sch_choke.c
index bd618b00d319..50f680f03a54 100644
--- a/net/sched/sch_choke.c
+++ b/net/sched/sch_choke.c
@@ -362,7 +362,7 @@ 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))
+ if (!red_check_params(ctl->qth_min, ctl->qth_max, ctl->Wlog, ctl->Scell_log))
return -EINVAL;
if (ctl->limit > CHOKE_MAX_QUEUE)