Eric Dumazet
60a427aa94
sch_red: fix off-by-one checks in red_check_params()
[ Upstream commit 3a87571f0f ]
This fixes following syzbot report:
UBSAN: shift-out-of-bounds in ./include/net/red.h:237:23
shift exponent 32 is too large for 32-bit type 'unsigned int'
CPU: 1 PID: 8418 Comm: syz-executor170 Not tainted 5.12.0-rc4-next-20210324-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:79 [inline]
dump_stack+0x141/0x1d7 lib/dump_stack.c:120
ubsan_epilogue+0xb/0x5a lib/ubsan.c:148
__ubsan_handle_shift_out_of_bounds.cold+0xb1/0x181 lib/ubsan.c:327
red_set_parms include/net/red.h:237 [inline]
choke_change.cold+0x3c/0xc8 net/sched/sch_choke.c:414
qdisc_create+0x475/0x12f0 net/sched/sch_api.c:1247
tc_modify_qdisc+0x4c8/0x1a50 net/sched/sch_api.c:1663
rtnetlink_rcv_msg+0x44e/0xad0 net/core/rtnetlink.c:5553
netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2502
netlink_unicast_kernel net/netlink/af_netlink.c:1312 [inline]
netlink_unicast+0x533/0x7d0 net/netlink/af_netlink.c:1338
netlink_sendmsg+0x856/0xd90 net/netlink/af_netlink.c:1927
sock_sendmsg_nosec net/socket.c:654 [inline]
sock_sendmsg+0xcf/0x120 net/socket.c:674
____sys_sendmsg+0x6e8/0x810 net/socket.c:2350
___sys_sendmsg+0xf3/0x170 net/socket.c:2404
__sys_sendmsg+0xe5/0x1b0 net/socket.c:2433
do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x43f039
Code: 28 c3 e8 2a 14 00 00 66 2e 0f 1f 84 00 00 00 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffdfa725168 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 0000000000400488 RCX: 000000000043f039
RDX: 0000000000000000 RSI: 0000000020000040 RDI: 0000000000000004
RBP: 0000000000403020 R08: 0000000000400488 R09: 0000000000400488
R10: 0000000000400488 R11: 0000000000000246 R12: 00000000004030b0
R13: 0000000000000000 R14: 00000000004ac018 R15: 0000000000400488
Fixes: 8afa10cbe2 ("net_sched: red: Avoid illegal values")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-05-16 10:51:42 +09:00
..
2015-04-11 22:28:27 -04:00
2023-05-16 09:27:52 +09:00
2023-05-15 12:38:05 +09:00
2014-12-10 15:33:16 -05:00
2015-09-21 16:03:04 -07:00
2023-05-16 09:04:25 +09:00
2023-05-15 14:18:16 +09:00
2023-05-15 08:24:46 +09:00
2023-05-15 12:05:35 +09:00
2023-05-16 08:21:01 +09:00
2023-05-12 17:06:33 +09:00
2016-06-15 20:41:22 -07:00
2023-05-15 17:29:41 +09:00
2023-05-16 08:45:22 +09:00
2015-09-17 13:20:05 +02:00
2016-09-08 11:10:12 +01:00
2016-09-04 13:29:29 -07:00
2023-05-12 16:57:03 +09:00
2014-09-18 10:54:36 +02:00
2023-05-15 13:41:16 +09:00
2023-05-15 11:43:44 +09:00
2016-02-09 04:45:49 -05:00
2014-11-10 13:27:49 -05:00
2015-07-27 01:05:24 -07:00
2023-05-16 09:50:45 +09:00
2015-11-18 16:17:38 -05:00
2016-06-27 15:06:17 -04:00
2023-05-15 16:33:59 +09:00
2016-07-08 12:20:57 +02:00
2016-03-13 15:01:00 -04:00
2017-02-18 15:11:41 +01:00
2016-04-19 20:09:25 -04:00
2016-04-25 16:44:27 -04:00
2016-06-25 12:19:35 -04:00
2016-04-25 16:44:27 -04:00
2016-06-09 23:41:03 -07:00
2014-02-09 17:32:50 -08:00
2013-12-06 12:37:56 -05:00
2015-03-06 21:50:02 -05:00
2016-08-26 11:55:18 -07:00
2013-12-10 21:50:00 -05:00
2015-09-17 17:18:37 -07:00
2014-02-09 17:32:49 -08:00
2014-02-09 17:32:49 -08:00
2016-09-23 08:38:50 -04:00
2016-02-16 20:21:48 -05:00
2016-09-10 20:53:55 -07:00
2015-10-08 04:27:02 -07:00
2023-05-16 08:30:05 +09:00
2013-11-07 19:28:58 -05:00
2015-09-23 15:33:15 -07:00
2023-05-15 17:09:01 +09:00
2023-05-15 17:01:38 +09:00
2017-01-27 13:55:59 -08:00
2014-02-12 07:02:11 +01:00
2016-05-20 18:03:16 -04:00
2023-05-15 14:57:24 +09:00
2023-05-15 14:57:24 +09:00
2016-06-07 16:37:14 -07:00
2023-05-16 08:30:10 +09:00
2016-06-17 20:23:32 -07:00
2016-08-18 01:17:32 -04:00
2023-05-15 11:55:36 +09:00
2016-07-25 17:55:43 -07:00
2014-11-05 16:30:03 -05:00
2016-03-14 12:19:46 -04:00
2023-05-16 10:39:14 +09:00
2016-09-12 11:45:45 +02:00
2016-01-04 20:40:41 +01:00
2016-10-14 10:59:15 -04:00
2015-12-15 23:25:20 -05:00
2016-03-22 15:45:44 -04:00
2016-04-04 22:11:20 -04:00
2016-05-20 18:03:17 -04:00
2023-05-16 09:05:47 +09:00
2023-05-16 09:51:15 +09:00
2023-05-15 12:36:15 +09:00
2023-05-15 16:21:53 +09:00
2023-05-15 09:02:06 +09:00
2018-05-16 10:08:41 +02:00
2023-05-15 11:43:33 +09:00
2016-03-13 23:55:13 -04:00
2017-09-20 08:19:53 +02:00
2023-05-15 17:15:16 +09:00
2023-05-15 13:58:21 +09:00
2023-05-15 11:09:54 +09:00
2016-09-17 10:13:07 -04:00
2023-05-15 14:58:44 +09:00
2023-05-16 09:35:10 +09:00
2023-05-15 14:29:07 +09:00
2023-05-15 17:27:11 +09:00
2014-11-24 04:28:49 -05:00
2017-08-11 08:49:34 -07:00
2016-08-17 19:36:23 -04:00
2023-05-15 11:16:26 +09:00
2014-10-14 02:18:27 +02:00
2014-12-10 15:21:24 -05:00
2023-05-15 14:56:19 +09:00
2014-01-01 22:22:43 -05:00
2014-12-10 15:21:24 -05:00
2023-05-15 15:09:01 +09:00
2017-02-18 15:11:42 +01:00
2018-05-30 07:50:28 +02:00
2016-07-08 13:23:12 +02:00
2013-12-06 12:37:56 -05:00
2014-09-22 16:23:15 -04:00
2015-10-23 06:26:42 -07:00
2016-10-03 02:00:22 -04:00
2016-10-04 02:11:51 -04:00
2016-06-15 20:41:23 -07:00
2023-05-15 16:31:00 +09:00
2023-05-15 12:22:38 +09:00
2016-07-05 09:06:29 -07:00
2016-06-27 15:06:18 -04:00
2017-10-12 11:51:25 +02:00
2015-12-08 22:02:33 -05:00
2018-05-16 10:08:41 +02:00
2016-07-08 12:20:57 +02:00
2016-03-23 22:09:58 -04:00
2016-09-28 05:02:44 -04:00
2016-08-10 17:19:02 -07:00
2016-08-15 10:55:53 -07:00
2016-04-07 16:53:30 -04:00
2016-02-11 03:54:14 -05:00
2023-05-16 10:51:42 +09:00
2018-05-30 07:50:30 +02:00
2016-04-04 22:11:19 -04:00
2018-05-30 13:19:56 +02:00
2023-05-16 10:49:31 +09:00
2023-05-15 14:56:24 +09:00
2016-02-08 10:30:42 -05:00
2014-06-02 11:00:41 -07:00
2018-04-20 08:21:07 +02:00
2016-04-28 11:49:45 -04:00
2016-01-19 14:44:23 -05:00
2023-05-16 08:47:54 +09:00
2013-12-19 18:51:20 -05:00
2016-08-28 23:32:41 -04:00
2016-09-28 04:48:00 -04:00
2015-03-12 22:58:12 -04:00
2023-05-15 17:22:55 +09:00
2015-07-09 15:12:20 -07:00
2016-05-03 16:08:14 -04:00
2015-10-26 22:24:22 -07:00
2016-06-17 20:23:32 -07:00
2016-10-20 14:45:52 -04:00
2018-03-11 16:21:32 +01:00
2017-07-21 07:42:18 +02:00
2014-09-05 17:35:28 -07:00
2018-04-13 19:48:00 +02:00
2023-05-16 09:44:10 +09:00