general protection fault in f_midi2_stop_eps

Status: fixed on 2026/10/26 12:02
Bug presence: origin:upstream
[Documentation on labels]
Reported-by: syzbot+92601de1ff80feff08af@syzkaller.appspotmail.com
Fix commit: 51ddc55c7508 usb: gadget: midi2: Fix null-pointer dereference in f_midi2_free_ep_reqs
First crash: 104d, last: 60d
Fix bisection: fixed by (bisect log) :
commit 51ddc55c75087ac25342f6d73d3aeaf14f59bd76
Author: Aleksandr Nogikh <nogikh@google.com>
Date: Wed Jul 29 09:04:54 2026 +0000

  usb: gadget: midi2: Fix null-pointer dereference in f_midi2_free_ep_reqs

  
▶ ▼ Bug presence (1)
Date Name Commit Repro Result
2026/08/14 upstream (ToT) 3aa1dcaa4f6f C [report] general protection fault in f_midi2_stop_eps
▶ ▼ Similar bugs (1)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream general protection fault in f_midi2_stop_eps prio:high usb 2 syz, C error 541 61d 101d 27/29 upstream: reported C repro on 2026/07/28 13:41

Sample crash report:
general protection fault, probably for non-canonical address 0xdffffc00000000e6: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000730-0x0000000000000737]
CPU: 1 PID: 23 Comm: kworker/1:0 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
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+0x286/0x4c0 drivers/usb/gadget/function/f_midi2.c:1247
Code: 89 f0 48 c1 e8 03 42 80 3c 28 00 74 08 4c 89 f7 e8 bf f1 08 fb 41 bf 30 07 00 00 4d 03 3e 4c 89 f8 48 c1 e8 03 48 89 44 24 18 <42> 0f b6 04 28 84 c0 0f 85 05 02 00 00 41 8b 1f 31 ff 89 de e8 c1
RSP: 0018:ffffc900001f0820 EFLAGS: 00010002
RAX: 00000000000000e6 RBX: ffff888060110120 RCX: ffff88801ca7da00
RDX: 0000000000000100 RSI: ffffffff8b1d35c0 RDI: ffffffff8b1d3580
RBP: ffff888060110100 R08: 0000000000000000 R09: 00000000ca408a2a
R10: 00000000596ae0ca R11: 0000000000000100 R12: ffff888060110730
R13: dffffc0000000000 R14: ffff888060110128 R15: 0000000000000730
FS:  0000000000000000(0000) GS:ffff8880b8f00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fc0cd26eeb8 CR3: 0000000066322000 CR4: 00000000003506e0
Call Trace:
 <IRQ>
 f_midi2_set_alt+0x100/0x800 drivers/usb/gadget/function/f_midi2.c:1299
 composite_setup+0x1ffe/0x33a0 drivers/usb/gadget/composite.c:1957
 configfs_composite_setup+0xc7/0x100 drivers/usb/gadget/configfs.c:1875
 dummy_timer+0x1324/0x34e0 drivers/usb/gadget/udc/dummy_hcd.c:1949
 __run_hrtimer kernel/time/hrtimer.c:1754 [inline]
 __hrtimer_run_queues+0x525/0xc10 kernel/time/hrtimer.c:1818
 hrtimer_run_softirq+0x177/0x290 kernel/time/hrtimer.c:1835
 handle_softirqs+0x27d/0x820 kernel/softirq.c:578
 __do_softirq kernel/softirq.c:612 [inline]
 invoke_softirq kernel/softirq.c:452 [inline]
 __irq_exit_rcu+0xd3/0x190 kernel/softirq.c:661
 irq_exit_rcu+0x9/0x20 kernel/softirq.c:673
 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1088 [inline]
 sysvec_apic_timer_interrupt+0xa4/0xc0 arch/x86/kernel/apic/apic.c:1088
 </IRQ>
 <TASK>
 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:687
RIP: 0010:__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:152 [inline]
RIP: 0010:_raw_spin_unlock_irqrestore+0xc0/0x120 kernel/locking/spinlock.c:194
Code: c7 44 24 20 00 00 00 00 9c 8f 44 24 20 f7 44 24 20 00 02 00 00 41 c6 04 07 f8 75 4b f7 c3 00 02 00 00 74 01 fb bf 01 00 00 00 <e8> eb 77 c3 f6 65 8b 05 0c 36 6a 75 85 c0 74 3c 48 c7 04 24 0e 36
RSP: 0018:ffffc900001d6880 EFLAGS: 00000206
RAX: dffffc0000000004 RBX: 0000000000000a02 RCX: 27c977ca6c85e800
RDX: dffffc0000000000 RSI: ffffffff8acacce0 RDI: 0000000000000001
RBP: ffffc900001d6910 R08: ffffffff911ef56f R09: 1ffffffff223dead
R10: dffffc0000000000 R11: fffffbfff223deae R12: dffffc0000000000
R13: dffffc0000000000 R14: ffff888142bfc000 R15: 1ffff9200003ad10
 spin_unlock_irqrestore include/linux/spinlock.h:406 [inline]
 dummy_urb_enqueue+0x587/0x780 drivers/usb/gadget/udc/dummy_hcd.c:1336
 usb_hcd_submit_urb+0x318/0x1aa0 drivers/usb/core/hcd.c:1533
 usb_start_wait_urb+0x140/0x580 drivers/usb/core/message.c:62
 usb_internal_control_msg drivers/usb/core/message.c:117 [inline]
 usb_control_msg+0x235/0x3e0 drivers/usb/core/message.c:167
 usb_control_msg_send drivers/usb/core/message.c:226 [inline]
 usb_set_interface+0x51f/0x13f0 drivers/usb/core/message.c:1644
 set_altset sound/usb/midi2.c:1040 [inline]
 snd_usb_midi_v2_create+0x62f/0x48a0 sound/usb/midi2.c:1136
 snd_usb_create_stream+0x262/0x5d0 sound/usb/card.c:182
 snd_usb_create_streams sound/usb/card.c:282 [inline]
 usb_audio_probe+0xead/0x1f00 sound/usb/card.c:893
 usb_probe_interface+0x5c2/0xaf0 drivers/usb/core/driver.c:396
 call_driver_probe drivers/base/dd.c:-1 [inline]
 really_probe+0x247/0xae0 drivers/base/dd.c:717
 __driver_probe_device+0x1f5/0x390 drivers/base/dd.c:879
 driver_probe_device+0x4f/0x420 drivers/base/dd.c:909
 __device_attach_driver+0x2ca/0x510 drivers/base/dd.c:1037
 bus_for_each_drv+0x252/0x2e0 drivers/base/bus.c:459
 __device_attach+0x2c1/0x420 drivers/base/dd.c:1109
 bus_probe_device+0x180/0x260 drivers/base/bus.c:580
 device_add+0x87c/0xc40 drivers/base/core.c:3700
 usb_set_configuration+0x1ad0/0x2150 drivers/usb/core/message.c:2265
 usb_generic_driver_probe+0x8d/0x150 drivers/usb/core/generic.c:238
 usb_probe_device+0x12a/0x260 drivers/usb/core/driver.c:293
 call_driver_probe drivers/base/dd.c:-1 [inline]
 really_probe+0x247/0xae0 drivers/base/dd.c:717
 __driver_probe_device+0x1f5/0x390 drivers/base/dd.c:879
 driver_probe_device+0x4f/0x420 drivers/base/dd.c:909
 __device_attach_driver+0x2ca/0x510 drivers/base/dd.c:1037
 bus_for_each_drv+0x252/0x2e0 drivers/base/bus.c:459
 __device_attach+0x2c1/0x420 drivers/base/dd.c:1109
 bus_probe_device+0x180/0x260 drivers/base/bus.c:580
 device_add+0x87c/0xc40 drivers/base/core.c:3700
 usb_new_device+0x995/0x1550 drivers/usb/core/hub.c:2665
 hub_port_connect drivers/usb/core/hub.c:5534 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5674 [inline]
 port_event drivers/usb/core/hub.c:5838 [inline]
 hub_event+0x29d5/0x4a80 drivers/usb/core/hub.c:5920
 process_one_work kernel/workqueue.c:2657 [inline]
 process_scheduled_works+0xa60/0x1600 kernel/workqueue.c:2734
 worker_thread+0xa5e/0xfe0 kernel/workqueue.c:2815
 kthread+0x2fa/0x390 kernel/kthread.c:388
 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:152
 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:293
 </TASK>
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+0x286/0x4c0 drivers/usb/gadget/function/f_midi2.c:1247
Code: 89 f0 48 c1 e8 03 42 80 3c 28 00 74 08 4c 89 f7 e8 bf f1 08 fb 41 bf 30 07 00 00 4d 03 3e 4c 89 f8 48 c1 e8 03 48 89 44 24 18 <42> 0f b6 04 28 84 c0 0f 85 05 02 00 00 41 8b 1f 31 ff 89 de e8 c1
RSP: 0018:ffffc900001f0820 EFLAGS: 00010002
RAX: 00000000000000e6 RBX: ffff888060110120 RCX: ffff88801ca7da00
RDX: 0000000000000100 RSI: ffffffff8b1d35c0 RDI: ffffffff8b1d3580
RBP: ffff888060110100 R08: 0000000000000000 R09: 00000000ca408a2a
R10: 00000000596ae0ca R11: 0000000000000100 R12: ffff888060110730
R13: dffffc0000000000 R14: ffff888060110128 R15: 0000000000000730
FS:  0000000000000000(0000) GS:ffff8880b8f00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fc0cd26eeb8 CR3: 0000000066322000 CR4: 00000000003506e0
----------------
Code disassembly (best guess):
   0:	89 f0                	mov    %esi,%eax
   2:	48 c1 e8 03          	shr    $0x3,%rax
   6:	42 80 3c 28 00       	cmpb   $0x0,(%rax,%r13,1)
   b:	74 08                	je     0x15
   d:	4c 89 f7             	mov    %r14,%rdi
  10:	e8 bf f1 08 fb       	call   0xfb08f1d4
  15:	41 bf 30 07 00 00    	mov    $0x730,%r15d
  1b:	4d 03 3e             	add    (%r14),%r15
  1e:	4c 89 f8             	mov    %r15,%rax
  21:	48 c1 e8 03          	shr    $0x3,%rax
  25:	48 89 44 24 18       	mov    %rax,0x18(%rsp)
* 2a:	42 0f b6 04 28       	movzbl (%rax,%r13,1),%eax <-- trapping instruction
  2f:	84 c0                	test   %al,%al
  31:	0f 85 05 02 00 00    	jne    0x23c
  37:	41 8b 1f             	mov    (%r15),%ebx
  3a:	31 ff                	xor    %edi,%edi
  3c:	89 de                	mov    %ebx,%esi
  3e:	e8                   	.byte 0xe8
  3f:	c1                   	.byte 0xc1

Crashes (32):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/09/07 23:11 linux-6.6.y 8b73de7da85f 680aa3e1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan general protection fault in f_midi2_stop_eps
2026/09/07 23:11 linux-6.6.y 8b73de7da85f 680aa3e1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan general protection fault in f_midi2_stop_eps
2026/09/04 02:39 linux-6.6.y 8b73de7da85f 801f0966 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan general protection fault in f_midi2_stop_eps
2026/09/04 02:31 linux-6.6.y 8b73de7da85f 801f0966 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan general protection fault in f_midi2_stop_eps
2026/08/28 11:39 linux-6.6.y a4a971135a2f e2fa417d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan general protection fault in f_midi2_stop_eps
2026/08/07 06:25 linux-6.6.y 80dfb0405055 c38879ea .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan general protection fault in f_midi2_stop_eps
2026/08/05 00:57 linux-6.6.y aa0e49877a2e d4abbeac .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan general protection fault in f_midi2_stop_eps
2026/07/27 19:20 linux-6.6.y c5596480c50e aae9036b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan general protection fault in f_midi2_stop_eps
2026/07/27 19:19 linux-6.6.y c5596480c50e aae9036b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan general protection fault in f_midi2_stop_eps
2026/07/25 21:23 linux-6.6.y c5596480c50e 492bab15 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan general protection fault in f_midi2_stop_eps
2026/07/25 17:33 linux-6.6.y c5596480c50e 492bab15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan general protection fault in f_midi2_stop_eps
2026/07/25 17:33 linux-6.6.y c5596480c50e 492bab15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan general protection fault in f_midi2_stop_eps
2026/07/25 17:29 linux-6.6.y c5596480c50e 492bab15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan general protection fault in f_midi2_stop_eps
2026/07/25 17:29 linux-6.6.y c5596480c50e 492bab15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan general protection fault in f_midi2_stop_eps
2026/07/25 17:29 linux-6.6.y c5596480c50e 492bab15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan general protection fault in f_midi2_stop_eps
2026/07/25 17:27 linux-6.6.y c5596480c50e 492bab15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan general protection fault in f_midi2_stop_eps
2026/07/25 17:26 linux-6.6.y c5596480c50e 492bab15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan general protection fault in f_midi2_stop_eps
2026/07/25 17:24 linux-6.6.y c5596480c50e 492bab15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan general protection fault in f_midi2_stop_eps
2026/07/25 13:33 linux-6.6.y c5596480c50e 492bab15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan general protection fault in f_midi2_stop_eps
2026/07/25 13:32 linux-6.6.y c5596480c50e 492bab15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan general protection fault in f_midi2_stop_eps
2026/07/25 13:32 linux-6.6.y c5596480c50e 492bab15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan general protection fault in f_midi2_stop_eps
2026/07/25 13:31 linux-6.6.y c5596480c50e 492bab15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan general protection fault in f_midi2_stop_eps
2026/07/25 13:29 linux-6.6.y c5596480c50e 492bab15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan general protection fault in f_midi2_stop_eps
2026/07/25 13:29 linux-6.6.y c5596480c50e 492bab15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan general protection fault in f_midi2_stop_eps
2026/07/25 13:29 linux-6.6.y c5596480c50e 492bab15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan general protection fault in f_midi2_stop_eps
2026/07/25 13:27 linux-6.6.y c5596480c50e 492bab15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan general protection fault in f_midi2_stop_eps
2026/07/25 13:26 linux-6.6.y c5596480c50e 492bab15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan general protection fault in f_midi2_stop_eps
2026/07/25 13:26 linux-6.6.y c5596480c50e 492bab15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan general protection fault in f_midi2_stop_eps
2026/07/25 13:25 linux-6.6.y c5596480c50e 492bab15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan general protection fault in f_midi2_stop_eps
2026/07/25 13:23 linux-6.6.y c5596480c50e 492bab15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan general protection fault in f_midi2_stop_eps
2026/07/25 13:23 linux-6.6.y c5596480c50e 492bab15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan general protection fault in f_midi2_stop_eps
2026/07/25 13:23 linux-6.6.y c5596480c50e 492bab15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan general protection fault in f_midi2_stop_eps
* Struck through repros no longer work on HEAD.