[v6.6] KASAN: slab-use-after-free Write in snd_usb_midi_v2_free

1 view
Skip to first unread message

syzbot

unread,
Aug 10, 2026, 6:53:34 PM (11 hours ago) Aug 10
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: d27334b2888c Linux 6.6.151
git tree: linux-6.6.y
console output: https://syzkaller.appspot.com/x/log.txt?x=127df079580000
kernel config: https://syzkaller.appspot.com/x/.config?x=f0bc3d90c30838b5
dashboard link: https://syzkaller.appspot.com/bug?extid=6850b881c9cf84070e18
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/695139abd971/disk-d27334b2.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/b11fc121442a/vmlinux-d27334b2.xz
kernel image: https://storage.googleapis.com/syzbot-assets/e226f54f9286/bzImage-d27334b2.xz

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

BUG: KASAN: slab-use-after-free in free_all_midi2_umps sound/usb/midi2.c:707 [inline]
BUG: KASAN: slab-use-after-free in snd_usb_midi_v2_free+0x602/0x7b0 sound/usb/midi2.c:945
Write of size 8 at addr ffff88802512c358 by task syz.2.648/8583

CPU: 0 PID: 8583 Comm: syz.2.648 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
Call Trace:
<TASK>
dump_stack_lvl+0x18c/0x250 lib/dump_stack.c:106
print_address_description mm/kasan/report.c:364 [inline]
print_report+0xa8/0x210 mm/kasan/report.c:468
kasan_report+0x117/0x150 mm/kasan/report.c:581
free_all_midi2_umps sound/usb/midi2.c:707 [inline]
snd_usb_midi_v2_free+0x602/0x7b0 sound/usb/midi2.c:945
snd_usb_midi_v2_free_all+0x67/0x90 sound/usb/midi2.c:1245
snd_usb_audio_free+0x4c/0x100 sound/usb/card.c:494
snd_card_do_free sound/core/init.c:601 [inline]
release_card_device+0x9f/0x1a0 sound/core/init.c:153
device_release+0xbc/0x1e0 drivers/base/core.c:-1
kobject_cleanup lib/kobject.c:689 [inline]
kobject_release lib/kobject.c:720 [inline]
kref_put include/linux/kref.h:65 [inline]
kobject_put+0x21b/0x450 lib/kobject.c:737
usb_audio_disconnect+0x60c/0x700 sound/usb/card.c:1007
usb_unbind_interface+0x207/0x870 drivers/usb/core/driver.c:458
device_remove drivers/base/dd.c:628 [inline]
__device_release_driver drivers/base/dd.c:1351 [inline]
device_release_driver_internal+0x458/0x6f0 drivers/base/dd.c:1374
bus_remove_device+0x43b/0x520 drivers/base/bus.c:624
device_del+0x51f/0x910 drivers/base/core.c:3889
usb_disable_device+0x3ee/0x8a0 drivers/usb/core/message.c:1474
usb_disconnect+0x340/0x8a0 drivers/usb/core/hub.c:2315
hub_quiesce+0x171/0x330 drivers/usb/core/hub.c:1379
hub_disconnect+0xc6/0x450 drivers/usb/core/hub.c:1785
usb_unbind_interface+0x207/0x870 drivers/usb/core/driver.c:458
device_remove drivers/base/dd.c:628 [inline]
__device_release_driver drivers/base/dd.c:1351 [inline]
device_release_driver_internal+0x458/0x6f0 drivers/base/dd.c:1374
bus_remove_device+0x43b/0x520 drivers/base/bus.c:624
device_del+0x51f/0x910 drivers/base/core.c:3889
usb_disable_device+0x3ee/0x8a0 drivers/usb/core/message.c:1474
usb_set_configuration+0x449/0x2150 drivers/usb/core/message.c:2121
usb_unbind_device+0x72/0x160 drivers/usb/core/driver.c:309
device_remove drivers/base/dd.c:628 [inline]
__device_release_driver drivers/base/dd.c:1351 [inline]
device_release_driver_internal+0x458/0x6f0 drivers/base/dd.c:1374
unbind_store+0x1a1/0x1d0 drivers/base/bus.c:244
kernfs_fop_write_iter+0x3a4/0x520 fs/kernfs/file.c:352
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:0x7ff2fad9e0d9
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:00007ff2fbcad028 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007ff2fb025fa0 RCX: 00007ff2fad9e0d9
RDX: 0000000000000004 RSI: 0000200000000200 RDI: 0000000000000007
RBP: 00007ff2fae35024 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ff2fb026038 R14: 00007ff2fb025fa0 R15: 00007ffe02eae378
</TASK>

Allocated by task 9:
kasan_save_stack mm/kasan/common.c:46 [inline]
kasan_set_track+0x4e/0x70 mm/kasan/common.c:53
____kasan_kmalloc mm/kasan/common.c:375 [inline]
__kasan_kmalloc+0x8f/0xa0 mm/kasan/common.c:384
kmalloc include/linux/slab.h:600 [inline]
kzalloc include/linux/slab.h:721 [inline]
snd_ump_endpoint_new+0x7d/0x3a0 sound/core/ump.c:137
create_midi2_ump+0x314/0x7b0 sound/usb/midi2.c:735
find_matching_ep_partner sound/usb/midi2.c:799 [inline]
parse_midi_2_0 sound/usb/midi2.c:977 [inline]
snd_usb_midi_v2_create+0x1382/0x48a0 sound/usb/midi2.c:1134
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:2660
hub_port_connect drivers/usb/core/hub.c:5529 [inline]
hub_port_connect_change drivers/usb/core/hub.c:5669 [inline]
port_event drivers/usb/core/hub.c:5833 [inline]
hub_event+0x29d5/0x4a80 drivers/usb/core/hub.c:5915
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

Freed by task 8583:
kasan_save_stack mm/kasan/common.c:46 [inline]
kasan_set_track+0x4e/0x70 mm/kasan/common.c:53
kasan_save_free_info+0x28/0x40 mm/kasan/generic.c:522
____kasan_slab_free+0x126/0x1f0 mm/kasan/common.c:237
kasan_slab_free include/linux/kasan.h:164 [inline]
slab_free_hook mm/slub.c:1811 [inline]
slab_free_freelist_hook+0x130/0x1a0 mm/slub.c:1837
slab_free mm/slub.c:3830 [inline]
__kmem_cache_free+0xba/0x1f0 mm/slub.c:3843
snd_rawmidi_free+0x3f2/0x410 sound/core/rawmidi.c:1996
snd_rawmidi_dev_free+0x38/0x40 sound/core/rawmidi.c:2005
__snd_device_free+0x1cd/0x2e0 sound/core/device.c:76
snd_device_free_all+0xcf/0x180 sound/core/device.c:233
snd_card_do_free sound/core/init.c:599 [inline]
release_card_device+0x6f/0x1a0 sound/core/init.c:153
device_release+0xbc/0x1e0 drivers/base/core.c:-1
kobject_cleanup lib/kobject.c:689 [inline]
kobject_release lib/kobject.c:720 [inline]
kref_put include/linux/kref.h:65 [inline]
kobject_put+0x21b/0x450 lib/kobject.c:737
usb_audio_disconnect+0x60c/0x700 sound/usb/card.c:1007
usb_unbind_interface+0x207/0x870 drivers/usb/core/driver.c:458
device_remove drivers/base/dd.c:628 [inline]
__device_release_driver drivers/base/dd.c:1351 [inline]
device_release_driver_internal+0x458/0x6f0 drivers/base/dd.c:1374
bus_remove_device+0x43b/0x520 drivers/base/bus.c:624
device_del+0x51f/0x910 drivers/base/core.c:3889
usb_disable_device+0x3ee/0x8a0 drivers/usb/core/message.c:1474
usb_disconnect+0x340/0x8a0 drivers/usb/core/hub.c:2315
hub_quiesce+0x171/0x330 drivers/usb/core/hub.c:1379
hub_disconnect+0xc6/0x450 drivers/usb/core/hub.c:1785
usb_unbind_interface+0x207/0x870 drivers/usb/core/driver.c:458
device_remove drivers/base/dd.c:628 [inline]
__device_release_driver drivers/base/dd.c:1351 [inline]
device_release_driver_internal+0x458/0x6f0 drivers/base/dd.c:1374
bus_remove_device+0x43b/0x520 drivers/base/bus.c:624
device_del+0x51f/0x910 drivers/base/core.c:3889
usb_disable_device+0x3ee/0x8a0 drivers/usb/core/message.c:1474
usb_set_configuration+0x449/0x2150 drivers/usb/core/message.c:2121
usb_unbind_device+0x72/0x160 drivers/usb/core/driver.c:309
device_remove drivers/base/dd.c:628 [inline]
__device_release_driver drivers/base/dd.c:1351 [inline]
device_release_driver_internal+0x458/0x6f0 drivers/base/dd.c:1374
unbind_store+0x1a1/0x1d0 drivers/base/bus.c:244
kernfs_fop_write_iter+0x3a4/0x520 fs/kernfs/file.c:352
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

The buggy address belongs to the object at ffff88802512c000
which belongs to the cache kmalloc-4k of size 4096
The buggy address is located 856 bytes inside of
freed 4096-byte region [ffff88802512c000, ffff88802512d000)

The buggy address belongs to the physical page:
page:ffffea0000944a00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x25128
head:ffffea0000944a00 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0
flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 00fff00000000840 ffff888017c42140 dead000000000100 dead000000000122
raw: 0000000000000000 0000000000040004 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Unmovable, gfp_mask 0x1d2820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 2108, tgid 2108 (kworker/u4:6), ts 191776680140, free_ts 191671146586
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook+0x1c1/0x200 mm/page_alloc.c:1582
prep_new_page mm/page_alloc.c:1589 [inline]
get_page_from_freelist+0x2181/0x22a0 mm/page_alloc.c:3221
__alloc_pages+0x1f0/0x460 mm/page_alloc.c:4501
alloc_slab_page+0x5d/0x180 mm/slub.c:1881
allocate_slab mm/slub.c:2028 [inline]
new_slab+0x87/0x2d0 mm/slub.c:2081
___slab_alloc+0xc5c/0x12f0 mm/slub.c:3253
__slab_alloc mm/slub.c:3339 [inline]
__slab_alloc_node mm/slub.c:3392 [inline]
slab_alloc_node mm/slub.c:3485 [inline]
__kmem_cache_alloc_node+0x11f/0x250 mm/slub.c:3534
__do_kmalloc_node mm/slab_common.c:1006 [inline]
__kmalloc_node_track_caller+0xa4/0x230 mm/slab_common.c:1027
kmalloc_reserve+0x116/0x240 net/core/skbuff.c:584
__alloc_skb+0x138/0x2c0 net/core/skbuff.c:653
alloc_skb include/linux/skbuff.h:1316 [inline]
nsim_dev_trap_skb_build drivers/net/netdevsim/dev.c:748 [inline]
nsim_dev_trap_report drivers/net/netdevsim/dev.c:805 [inline]
nsim_dev_trap_report_work+0x253/0xa90 drivers/net/netdevsim/dev.c:851
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
page last free stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1182 [inline]
free_unref_page_prepare+0x7d7/0x8f0 mm/page_alloc.c:2366
free_unref_page+0x32/0x2e0 mm/page_alloc.c:2459
discard_slab mm/slub.c:2127 [inline]
__unfreeze_partials+0x1cf/0x210 mm/slub.c:2667
put_cpu_partial+0x17c/0x250 mm/slub.c:2743
__slab_free+0x319/0x400 mm/slub.c:3700
qlink_free mm/kasan/quarantine.c:166 [inline]
qlist_free_all+0x75/0xd0 mm/kasan/quarantine.c:185
kasan_quarantine_reduce+0x143/0x160 mm/kasan/quarantine.c:292
__kasan_slab_alloc+0x22/0x80 mm/kasan/common.c:306
kasan_slab_alloc include/linux/kasan.h:188 [inline]
slab_post_alloc_hook+0x6a/0x4d0 mm/slab.h:770
slab_alloc_node mm/slub.c:3495 [inline]
slab_alloc mm/slub.c:3503 [inline]
__kmem_cache_alloc_lru mm/slub.c:3510 [inline]
kmem_cache_alloc+0x17e/0x2c0 mm/slub.c:3519
getname_flags+0xbb/0x500 fs/namei.c:140
user_path_at_empty+0x2c/0x60 fs/namei.c:2959
do_readlinkat+0xdd/0x490 fs/stat.c:494
__do_sys_readlink fs/stat.c:527 [inline]
__se_sys_readlink fs/stat.c:524 [inline]
__x64_sys_readlink+0x7f/0x90 fs/stat.c:524
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

Memory state around the buggy address:
ffff88802512c200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88802512c280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88802512c300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88802512c380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88802512c400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================


---
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
Reply all
Reply to author
Forward
0 new messages