Eric Dumazet
22c1b22672
net_sched: avoid shift-out-of-bounds in tcindex_set_parms()
...
commit bcd0cf19ef8258ac31b9a20248b05c15a1f4b4b0 upstream.
tc_index being 16bit wide, we need to check that TCA_TCINDEX_SHIFT
attribute is not silly.
UBSAN: shift-out-of-bounds in net/sched/cls_tcindex.c:260:29
shift exponent 255 is too large for 32-bit type 'int'
CPU: 0 PID: 8516 Comm: syz-executor228 Not tainted 5.10.0-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+0x107/0x163 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:395
valid_perfect_hash net/sched/cls_tcindex.c:260 [inline]
tcindex_set_parms.cold+0x1b/0x215 net/sched/cls_tcindex.c:425
tcindex_change+0x232/0x340 net/sched/cls_tcindex.c:546
tc_new_tfilter+0x13fb/0x21b0 net/sched/cls_api.c:2127
rtnetlink_rcv_msg+0x8b6/0xb80 net/core/rtnetlink.c:5555
netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2494
netlink_unicast_kernel net/netlink/af_netlink.c:1304 [inline]
netlink_unicast+0x533/0x7d0 net/netlink/af_netlink.c:1330
netlink_sendmsg+0x907/0xe40 net/netlink/af_netlink.c:1919
sock_sendmsg_nosec net/socket.c:652 [inline]
sock_sendmsg+0xcf/0x120 net/socket.c:672
____sys_sendmsg+0x6e8/0x810 net/socket.c:2336
___sys_sendmsg+0xf3/0x170 net/socket.c:2390
__sys_sendmsg+0xe5/0x1b0 net/socket.c:2423
do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
entry_SYSCALL_64_after_hwframe+0x44/0xa9
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: syzbot <syzkaller@googlegroups.com>
Link: https://lore.kernel.org/r/20210114185229.1742255-1-eric.dumazet@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-01-27 11:05:43 +01:00
..
2020-01-27 14:50:41 +01:00
2020-11-05 11:08:44 +01:00
2021-01-17 14:04:19 +01:00
2019-12-13 08:52:59 +01:00
2020-10-01 13:14:43 +02:00
2020-07-31 18:37:48 +02:00
2020-12-02 08:48:10 +01:00
2020-12-30 11:25:52 +01:00
2020-01-27 14:50:51 +01:00
2020-12-30 11:25:41 +01:00
2019-11-10 11:27:48 +01:00
2020-11-24 13:27:22 +01:00
2020-11-05 11:08:53 +01:00
2021-01-27 11:05:42 +01:00
2021-01-23 15:49:56 +01:00
2020-04-29 16:31:16 +02:00
2020-01-04 19:13:37 +01:00
2020-04-23 10:30:24 +02:00
2020-11-10 12:36:02 +01:00
2020-01-09 10:19:09 +01:00
2020-04-21 09:03:03 +02:00
2020-03-18 07:14:15 +01:00
2021-01-27 11:05:43 +01:00
2021-01-27 11:05:43 +01:00
2020-12-08 10:18:52 +01:00
2019-04-17 08:38:40 +02:00
2020-09-26 18:01:28 +02:00
2020-07-22 09:31:59 +02:00
2019-06-22 08:15:13 +02:00
2020-10-01 13:14:26 +02:00
2020-12-30 11:26:03 +01:00
2020-10-01 13:14:51 +02:00
2020-04-29 16:31:17 +02:00
2021-01-12 20:10:18 +01:00
2021-01-19 18:22:38 +01:00
2020-11-24 13:27:17 +01:00
2020-07-22 09:31:58 +02:00
2020-04-29 16:31:21 +02:00
2020-10-29 09:54:58 +01:00
2020-10-14 10:31:24 +02:00
2020-10-07 08:00:08 +02:00
2019-11-10 11:27:48 +01:00
2019-12-05 09:21:30 +01:00
2020-09-26 18:01:30 +02:00
2020-08-05 10:06:01 +02:00
2020-01-12 12:17:17 +01:00
2020-12-08 10:18:52 +01:00
2021-01-23 15:49:56 +01:00
2021-01-27 11:05:43 +01:00
2020-11-24 13:27:18 +01:00
2020-10-29 09:54:55 +01:00
2019-05-16 19:41:27 +02:00
2021-01-19 18:22:38 +01:00
2021-01-23 15:49:56 +01:00
2020-12-08 10:18:52 +01:00
2020-10-01 13:14:32 +02:00
2020-11-10 12:35:59 +01:00
2020-12-30 11:26:06 +01:00
2020-12-08 10:18:54 +01:00
2020-12-30 11:25:44 +01:00
2020-11-18 19:18:41 +01:00
2020-08-21 11:05:32 +02:00
2020-08-19 08:15:03 +02:00