Oops: general protection fault, probably for non-canonical address 0xdffffc00000000e6: 0000 [#1] SMP KASAN NOPTI KASAN: null-ptr-deref in range [0x0000000000000730-0x0000000000000737] CPU: 0 UID: 0 PID: 1390 Comm: kworker/0:4 Not tainted syzkaller #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 Workqueue: usb_hub_wq hub_event RIP: 0010:f_midi2_free_ep_reqs drivers/usb/gadget/function/f_midi2.c:1166 [inline] RIP: 0010:f_midi2_stop_eps+0x5f/0x4d0 drivers/usb/gadget/function/f_midi2.c:1245 Code: e8 48 c1 e8 03 42 80 3c 28 00 74 08 48 89 ef e8 77 4b 61 fa 41 bc 30 07 00 00 4c 03 65 00 4c 89 e0 48 c1 e8 03 48 89 44 24 10 <42> 0f b6 04 28 84 c0 0f 85 23 04 00 00 41 8b 1c 24 31 ff 89 de e8 RSP: 0018:ffffc90000007930 EFLAGS: 00010002 RAX: 00000000000000e6 RBX: 0000000000000001 RCX: ffff88801fb88000 RDX: 0000000000000100 RSI: 0000000000000100 RDI: ffff888051cac148 RBP: ffff888051cac0f0 R08: ffff888051cac14f R09: 1ffff1100a395829 R10: dffffc0000000000 R11: ffffed100a39582a R12: 0000000000000730 R13: dffffc0000000000 R14: ffff888051cac128 R15: 0000000000000001 FS: 0000000000000000(0000) GS:ffff88808c30a000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f5d5f977000 CR3: 0000000043b1d000 CR4: 0000000000352ef0 Call Trace: f_midi2_set_alt+0x11c/0xf00 drivers/usb/gadget/function/f_midi2.c:1296 composite_setup+0x1ffd/0x3480 drivers/usb/gadget/composite.c:1933 configfs_composite_setup+0xc7/0x100 drivers/usb/gadget/configfs.c:1877 dummy_timer+0x2f43/0x4cf0 drivers/usb/gadget/udc/dummy_hcd.c:1951 __run_hrtimer kernel/time/hrtimer.c:2067 [inline] __hrtimer_run_queues+0x3bc/0xa10 kernel/time/hrtimer.c:2124 hrtimer_run_softirq+0x1e3/0x2e0 kernel/time/hrtimer.c:2141 handle_softirqs+0x226/0x860 kernel/softirq.c:645 __do_softirq kernel/softirq.c:679 [inline] invoke_softirq kernel/softirq.c:519 [inline] __irq_exit_rcu+0xcb/0x220 kernel/softirq.c:767 irq_exit_rcu+0x9/0x30 kernel/softirq.c:784 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1062 [inline] sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1062 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:674 RIP: 0010:__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:211 [inline] RIP: 0010:_raw_spin_unlock_irqrestore+0x47/0x80 kernel/locking/spinlock.c:221 Code: f7 e8 ad b6 c2 f5 f7 c3 00 02 00 00 74 05 e8 b0 e7 ee f5 9c 58 a9 00 02 00 00 75 29 f7 c3 00 02 00 00 74 01 fb bf 01 00 00 00 b4 d6 b3 f5 65 48 8b 05 2c ce b0 07 48 85 c0 74 18 5b 41 5e c3 RSP: 0018:ffffc90002a6e7d0 EFLAGS: 00000206 RAX: 0000000000000002 RBX: 0000000000000246 RCX: 8000000000000001 RDX: 0000000000000006 RSI: ffffffff8e460b06 RDI: 0000000000000001 RBP: 0000000000000007 R08: ffffffff9078fa37 R09: 1ffffffff20f1f46 R10: dffffc0000000000 R11: fffffbfff20f1f47 R12: 0000000000000000 R13: dffffc0000000000 R14: ffff8880343c0000 R15: 1ffff11003efce94 spin_unlock_irqrestore include/linux/spinlock.h:425 [inline] dummy_urb_enqueue+0x587/0x780 drivers/usb/gadget/udc/dummy_hcd.c:1337 usb_hcd_submit_urb+0x328/0x1b60 drivers/usb/core/hcd.c:1542 usb_start_wait_urb+0x13f/0x5b0 drivers/usb/core/message.c:62 usb_internal_control_msg drivers/usb/core/message.c:117 [inline] usb_control_msg+0x234/0x3e0 drivers/usb/core/message.c:167 usb_control_msg_send drivers/usb/core/message.c:226 [inline] usb_set_interface+0x521/0x1470 drivers/usb/core/message.c:1649 set_altset sound/usb/midi2.c:1036 [inline] snd_usb_midi_v2_create+0x621/0x4ac0 sound/usb/midi2.c:1131 snd_usb_create_stream+0x262/0x630 sound/usb/card.c:290 snd_usb_create_streams sound/usb/card.c:392 [inline] usb_audio_probe+0x144c/0x2240 sound/usb/card.c:1065 usb_probe_interface+0x653/0xc60 drivers/usb/core/driver.c:396 call_driver_probe drivers/base/dd.c:-1 [inline] really_probe+0x254/0xae0 drivers/base/dd.c:706 __driver_probe_device+0x1e8/0x360 drivers/base/dd.c:868 driver_probe_device+0x4f/0x240 drivers/base/dd.c:898 __device_attach_driver+0x270/0x410 drivers/base/dd.c:1026 bus_for_each_drv+0x258/0x2f0 drivers/base/bus.c:500 __device_attach+0x2c4/0x450 drivers/base/dd.c:1098 device_initial_probe+0xa1/0xd0 drivers/base/dd.c:1153 bus_probe_device+0x12a/0x220 drivers/base/bus.c:620 device_add+0x7d7/0xb80 drivers/base/core.c:3776 usb_set_configuration+0x1ad8/0x2180 drivers/usb/core/message.c:2268 usb_generic_driver_probe+0x8d/0x150 drivers/usb/core/generic.c:250 usb_probe_device+0x1c3/0x3b0 drivers/usb/core/driver.c:291 call_driver_probe drivers/base/dd.c:-1 [inline] really_probe+0x254/0xae0 drivers/base/dd.c:706 __driver_probe_device+0x1e8/0x360 drivers/base/dd.c:868 driver_probe_device+0x4f/0x240 drivers/base/dd.c:898 __device_attach_driver+0x270/0x410 drivers/base/dd.c:1026 bus_for_each_drv+0x258/0x2f0 drivers/base/bus.c:500 __device_attach+0x2c4/0x450 drivers/base/dd.c:1098 device_initial_probe+0xa1/0xd0 drivers/base/dd.c:1153 bus_probe_device+0x12a/0x220 drivers/base/bus.c:620 device_add+0x7d7/0xb80 drivers/base/core.c:3776 usb_new_device+0x9aa/0x1690 drivers/usb/core/hub.c:2703 hub_port_connect drivers/usb/core/hub.c:5575 [inline] hub_port_connect_change drivers/usb/core/hub.c:5715 [inline] port_event drivers/usb/core/hub.c:5879 [inline] hub_event+0x28e8/0x4d30 drivers/usb/core/hub.c:5961 process_one_work kernel/workqueue.c:3387 [inline] process_scheduled_works+0xc3d/0x1630 kernel/workqueue.c:3470 worker_thread+0xa47/0xfb0 kernel/workqueue.c:3551 kthread+0x38b/0x480 kernel/kthread.c:436 ret_from_fork+0x514/0xb70 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Modules linked in: ---[ end trace 0000000000000000 ]--- RIP: 0010:f_midi2_free_ep_reqs drivers/usb/gadget/function/f_midi2.c:1166 [inline] RIP: 0010:f_midi2_stop_eps+0x5f/0x4d0 drivers/usb/gadget/function/f_midi2.c:1245 Code: e8 48 c1 e8 03 42 80 3c 28 00 74 08 48 89 ef e8 77 4b 61 fa 41 bc 30 07 00 00 4c 03 65 00 4c 89 e0 48 c1 e8 03 48 89 44 24 10 <42> 0f b6 04 28 84 c0 0f 85 23 04 00 00 41 8b 1c 24 31 ff 89 de e8 RSP: 0018:ffffc90000007930 EFLAGS: 00010002 RAX: 00000000000000e6 RBX: 0000000000000001 RCX: ffff88801fb88000 RDX: 0000000000000100 RSI: 0000000000000100 RDI: ffff888051cac148 RBP: ffff888051cac0f0 R08: ffff888051cac14f R09: 1ffff1100a395829 R10: dffffc0000000000 R11: ffffed100a39582a R12: 0000000000000730 R13: dffffc0000000000 R14: ffff888051cac128 R15: 0000000000000001 FS: 0000000000000000(0000) GS:ffff88808c30a000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f5d5f977000 CR3: 0000000043b1d000 CR4: 0000000000352ef0 ---------------- Code disassembly (best guess): 0: e8 48 c1 e8 03 call 0x3e8c14d 5: 42 80 3c 28 00 cmpb $0x0,(%rax,%r13,1) a: 74 08 je 0x14 c: 48 89 ef mov %rbp,%rdi f: e8 77 4b 61 fa call 0xfa614b8b 14: 41 bc 30 07 00 00 mov $0x730,%r12d 1a: 4c 03 65 00 add 0x0(%rbp),%r12 1e: 4c 89 e0 mov %r12,%rax 21: 48 c1 e8 03 shr $0x3,%rax 25: 48 89 44 24 10 mov %rax,0x10(%rsp) * 2a: 42 0f b6 04 28 movzbl (%rax,%r13,1),%eax <-- trapping instruction 2f: 84 c0 test %al,%al 31: 0f 85 23 04 00 00 jne 0x45a 37: 41 8b 1c 24 mov (%r12),%ebx 3b: 31 ff xor %edi,%edi 3d: 89 de mov %ebx,%esi 3f: e8 .byte 0xe8