[v6.6] general protection fault in f_midi2_free_ep

1 view
Skip to first unread message

syzbot

unread,
Jul 25, 2026, 1:35:36 PM (9 days ago) Jul 25
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: c5596480c50e Linux 6.6.145
git tree: linux-6.6.y
console output: https://syzkaller.appspot.com/x/log.txt?x=1216dfde580000
kernel config: https://syzkaller.appspot.com/x/.config?x=f0bc3d90c30838b5
dashboard link: https://syzkaller.appspot.com/bug?extid=aef6eae86ecaed191ece
compiler: Debian clang version 22.1.8 (++20260613092233+e80beda6e255-1~exp1~20260613092250.77), Debian LLD 22.1.8

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/eb5cda0a8020/disk-c5596480.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/ca05ff2fc502/vmlinux-c5596480.xz
kernel image: https://storage.googleapis.com/syzbot-assets/6daf3255b985/bzImage-c5596480.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+aef6ea...@syzkaller.appspotmail.com

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: 6507 Comm: syz.3.173 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/16/2026
RIP: 0010:f_midi2_free_ep_reqs drivers/usb/gadget/function/f_midi2.c:1166 [inline]
RIP: 0010:f_midi2_free_ep+0x52/0x2e0 drivers/usb/gadget/function/f_midi2.c:1209
Code: 4c 89 f0 48 c1 e8 03 80 3c 28 00 74 08 4c 89 f7 e8 63 fc 0a fb 41 bc 30 07 00 00 4d 03 26 4c 89 e0 48 c1 e8 03 48 89 44 24 30 <0f> b6 04 28 84 c0 0f 85 50 02 00 00 41 8b 1c 24 31 ff 89 de e8 65
RSP: 0018:ffffc9001062f9c8 EFLAGS: 00010202
RAX: 00000000000000e6 RBX: ffff88805dca0000 RCX: 0000000000080000
RDX: ffffc9000e0bf000 RSI: 000000000005e58c RDI: 000000000005e58d
RBP: dffffc0000000000 R08: ffffffff911eb617 R09: 1ffffffff223d6c2
R10: dffffc0000000000 R11: fffffbfff223d6c3 R12: 0000000000000730
R13: dffffc0000000000 R14: ffff88805dca0128 R15: dffffc0000000000
FS: 00007f85682e76c0(0000) GS:ffff8880b8f00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055557ea19a38 CR3: 00000000771b1000 CR4: 00000000003506e0
Call Trace:
<TASK>
f_midi2_unbind+0x9b/0x330 drivers/usb/gadget/function/f_midi2.c:2069
purge_configs_funcs+0x241/0x3a0 drivers/usb/gadget/configfs.c:1597
configfs_composite_unbind+0xa4/0x1c0 drivers/usb/gadget/configfs.c:1844
gadget_unbind_driver+0x1bf/0x3e0 drivers/usb/gadget/udc/core.c:1702
device_remove drivers/base/dd.c:626 [inline]
__device_release_driver drivers/base/dd.c:1351 [inline]
device_release_driver_internal+0x408/0x6f0 drivers/base/dd.c:1374
driver_detach+0x1f3/0x2d0 drivers/base/dd.c:1437
bus_remove_driver+0x221/0x2f0 drivers/base/bus.c:792
usb_gadget_unregister_driver+0x4e/0x70 drivers/usb/gadget/udc/core.c:1762
unregister_gadget drivers/usb/gadget/configfs.c:263 [inline]
gadget_dev_desc_UDC_store+0x178/0x2e0 drivers/usb/gadget/configfs.c:290
flush_write_buffer fs/configfs/file.c:207 [inline]
configfs_write_iter+0x312/0x400 fs/configfs/file.c:229
call_write_iter include/linux/fs.h:2018 [inline]
new_sync_write fs/read_write.c:491 [inline]
vfs_write+0x474/0x9a0 fs/read_write.c:584
ksys_write+0x151/0x260 fs/read_write.c:637
do_syscall_x64 arch/x86/entry/common.c:46 [inline]
do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76
entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7f856739de99
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 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 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f85682e7028 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007f8567626090 RCX: 00007f856739de99
RDX: 0000000000000001 RSI: 00002000000004c0 RDI: 0000000000000003
RBP: 00007f8567433eaf R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f8567626128 R14: 00007f8567626090 R15: 00007ffcd0b2daf8
</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_free_ep+0x52/0x2e0 drivers/usb/gadget/function/f_midi2.c:1209
Code: 4c 89 f0 48 c1 e8 03 80 3c 28 00 74 08 4c 89 f7 e8 63 fc 0a fb 41 bc 30 07 00 00 4d 03 26 4c 89 e0 48 c1 e8 03 48 89 44 24 30 <0f> b6 04 28 84 c0 0f 85 50 02 00 00 41 8b 1c 24 31 ff 89 de e8 65
RSP: 0018:ffffc9001062f9c8 EFLAGS: 00010202
RAX: 00000000000000e6 RBX: ffff88805dca0000 RCX: 0000000000080000
RDX: ffffc9000e0bf000 RSI: 000000000005e58c RDI: 000000000005e58d
RBP: dffffc0000000000 R08: ffffffff911eb617 R09: 1ffffffff223d6c2
R10: dffffc0000000000 R11: fffffbfff223d6c3 R12: 0000000000000730
R13: dffffc0000000000 R14: ffff88805dca0128 R15: dffffc0000000000
FS: 00007f85682e76c0(0000) GS:ffff8880b8f00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000564dafc5fd10 CR3: 00000000771b1000 CR4: 00000000003506e0
----------------
Code disassembly (best guess):
0: 4c 89 f0 mov %r14,%rax
3: 48 c1 e8 03 shr $0x3,%rax
7: 80 3c 28 00 cmpb $0x0,(%rax,%rbp,1)
b: 74 08 je 0x15
d: 4c 89 f7 mov %r14,%rdi
10: e8 63 fc 0a fb call 0xfb0afc78
15: 41 bc 30 07 00 00 mov $0x730,%r12d
1b: 4d 03 26 add (%r14),%r12
1e: 4c 89 e0 mov %r12,%rax
21: 48 c1 e8 03 shr $0x3,%rax
25: 48 89 44 24 30 mov %rax,0x30(%rsp)
* 2a: 0f b6 04 28 movzbl (%rax,%rbp,1),%eax <-- trapping instruction
2e: 84 c0 test %al,%al
30: 0f 85 50 02 00 00 jne 0x286
36: 41 8b 1c 24 mov (%r12),%ebx
3a: 31 ff xor %edi,%edi
3c: 89 de mov %ebx,%esi
3e: e8 .byte 0xe8
3f: 65 gs


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

syzbot

unread,
Jul 25, 2026, 11:37:33 PM (9 days ago) Jul 25
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: c5596480c50e Linux 6.6.145
git tree: linux-6.6.y
console output: https://syzkaller.appspot.com/x/log.txt?x=110a46b9580000
kernel config: https://syzkaller.appspot.com/x/.config?x=f0bc3d90c30838b5
dashboard link: https://syzkaller.appspot.com/bug?extid=aef6eae86ecaed191ece
compiler: Debian clang version 22.1.8 (++20260613092233+e80beda6e255-1~exp1~20260613092250.77), Debian LLD 22.1.8
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1514a232580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=10c2909e580000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/eb5cda0a8020/disk-c5596480.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/ca05ff2fc502/vmlinux-c5596480.xz
kernel image: https://storage.googleapis.com/syzbot-assets/6daf3255b985/bzImage-c5596480.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+aef6ea...@syzkaller.appspotmail.com

general protection fault, probably for non-canonical address 0xdffffc00000000e6: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000730-0x0000000000000737]
CPU: 0 PID: 5922 Comm: syz.0.17 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/16/2026
RIP: 0010:f_midi2_free_ep_reqs drivers/usb/gadget/function/f_midi2.c:1166 [inline]
RIP: 0010:f_midi2_free_ep+0x52/0x2e0 drivers/usb/gadget/function/f_midi2.c:1209
Code: 4c 89 f0 48 c1 e8 03 80 3c 28 00 74 08 4c 89 f7 e8 63 fc 0a fb 41 bc 30 07 00 00 4d 03 26 4c 89 e0 48 c1 e8 03 48 89 44 24 30 <0f> b6 04 28 84 c0 0f 85 50 02 00 00 41 8b 1c 24 31 ff 89 de e8 65
RSP: 0018:ffffc9000332f9c8 EFLAGS: 00010202
RAX: 00000000000000e6 RBX: ffff888060738000 RCX: ffff8880281bda00
RDX: 0000000000000000 RSI: ffffffff8acacbe0 RDI: ffff888060738128
RBP: dffffc0000000000 R08: ffffffff911eb5f7 R09: 1ffffffff223d6be
R10: dffffc0000000000 R11: fffffbfff223d6bf R12: 0000000000000730
R13: dffffc0000000000 R14: ffff888060738128 R15: dffffc0000000000
FS: 0000555559d94500(0000) GS:ffff8880b8e00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055ed11d04ee8 CR3: 0000000025737000 CR4: 00000000003506f0
Call Trace:
<TASK>
f_midi2_unbind+0x9b/0x330 drivers/usb/gadget/function/f_midi2.c:2069
purge_configs_funcs+0x241/0x3a0 drivers/usb/gadget/configfs.c:1597
configfs_composite_unbind+0xa4/0x1c0 drivers/usb/gadget/configfs.c:1844
gadget_unbind_driver+0x1bf/0x3e0 drivers/usb/gadget/udc/core.c:1702
device_remove drivers/base/dd.c:626 [inline]
__device_release_driver drivers/base/dd.c:1351 [inline]
device_release_driver_internal+0x408/0x6f0 drivers/base/dd.c:1374
driver_detach+0x1f3/0x2d0 drivers/base/dd.c:1437
bus_remove_driver+0x221/0x2f0 drivers/base/bus.c:792
usb_gadget_unregister_driver+0x4e/0x70 drivers/usb/gadget/udc/core.c:1762
unregister_gadget drivers/usb/gadget/configfs.c:263 [inline]
gadget_dev_desc_UDC_store+0x178/0x2e0 drivers/usb/gadget/configfs.c:290
flush_write_buffer fs/configfs/file.c:207 [inline]
configfs_write_iter+0x312/0x400 fs/configfs/file.c:229
call_write_iter include/linux/fs.h:2018 [inline]
new_sync_write fs/read_write.c:491 [inline]
vfs_write+0x474/0x9a0 fs/read_write.c:584
ksys_write+0x151/0x260 fs/read_write.c:637
do_syscall_x64 arch/x86/entry/common.c:46 [inline]
do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76
entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7fc7fd39de99
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 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 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffe1987df68 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007fc7fd625fa0 RCX: 00007fc7fd39de99
RDX: 0000000000000001 RSI: 00002000000004c0 RDI: 0000000000000004
RBP: 00007fc7fd433eaf R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fc7fd625fac R14: 00007fc7fd625fa0 R15: 00007fc7fd625fa0
</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_free_ep+0x52/0x2e0 drivers/usb/gadget/function/f_midi2.c:1209
Code: 4c 89 f0 48 c1 e8 03 80 3c 28 00 74 08 4c 89 f7 e8 63 fc 0a fb 41 bc 30 07 00 00 4d 03 26 4c 89 e0 48 c1 e8 03 48 89 44 24 30 <0f> b6 04 28 84 c0 0f 85 50 02 00 00 41 8b 1c 24 31 ff 89 de e8 65
RSP: 0018:ffffc9000332f9c8 EFLAGS: 00010202
RAX: 00000000000000e6 RBX: ffff888060738000 RCX: ffff8880281bda00
RDX: 0000000000000000 RSI: ffffffff8acacbe0 RDI: ffff888060738128
RBP: dffffc0000000000 R08: ffffffff911eb5f7 R09: 1ffffffff223d6be
R10: dffffc0000000000 R11: fffffbfff223d6bf R12: 0000000000000730
R13: dffffc0000000000 R14: ffff888060738128 R15: dffffc0000000000
FS: 0000555559d94500(0000) GS:ffff8880b8f00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055ed11ce2df4 CR3: 0000000025737000 CR4: 00000000003506e0
----------------
Code disassembly (best guess):
0: 4c 89 f0 mov %r14,%rax
3: 48 c1 e8 03 shr $0x3,%rax
7: 80 3c 28 00 cmpb $0x0,(%rax,%rbp,1)
b: 74 08 je 0x15
d: 4c 89 f7 mov %r14,%rdi
10: e8 63 fc 0a fb call 0xfb0afc78
15: 41 bc 30 07 00 00 mov $0x730,%r12d
1b: 4d 03 26 add (%r14),%r12
1e: 4c 89 e0 mov %r12,%rax
21: 48 c1 e8 03 shr $0x3,%rax
25: 48 89 44 24 30 mov %rax,0x30(%rsp)
* 2a: 0f b6 04 28 movzbl (%rax,%rbp,1),%eax <-- trapping instruction
2e: 84 c0 test %al,%al
30: 0f 85 50 02 00 00 jne 0x286
36: 41 8b 1c 24 mov (%r12),%ebx
3a: 31 ff xor %edi,%edi
3c: 89 de mov %ebx,%esi
3e: e8 .byte 0xe8
3f: 65 gs


---
If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.
Reply all
Reply to author
Forward
0 new messages