Randy Dunlap e94775ddee net: sched: prevent invalid Scell_log shift count
[ Upstream commit bd1248f1ddbc48b0c30565fce897a3b6423313b8 ]

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-01-12 20:10:20 +01:00
..
2019-07-03 13:14:42 +02:00
2018-01-19 14:02:12 -05:00
2019-06-17 19:51:56 +02:00
2019-03-23 20:09:51 +01:00
2019-02-23 09:07:27 +01:00
2018-02-28 11:43:28 -05:00
2019-11-10 11:27:54 +01:00
2020-07-22 09:31:58 +02:00
2017-12-11 14:10:06 -05:00
2019-03-10 07:17:19 +01:00
2019-11-20 18:46:35 +01:00
2018-06-18 22:40:32 +02:00
2018-04-07 22:32:31 -04:00
2017-11-08 16:12:33 +09:00
2018-05-16 07:23:35 +02:00
2018-05-16 07:23:35 +02:00
2018-05-31 22:48:46 -04:00
2018-06-22 13:43:27 +09:00
2018-06-22 13:43:27 +09:00
2020-05-20 08:18:38 +02:00
2018-04-17 13:53:13 -04:00