syzbot


UBSAN: shift-out-of-bounds in vhci_hub_control

Status: fixed on 2021/03/10 01:48
Subsystems: usb
[Documentation on labels]
Reported-by: syzbot+297d20e437b79283bf6d@syzkaller.appspotmail.com
Fix commit: 718bf42b119d usb: usbip: vhci_hcd: protect shift size
First crash: 1186d, last: 1145d
Cause bisection: introduced by (bisect log) [release commit]:
commit 4d856f72c10ecb060868ed10ff1b1453943fc6c8
Author: Linus Torvalds <torvalds@linux-foundation.org>
Date: Sun Sep 15 21:19:32 2019 +0000

  Linux 5.3

Crash: UBSAN: undefined-behaviour in vhci_hub_control (log)
Repro: C syz .config
  
Discussions (6)
Title Replies (including bot) Last reply
[PATCH 4.19 00/77] 4.19.167-rc1 review 87 (87) 2021/01/14 01:43
[PATCH 4.14 00/57] 4.14.215-rc1 review 60 (60) 2021/01/12 07:36
[PATCH 5.4 00/92] 5.4.89-rc1 review 96 (96) 2021/01/12 06:54
[PATCH 5.10 000/145] 5.10.7-rc1 review 152 (152) 2021/01/11 19:59
[PATCH] usb: usbip: vhci_hcd: protect shift size 1 (1) 2020/12/29 07:13
UBSAN: shift-out-of-bounds in vhci_hub_control 0 (1) 2020/12/23 04:55
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream UBSAN: shift-out-of-bounds in vhci_hub_control (2) usb C unreliable 5 1082d 1090d 20/26 fixed on 2021/11/10 00:50

Sample crash report:
================================================================================
UBSAN: shift-out-of-bounds in drivers/usb/usbip/vhci_hcd.c:399:41
shift exponent 768 is too large for 32-bit type 'int'
CPU: 1 PID: 8482 Comm: syz-executor092 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
 vhci_hub_control.cold+0x205/0x246 drivers/usb/usbip/vhci_hcd.c:399
 rh_call_control drivers/usb/core/hcd.c:683 [inline]
 rh_urb_enqueue drivers/usb/core/hcd.c:841 [inline]
 usb_hcd_submit_urb+0xcaa/0x22d0 drivers/usb/core/hcd.c:1544
 usb_submit_urb+0x6e4/0x1560 drivers/usb/core/urb.c:585
 usb_start_wait_urb+0x101/0x4c0 drivers/usb/core/message.c:58
 usb_internal_control_msg drivers/usb/core/message.c:102 [inline]
 usb_control_msg+0x31c/0x4a0 drivers/usb/core/message.c:153
 do_proc_control+0x4cb/0x9c0 drivers/usb/core/devio.c:1165
 proc_control drivers/usb/core/devio.c:1191 [inline]
 usbdev_do_ioctl drivers/usb/core/devio.c:2535 [inline]
 usbdev_ioctl+0x12c1/0x3b20 drivers/usb/core/devio.c:2708
 vfs_ioctl fs/ioctl.c:48 [inline]
 __do_sys_ioctl fs/ioctl.c:753 [inline]
 __se_sys_ioctl fs/ioctl.c:739 [inline]
 __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:739
 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x443f39
Code: 18 89 d0 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 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 0f 83 fb d7 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007ffd18a092c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00000000004002e0 RCX: 0000000000443f39
RDX: 0000000020000000 RSI: 00000000c0185500 RDI: 0000000000000003
RBP: 00000000006ce018 R08: 0000000000000000 R09: 00000000004002e0
R10: 000000000000000f R11: 0000000000000246 R12: 0000000000401bc0
R13: 0000000000401c50 R14: 0000000000000000 R15: 0000000000000000
================================================================================

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/12/19 05:03 upstream a409ed156a90 04201c06 .config console log report syz C ci-upstream-kasan-gce
2021/01/28 14:48 upstream 76c057c84d28 eefc07f2 .config console log report info ci-upstream-kasan-gce UBSAN: shift-out-of-bounds in vhci_hub_control
2021/01/22 22:24 upstream 83d09ad4b950 4080af96 .config console log report info ci-upstream-kasan-gce UBSAN: shift-out-of-bounds in vhci_hub_control
2020/12/19 04:47 upstream a409ed156a90 04201c06 .config console log report info ci-upstream-kasan-gce
* Struck through repros no longer work on HEAD.