configfs-gadget.g1 gadget.32: uvc: uvc_function_bind() Oops: general protection fault, probably for non-canonical address 0xdffffc00000000e6: 0000 [#1] SMP KASAN NOPTI KASAN: null-ptr-deref in range [0x0000000000000730-0x0000000000000737] CPU: 1 UID: 0 PID: 9492 Comm: syz.1.1474 Tainted: G L syzkaller #0 PREEMPT(full) Tainted: [L]=SOFTLOCKUP Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 RIP: 0010:f_midi2_free_ep_reqs+0x56/0x2b0 drivers/usb/gadget/function/f_midi2.c:1166 Code: 85 6a 02 00 00 49 8b 45 00 48 89 44 24 18 48 05 30 07 00 00 48 89 c2 48 89 44 24 20 48 b8 00 00 00 00 00 fc ff df 48 c1 ea 03 <0f> b6 04 02 84 c0 74 08 3c 03 0f 8e b5 01 00 00 48 8b 44 24 18 31 RSP: 0018:ffffc90002f87818 EFLAGS: 00010202 RAX: dffffc0000000000 RBX: ffff8880776d4158 RCX: ffffc9000cc04000 RDX: 00000000000000e6 RSI: ffffffff87e53346 RDI: ffff8880776d4128 RBP: ffff8880776d4150 R08: 0000000000000001 R09: 0000000000000000 R10: 0000000000000001 R11: 0000000000000000 R12: 0000000000000020 R13: ffff8880776d4128 R14: ffff888012bcd120 R15: ffff8880776d4000 FS: 0000000000000000(0000) GS:ffff888096ce3000(0063) knlGS:00000000f53d6b40 CS: 0010 DS: 002b ES: 002b CR0: 0000000080050033 CR2: 00000000f7198950 CR3: 00000000606f3000 CR4: 0000000000352ef0 Call Trace: f_midi2_free_ep drivers/usb/gadget/function/f_midi2.c:1208 [inline] f_midi2_unbind+0x265/0x800 drivers/usb/gadget/function/f_midi2.c:2066 purge_configs_funcs+0x285/0x510 drivers/usb/gadget/configfs.c:1600 configfs_composite_bind+0xf2c/0x1960 drivers/usb/gadget/configfs.c:1824 gadget_bind_driver+0x28c/0xbf0 drivers/usb/gadget/udc/core.c:1662 call_driver_probe drivers/base/dd.c:628 [inline] really_probe+0x241/0xa60 drivers/base/dd.c:706 __driver_probe_device+0x20e/0x450 drivers/base/dd.c:868 driver_probe_device+0x4a/0x140 drivers/base/dd.c:898 __driver_attach+0x21f/0x5b0 drivers/base/dd.c:1292 bus_for_each_dev+0x13e/0x1d0 drivers/base/bus.c:383 bus_add_driver+0x305/0x5b0 drivers/base/bus.c:763 driver_register+0x1e2/0x360 drivers/base/driver.c:174 usb_gadget_register_driver_owner+0x132/0x210 drivers/usb/gadget/udc/core.c:1752 gadget_dev_desc_UDC_store+0x1b0/0x2e0 drivers/usb/gadget/configfs.c:300 flush_write_buffer fs/configfs/file.c:207 [inline] configfs_write_iter+0x302/0x4e0 fs/configfs/file.c:229 new_sync_write fs/read_write.c:595 [inline] vfs_write+0x6ac/0x1050 fs/read_write.c:687 ksys_write+0x12a/0x250 fs/read_write.c:739 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] __do_fast_syscall_32+0xe7/0x970 arch/x86/entry/syscall_32.c:307 do_fast_syscall_32+0x32/0x70 arch/x86/entry/syscall_32.c:332 entry_SYSENTER_compat_after_hwframe+0x84/0x8e RIP: 0023:0xf7f12fec Code: Unable to access opcode bytes at 0xf7f12fc2. RSP: 002b:00000000f53d650c EFLAGS: 00000292 ORIG_RAX: 0000000000000004 RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 0000000080001f00 RDX: 000000000000000c RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Modules linked in: ---[ end trace 0000000000000000 ]--- RIP: 0010:f_midi2_free_ep_reqs+0x56/0x2b0 drivers/usb/gadget/function/f_midi2.c:1166 Code: 85 6a 02 00 00 49 8b 45 00 48 89 44 24 18 48 05 30 07 00 00 48 89 c2 48 89 44 24 20 48 b8 00 00 00 00 00 fc ff df 48 c1 ea 03 <0f> b6 04 02 84 c0 74 08 3c 03 0f 8e b5 01 00 00 48 8b 44 24 18 31 RSP: 0018:ffffc90002f87818 EFLAGS: 00010202 RAX: dffffc0000000000 RBX: ffff8880776d4158 RCX: ffffc9000cc04000 RDX: 00000000000000e6 RSI: ffffffff87e53346 RDI: ffff8880776d4128 RBP: ffff8880776d4150 R08: 0000000000000001 R09: 0000000000000000 R10: 0000000000000001 R11: 0000000000000000 R12: 0000000000000020 R13: ffff8880776d4128 R14: ffff888012bcd120 R15: ffff8880776d4000 FS: 0000000000000000(0000) GS:ffff888096ce3000(0063) knlGS:00000000f53d6b40 CS: 0010 DS: 002b ES: 002b CR0: 0000000080050033 CR2: 00000000f7f13000 CR3: 00000000606f3000 CR4: 0000000000352ef0 ---------------- Code disassembly (best guess): 0: 85 6a 02 test %ebp,0x2(%rdx) 3: 00 00 add %al,(%rax) 5: 49 8b 45 00 mov 0x0(%r13),%rax 9: 48 89 44 24 18 mov %rax,0x18(%rsp) e: 48 05 30 07 00 00 add $0x730,%rax 14: 48 89 c2 mov %rax,%rdx 17: 48 89 44 24 20 mov %rax,0x20(%rsp) 1c: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax 23: fc ff df 26: 48 c1 ea 03 shr $0x3,%rdx * 2a: 0f b6 04 02 movzbl (%rdx,%rax,1),%eax <-- trapping instruction 2e: 84 c0 test %al,%al 30: 74 08 je 0x3a 32: 3c 03 cmp $0x3,%al 34: 0f 8e b5 01 00 00 jle 0x1ef 3a: 48 8b 44 24 18 mov 0x18(%rsp),%rax 3f: 31 .byte 0x31