KASAN: use-after-free Read in release_card_device

Status: upstream: reported C repro on 2026/08/20 00:29
Reported-by: syzbot+c7c0e8197e9af1b74a75@syzkaller.appspotmail.com
First crash: 1d19h, last: 11h08m
Similar bugs (3)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: use-after-free Read in release_card_device prio:high sound 19 C 65 1d15h 16d 23/29 upstream: reported C repro on 2026/08/05 00:12
linux-6.1 KASAN: use-after-free Read in release_card_device 19 syz, C 24 8h16m 21d 0/3 upstream: reported C repro on 2026/07/31 08:33
linux-6.6 KASAN: slab-use-after-free Read in release_card_device 19 4 1d04h 3d15h 0/2 upstream: reported on 2026/08/18 04:57

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in snd_card_do_free sound/core/init.c:601 [inline]
BUG: KASAN: use-after-free in release_card_device+0x1e1/0x1f0 sound/core/init.c:145
Read of size 1 at addr ffff88802b23cdf9 by task syz.0.17/4419

CPU: 0 PID: 4419 Comm: syz.0.17 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
Call Trace:
 <TASK>
 dump_stack_lvl+0x188/0x250 lib/dump_stack.c:106
 print_address_description+0x60/0x2d0 mm/kasan/report.c:248
 __kasan_report mm/kasan/report.c:434 [inline]
 kasan_report+0xdf/0x130 mm/kasan/report.c:451
 snd_card_do_free sound/core/init.c:601 [inline]
 release_card_device+0x1e1/0x1f0 sound/core/init.c:145
 device_release+0x92/0x1c0 drivers/base/core.c:-1
 kobject_cleanup lib/kobject.c:713 [inline]
 kobject_release lib/kobject.c:744 [inline]
 kref_put include/linux/kref.h:65 [inline]
 kobject_put+0x217/0x450 lib/kobject.c:761
 snd_card_file_remove+0x32d/0x380 sound/core/init.c:1132
 snd_pcm_release+0x12b/0x150 sound/core/pcm_native.c:2918
 __fput+0x212/0x8c0 fs/file_table.c:311
 task_work_run+0x125/0x1a0 kernel/task_work.c:188
 tracehook_notify_resume include/linux/tracehook.h:189 [inline]
 exit_to_user_mode_loop+0x10f/0x130 kernel/entry/common.c:181
 exit_to_user_mode_prepare+0xee/0x180 kernel/entry/common.c:214
 __syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline]
 syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:307
 do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:86
 entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7f88489010d9
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:00007ffd949681c8 EFLAGS: 00000246 ORIG_RAX: 00000000000001b4
RAX: 0000000000000000 RBX: 00007f8848b8ada0 RCX: 00007f88489010d9
RDX: 0000000000000000 RSI: 000000000000001e RDI: 0000000000000003
RBP: 00007f8848b8ada0 R08: 0000000000000006 R09: 0000000000000000
R10: 00007f8848b8acb0 R11: 0000000000000246 R12: 0000000000014479
R13: 00007f8848b88fac R14: 0000000000014171 R15: 00007ffd949682d0
 </TASK>

The buggy address belongs to the page:
page:ffffea0000ac8f00 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2b23c
flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000000 ffffea00016c8d08 ffff8880b90409f0 0000000000000000
raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as freed
page last allocated via order 2, migratetype Unmovable, gfp_mask 0x40dc0(GFP_KERNEL|__GFP_COMP|__GFP_ZERO), pid 1, ts 20730674319, free_ts 83130327143
 prep_new_page mm/page_alloc.c:2426 [inline]
 get_page_from_freelist+0x24f6/0x2670 mm/page_alloc.c:4192
 __alloc_pages+0x1ee/0x480 mm/page_alloc.c:5501
 __alloc_pages_node include/linux/gfp.h:570 [inline]
 alloc_pages_node include/linux/gfp.h:584 [inline]
 kmalloc_large_node+0x7d/0x1a0 mm/slub.c:4426
 __kmalloc_node_track_caller+0x219/0x3a0 mm/slub.c:4949
 alloc_dr drivers/base/devres.c:116 [inline]
 __devres_alloc_node+0x49/0x110 drivers/base/devres.c:162
 snd_devm_card_new+0x74/0x150 sound/core/init.c:225
 loopback_probe+0x14d/0x1a20 sound/drivers/aloop.c:1730
 platform_probe+0x137/0x1c0 drivers/base/platform.c:1391
 call_driver_probe drivers/base/dd.c:-1 [inline]
 really_probe+0x276/0xc70 drivers/base/dd.c:595
 __driver_probe_device+0x1f5/0x390 drivers/base/dd.c:775
 driver_probe_device+0x4f/0x420 drivers/base/dd.c:805
 __device_attach_driver+0x2b0/0x500 drivers/base/dd.c:927
 bus_for_each_drv+0x184/0x210 drivers/base/bus.c:429
 __device_attach+0x2a7/0x480 drivers/base/dd.c:999
 bus_probe_device+0xba/0x1d0 drivers/base/bus.c:489
 device_add+0xbcf/0x1050 drivers/base/core.c:3427
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:24 [inline]
 free_pages_prepare mm/page_alloc.c:1340 [inline]
 free_pcp_prepare mm/page_alloc.c:1391 [inline]
 free_unref_page_prepare+0x637/0x6c0 mm/page_alloc.c:3317
 free_unref_page+0x8f/0x2a0 mm/page_alloc.c:3396
 free_nonslab_page+0xde/0x150 mm/slub.c:3540
 release_nodes drivers/base/devres.c:501 [inline]
 devres_release_all+0x1a9/0x230 drivers/base/devres.c:530
 __device_release_driver drivers/base/dd.c:1251 [inline]
 device_release_driver_internal+0x496/0x710 drivers/base/dd.c:1282
 unbind_store+0x2e2/0x300 drivers/base/bus.c:193
 kernfs_fop_write_iter+0x3a8/0x500 fs/kernfs/file.c:296
 call_write_iter include/linux/fs.h:2173 [inline]
 new_sync_write fs/read_write.c:507 [inline]
 vfs_write+0x748/0xd70 fs/read_write.c:594
 ksys_write+0x153/0x260 fs/read_write.c:647
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0

Memory state around the buggy address:
 ffff88802b23cc80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff88802b23cd00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff88802b23cd80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
                                                                ^
 ffff88802b23ce00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff88802b23ce80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================

Crashes (8):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/08/20 09:50 linux-5.15.y 0eb903b5b519 1e72964b .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in release_card_device
2026/08/21 09:14 linux-5.15.y 0eb903b5b519 1e72964b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in release_card_device
2026/08/21 00:49 linux-5.15.y 0eb903b5b519 1e72964b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in release_card_device
2026/08/20 12:01 linux-5.15.y 0eb903b5b519 1e72964b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in release_card_device
2026/08/20 10:27 linux-5.15.y 0eb903b5b519 1e72964b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in release_card_device
2026/08/20 00:31 linux-5.15.y 0eb903b5b519 1e72964b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in release_card_device
2026/08/20 00:28 linux-5.15.y 0eb903b5b519 1e72964b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in release_card_device
2026/08/21 00:51 linux-5.15.y 0eb903b5b519 1e72964b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: out-of-bounds Read in release_card_device
* Struck through repros no longer work on HEAD.