Eric Dumazet
bcd0cf19ef
net_sched: avoid shift-out-of-bounds in tcindex_set_parms()
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: 1da177e4c3 ("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>
2021-01-15 18:11:10 -08:00
..
2020-12-21 10:28:02 -08:00
2021-01-08 19:27:41 -08:00
2020-11-18 16:43:55 -08:00
2020-12-04 08:41:16 +01:00
2020-12-07 17:02:00 +02:00
2021-01-13 19:31:43 -08:00
2020-12-14 18:27:49 -08:00
2021-01-13 22:15:13 +01:00
2020-12-28 20:34:33 +01:00
2021-01-15 18:11:06 -08:00
2021-01-12 15:55:21 -08:00
2020-12-16 11:01:04 -08:00
2020-11-16 08:08:54 -08:00
2021-01-12 18:48:50 -08:00
2020-11-17 14:15:03 -08:00
2020-12-16 13:27:17 -08:00
2020-11-16 08:08:54 -08:00
2021-01-11 18:20:09 -08:00
2021-01-14 10:26:46 -08:00
2020-12-08 15:56:53 -08:00
2020-11-23 18:36:21 -05:00
2021-01-04 13:42:41 -08:00
2020-12-12 10:07:56 -08:00
2020-11-07 10:40:56 -08:00
2020-11-03 12:55:53 -08:00
2021-01-14 11:25:21 -08:00
2020-12-23 12:22:23 -08:00
2021-01-11 00:34:11 +01:00
2020-11-19 19:08:46 -08:00
2020-12-08 16:01:56 -08:00
2020-12-14 17:18:25 -08:00
2020-12-18 12:17:23 -08:00
2021-01-05 16:50:09 -08:00
2020-11-17 15:22:06 -04:00
2020-12-11 12:47:17 +01:00
2020-11-20 10:04:58 -08:00
2021-01-13 10:38:20 -08:00
2021-01-15 18:11:10 -08:00
2020-11-23 17:44:11 -08:00
2021-01-12 20:22:01 -08:00
2021-01-12 09:38:53 -08:00
2021-01-14 10:30:24 -08:00
2020-12-14 19:39:30 -08:00
2020-12-14 19:33:39 -08:00
2021-01-05 15:50:36 -08:00
2020-12-12 17:15:33 -08:00
2020-12-18 16:10:21 +01:00
2020-12-16 11:01:04 -08:00
2020-12-16 12:44:05 -08:00