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
Fix commit: d3d67f680dbc ALSA: core: Fix use-after-free in snd_card_do_free()
Patched on: [ci2-linux-5-15-kasan ci2-linux-5-15-kasan-perf], missing on: [ci2-linux-5-15-kasan-arm64]
First crash: 54d, last: 47d
Fix bisection: fixed by (bisect log) :
commit d3d67f680dbc23a5e5e3d3ecfdbf700465809877
Author: Aleksandr Nogikh <nogikh@google.com>
Date: Fri Aug 14 12:05:43 2026 +0000

  ALSA: core: Fix use-after-free in snd_card_do_free()

  
▶ ▼ 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 54d 69d 27/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 error 47 47d 74d 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 syz, C error 8 47d 56d 0/2 upstream: reported C repro on 2026/08/18 04:57
▶ ▼ Last patch testing requests (1)
Created Duration User Patch Repo Result
2026/09/20 21:23 2m retest repro linux-5.15.y error job log

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 ffff88802ac54df9 by task syz.4.7/4280

CPU: 1 PID: 4280 Comm: syz.4.7 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:0x7fae63ed60d9
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:00007ffc618552a8 EFLAGS: 00000246 ORIG_RAX: 00000000000001b4
RAX: 0000000000000000 RBX: 00007fae6415fda0 RCX: 00007fae63ed60d9
RDX: 0000000000000000 RSI: 000000000000001e RDI: 0000000000000003
RBP: 00007fae6415fda0 R08: 0000000000000006 R09: 0000000000000000
R10: 00007fae6415fcb0 R11: 0000000000000246 R12: 0000000000012266
R13: 00007fae6415e09c R14: 0000000000011fbe R15: 00007fae6415e090
 </TASK>

The buggy address belongs to the page:
page:ffffea0000ab1500 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2ac54
head:ffffea0000ab1500 order:2 compound_mapcount:0 compound_pincount:0
flags: 0xfff00000010000(head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010000 0000000000000000 dead000000000122 0000000000000000
raw: 0000000000000000 0000000000000000 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 2, migratetype Unmovable, gfp_mask 0x152dc0(GFP_USER|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_ZERO), pid 4277, ts 74669229360, free_ts 74413588354
 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+0x21e/0x3a0 mm/slub.c:4442
 kmalloc_node include/linux/slab.h:630 [inline]
 kvmalloc_node+0x84/0x130 mm/util.c:619
 kvmalloc include/linux/mm.h:816 [inline]
 kvzalloc include/linux/mm.h:824 [inline]
 btrfs_mount_root+0x11e/0x930 fs/btrfs/super.c:1694
 legacy_get_tree+0xe6/0x180 fs/fs_context.c:611
 vfs_get_tree+0x88/0x270 fs/super.c:1541
 fc_mount fs/namespace.c:1005 [inline]
 vfs_kern_mount+0xba/0x150 fs/namespace.c:1035
 btrfs_mount+0x342/0xb10 fs/btrfs/super.c:1811
 legacy_get_tree+0xe6/0x180 fs/fs_context.c:611
 vfs_get_tree+0x88/0x270 fs/super.c:1541
 do_new_mount+0x247/0xa40 fs/namespace.c:3034
 do_mount fs/namespace.c:3377 [inline]
 __do_sys_mount fs/namespace.c:3585 [inline]
 __se_sys_mount+0x2e3/0x3d0 fs/namespace.c:3562
 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
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:2179 [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:
 ffff88802ac54c80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff88802ac54d00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff88802ac54d80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                                                                ^
 ffff88802ac54e00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff88802ac54e80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================

Crashes (22):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/08/27 03:32 linux-5.15.y 945fa863f02c a2b77b9e .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/27 01:57 linux-5.15.y 945fa863f02c a2b77b9e .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/26 18:29 linux-5.15.y 945fa863f02c a2b77b9e .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/26 07:09 linux-5.15.y 945fa863f02c 6a91adb4 .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/26 05:08 linux-5.15.y 945fa863f02c 6a91adb4 .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/25 11:04 linux-5.15.y 945fa863f02c 614e416a .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/25 11:03 linux-5.15.y 945fa863f02c 614e416a .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/25 07:07 linux-5.15.y 945fa863f02c 614e416a .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/24 09:12 linux-5.15.y 945fa863f02c 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/23 03:11 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/23 03:09 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 23:34 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 23:33 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 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 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/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/23 04:45 linux-5.15.y 0eb903b5b519 1e72964b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: slab-out-of-bounds 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.