KASAN: slab-use-after-free Read in release_card_device

Status: upstream: reported on 2026/08/18 04:57
Reported-by: syzbot+51895fd72f16150d9f6b@syzkaller.appspotmail.com
First crash: 1d17h, last: 1h06m
Similar bugs (2)
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 59 1h21m 14d 5/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 8 13h05m 19d 0/3 upstream: reported C repro on 2026/07/31 08:33

Sample crash report:
==================================================================
BUG: KASAN: slab-use-after-free in snd_card_do_free sound/core/init.c:608 [inline]
BUG: KASAN: slab-use-after-free in release_card_device+0x196/0x1a0 sound/core/init.c:153
Read of size 1 at addr ffff88802c0c88f1 by task syz.3.5356/25391

CPU: 0 PID: 25391 Comm: syz.3.5356 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
 snd_card_do_free sound/core/init.c:608 [inline]
 release_card_device+0x196/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
 snd_card_file_remove+0x331/0x380 sound/core/init.c:1140
 snd_pcm_release+0x12f/0x150 sound/core/pcm_native.c:2941
 __fput+0x221/0x940 fs/file_table.c:418
 task_work_run+0x1d4/0x260 kernel/task_work.c:245
 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
 exit_to_user_mode_loop+0xe6/0x110 kernel/entry/common.c:177
 exit_to_user_mode_prepare+0xee/0x180 kernel/entry/common.c:210
 __syscall_exit_to_user_mode_work kernel/entry/common.c:291 [inline]
 syscall_exit_to_user_mode+0x1a/0x50 kernel/entry/common.c:302
 do_syscall_64+0x61/0xb0 arch/x86/entry/common.c:82
 entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7f474679e0d9
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:00007ffc96f73718 EFLAGS: 00000246 ORIG_RAX: 00000000000001b4
RAX: 0000000000000000 RBX: 00007f4746a27da0 RCX: 00007f474679e0d9
RDX: 0000000000000000 RSI: 000000000000001e RDI: 0000000000000003
RBP: 00007f4746a27da0 R08: 0000000000000006 R09: 0000000000000000
R10: 00007f4746a27cb0 R11: 0000000000000246 R12: 0000000000194c20
R13: 00007f4746a25fac R14: 00000000001949ec R15: 00007ffc96f73820
 </TASK>

Allocated by task 1:
 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
 kasan_kmalloc include/linux/kasan.h:198 [inline]
 __do_kmalloc_node mm/slab_common.c:1007 [inline]
 __kmalloc_node_track_caller+0xb4/0x230 mm/slab_common.c:1027
 alloc_dr drivers/base/devres.c:119 [inline]
 __devres_alloc_node+0x4c/0x120 drivers/base/devres.c:167
 snd_devm_card_new+0x78/0x150 sound/core/init.c:235
 loopback_probe+0x151/0x1a30 sound/drivers/aloop.c:1716
 platform_probe+0x13b/0x1c0 drivers/base/platform.c:1376
 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
 platform_device_add+0x4c3/0x830 drivers/base/platform.c:716
 platform_device_register_full+0x472/0x560 drivers/base/platform.c:843
 platform_device_register_resndata include/linux/platform_device.h:164 [inline]
 platform_device_register_simple include/linux/platform_device.h:193 [inline]
 alsa_card_loopback_init+0x156/0x2b0 sound/drivers/aloop.c:1810
 do_one_initcall+0x242/0x790 init/main.c:1210
 do_initcall_level+0x13d/0x1f0 init/main.c:1272
 do_initcalls+0x69/0xd0 init/main.c:1288
 kernel_init_freeable+0x3d9/0x560 init/main.c:1525
 kernel_init+0x1d/0x1c0 init/main.c:1415
 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 25392:
 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
 release_nodes drivers/base/devres.c:506 [inline]
 devres_release_all+0x1ad/0x230 drivers/base/devres.c:535
 device_unbind_cleanup drivers/base/dd.c:608 [inline]
 __device_release_driver drivers/base/dd.c:1356 [inline]
 device_release_driver_internal+0x4c0/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 ffff88802c0c8000
 which belongs to the cache kmalloc-8k of size 8192
The buggy address is located 2289 bytes inside of
 freed 8192-byte region [ffff88802c0c8000, ffff88802c0ca000)

The buggy address belongs to the physical page:
page:ffffea0000b03200 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2c0c8
head:ffffea0000b03200 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 ffff888017c42280 dead000000000122 0000000000000000
raw: 0000000000000000 0000000000020002 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 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 1, tgid 1 (swapper/0), ts 24167798201, free_ts 0
 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_page_interleave+0x24/0x1e0 mm/mempolicy.c:2118
 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
 alloc_dr drivers/base/devres.c:119 [inline]
 __devres_alloc_node+0x4c/0x120 drivers/base/devres.c:167
 snd_devm_card_new+0x78/0x150 sound/core/init.c:235
 loopback_probe+0x151/0x1a30 sound/drivers/aloop.c:1716
 platform_probe+0x13b/0x1c0 drivers/base/platform.c:1376
 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
page_owner free stack trace missing

Memory state around the buggy address:
 ffff88802c0c8780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88802c0c8800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88802c0c8880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                                             ^
 ffff88802c0c8900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88802c0c8980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/08/19 21:32 linux-6.6.y c610b395b0a5 1e72964b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan KASAN: slab-use-after-free Read in release_card_device
2026/08/19 21:31 linux-6.6.y c610b395b0a5 1e72964b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan KASAN: slab-use-after-free Read in release_card_device
2026/08/18 04:57 linux-6.6.y d27334b2888c 1e72964b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan KASAN: slab-use-after-free Read in release_card_device
* Struck through repros no longer work on HEAD.