syzbot


KASAN: use-after-free Read in usbhid_wait_io

Status: closed as dup on 2019/08/21 17:01
Subsystems: input usb
[Documentation on labels]
Reported-by: syzbot+cff772ea5b2812d504a9@syzkaller.appspotmail.com
First crash: 1958d, last: 1952d
Duplicate of
Title Repro Cause bisect Fix bisect Count Last Reported
general protection fault in __pm_runtime_resume input usb pm C 197 1904d 1967d
Discussions (1)
Title Replies (including bot) Last reply
KASAN: use-after-free Read in usbhid_wait_io 1 (2) 2019/08/21 17:01

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in test_bit include/asm-generic/bitops-instrumented.h:237 [inline]
BUG: KASAN: use-after-free in usbhid_wait_io+0xc9/0x3a0 drivers/hid/usbhid/hid-core.c:646
Read of size 8 at addr ffff8881ce8828c0 by task syz-executor.1/4874

CPU: 0 PID: 4874 Comm: syz-executor.1 Not tainted 5.3.0-rc2+ #25
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0xca/0x13e lib/dump_stack.c:113
 print_address_description+0x6a/0x32c mm/kasan/report.c:351
 __kasan_report.cold+0x1a/0x33 mm/kasan/report.c:482
 kasan_report+0xe/0x12 mm/kasan/common.c:612
 check_memory_region_inline mm/kasan/generic.c:185 [inline]
 check_memory_region+0x128/0x190 mm/kasan/generic.c:192
 test_bit include/asm-generic/bitops-instrumented.h:237 [inline]
 usbhid_wait_io+0xc9/0x3a0 drivers/hid/usbhid/hid-core.c:646
 usbhid_init_reports+0x119/0x320 drivers/hid/usbhid/hid-core.c:774
 hiddev_ioctl+0x10ed/0x1550 drivers/hid/usbhid/hiddev.c:792
 vfs_ioctl fs/ioctl.c:46 [inline]
 file_ioctl fs/ioctl.c:509 [inline]
 do_vfs_ioctl+0xd2d/0x1330 fs/ioctl.c:696
 ksys_ioctl+0x9b/0xc0 fs/ioctl.c:713
 __do_sys_ioctl fs/ioctl.c:720 [inline]
 __se_sys_ioctl fs/ioctl.c:718 [inline]
 __x64_sys_ioctl+0x6f/0xb0 fs/ioctl.c:718
 do_syscall_64+0xb7/0x580 arch/x86/entry/common.c:296
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x459829
Code: fd b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 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 cb b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007efd95bdbc78 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000459829
RDX: 0000000020005700 RSI: 0000000040184810 RDI: 000000000000000b
RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007efd95bdc6d4
R13: 00000000004c2104 R14: 00000000004d54b0 R15: 00000000ffffffff

The buggy address belongs to the page:
page:ffffea00073a2080 refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff8881ce882c80
flags: 0x200000000000000()
raw: 0200000000000000 0000000000000000 dead000000000122 0000000000000000
raw: ffff8881ce882c80 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8881ce882780: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff8881ce882800: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff8881ce882880: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
                                           ^
 ffff8881ce882900: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff8881ce882980: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/08/08 10:01 https://github.com/google/kasan.git usb-fuzzer e96407b49762 e6ebef88 .config console log report ci2-upstream-usb
2019/08/02 13:25 https://github.com/google/kasan.git usb-fuzzer e96407b49762 835dffe7 .config console log report ci2-upstream-usb
* Struck through repros no longer work on HEAD.