syzbot


BUG: unable to handle kernel NULL pointer dereference in udc_bind_to_driver

Status: fixed on 2020/07/17 17:58
Subsystems: usb
[Documentation on labels]
Fix commit: 3021e69219e2 kcov: check kcov_softirq in kcov_remote_stop()
First crash: 1396d, last: 1396d

Sample crash report:
BUG: kernel NULL pointer dereference, address: 0000000000000000
#PF: supervisor read access in kernel mode
#PF: error_code(0x0000) - not-present page
PGD 6643e067 P4D 6643e067 PUD 6643f067 PMD 0 
Oops: 0000 [#1] PREEMPT SMP KASAN
CPU: 2 PID: 10195 Comm: syz-executor.3 Not tainted 5.7.0-syzkaller #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.12.0-59-gc9ba5276e321-prebuilt.qemu.org 04/01/2014
RIP: 0010:__read_once_size include/linux/compiler.h:252 [inline]
RIP: 0010:__sanitizer_cov_trace_pc+0x43/0x60 kernel/kcov.c:202
Code: 24 74 0f 80 e6 01 74 35 8b 90 04 14 00 00 85 d2 74 2b 8b 90 e0 13 00 00 83 fa 02 75 20 48 8b 88 e8 13 00 00 8b 80 e4 13 00 00 <48> 8b 11 48 83 c2 01 48 39 d0 76 07 48 89 34 d1 48 89 11 c3 66 0f
RSP: 0018:ffffc90001907b00 EFLAGS: 00010246
RAX: 0000000000000000 RBX: ffff8880634da11c RCX: 0000000000000000
RDX: 0000000000000002 RSI: ffffffff83b28089 RDI: 0000000000000007
RBP: ffffffff8875f560 R08: ffff8880649b4bc0 R09: ffffed10032247f1
R10: ffff888019123f87 R11: ffffed10032247f0 R12: 1ffff92000320f80
R13: ffff8880634da118 R14: ffffffff8875f560 R15: ffffc90001907c20
FS:  00007f392f5f2700(0000) GS:ffff88802d000000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 0000000065d21000 CR4: 0000000000340ee0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 vsnprintf+0xd9/0x14f0 lib/vsprintf.c:2570
 add_uevent_var+0x14d/0x310 lib/kobject_uevent.c:664
 kobject_uevent_env+0x272/0x12e0 lib/kobject_uevent.c:535
 udc_bind_to_driver+0x317/0x570 drivers/usb/gadget/udc/core.c:1368
 usb_gadget_probe_driver+0x31f/0x3f0 drivers/usb/gadget/udc/core.c:1421
 raw_ioctl_run drivers/usb/gadget/legacy/raw_gadget.c:512 [inline]
 raw_ioctl+0x769/0x1cd0 drivers/usb/gadget/legacy/raw_gadget.c:1210
 vfs_ioctl fs/ioctl.c:47 [inline]
 ksys_ioctl+0x11a/0x180 fs/ioctl.c:771
 __do_sys_ioctl fs/ioctl.c:780 [inline]
 __se_sys_ioctl fs/ioctl.c:778 [inline]
 __x64_sys_ioctl+0x6f/0xb0 fs/ioctl.c:778
 do_syscall_64+0xf6/0x7d0 arch/x86/entry/common.c:295
 entry_SYSCALL_64_after_hwframe+0x49/0xb3
RIP: 0033:0x45c727
Code: 48 83 c4 08 48 89 d8 5b 5d c3 66 0f 1f 84 00 00 00 00 00 48 89 e8 48 f7 d8 48 39 c3 0f 92 c0 eb 92 66 90 b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff 0f 83 1d b3 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007f392f5efaa8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 000000000045c727
RDX: 0000000000000000 RSI: 0000000000005501 RDI: 0000000000000005
RBP: 00007f392f5efb00 R08: 0000000000000000 R09: 000000000000000b
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000005
R13: 0000000000000c51 R14: 00000000006ecc80 R15: 00000000004b57c3
Modules linked in:
CR2: 0000000000000000
---[ end trace 44d920ac4a68e564 ]---
RIP: 0010:__read_once_size include/linux/compiler.h:252 [inline]
RIP: 0010:__sanitizer_cov_trace_pc+0x43/0x60 kernel/kcov.c:202
Code: 24 74 0f 80 e6 01 74 35 8b 90 04 14 00 00 85 d2 74 2b 8b 90 e0 13 00 00 83 fa 02 75 20 48 8b 88 e8 13 00 00 8b 80 e4 13 00 00 <48> 8b 11 48 83 c2 01 48 39 d0 76 07 48 89 34 d1 48 89 11 c3 66 0f
RSP: 0018:ffffc90001907b00 EFLAGS: 00010246
RAX: 0000000000000000 RBX: ffff8880634da11c RCX: 0000000000000000
RDX: 0000000000000002 RSI: ffffffff83b28089 RDI: 0000000000000007
RBP: ffffffff8875f560 R08: ffff8880649b4bc0 R09: ffffed10032247f1
R10: ffff888019123f87 R11: ffffed10032247f0 R12: 1ffff92000320f80
R13: ffff8880634da118 R14: ffffffff8875f560 R15: ffffc90001907c20
FS:  00007f392f5f2700(0000) GS:ffff88802d000000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 0000000065d21000 CR4: 0000000000340ee0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/06/19 10:04 upstream 435faf5c218a bc258b50 .config console log report ci-qemu-upstream
* Struck through repros no longer work on HEAD.