syzbot


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

Status: moderation: reported on 2025/09/29 19:01
Subsystems: sound
[Documentation on labels]
Reported-by: syzbot+e5f88f4af5c7ffbbb66c@syzkaller.appspotmail.com
First crash: 8d07h, last: 8d07h

Sample crash report:
==================================================================
BUG: KASAN: slab-use-after-free in snd_pcm_oss_look_for_setup+0x2d6/0x360 sound/core/oss/pcm_oss.c:2339
Read of size 8 at addr ffff88802a5bf780 by task syz.1.774/9899

CPU: 0 UID: 0 PID: 9899 Comm: syz.1.774 Not tainted syzkaller #0 PREEMPT(full) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/18/2025
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:94 [inline]
 dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120
 print_address_description mm/kasan/report.c:378 [inline]
 print_report+0xcd/0x630 mm/kasan/report.c:482
 kasan_report+0xe0/0x110 mm/kasan/report.c:595
 snd_pcm_oss_look_for_setup+0x2d6/0x360 sound/core/oss/pcm_oss.c:2339
 snd_pcm_oss_open+0xde1/0x1400 sound/core/oss/pcm_oss.c:2505
 soundcore_open+0x40c/0x580 sound/sound_core.c:594
 chrdev_open+0x234/0x6a0 fs/char_dev.c:414
 do_dentry_open+0x982/0x1530 fs/open.c:965
 vfs_open+0x82/0x3f0 fs/open.c:1095
 do_open fs/namei.c:3887 [inline]
 path_openat+0x1de4/0x2cb0 fs/namei.c:4046
 do_filp_open+0x20b/0x470 fs/namei.c:4073
 do_sys_openat2+0x11b/0x1d0 fs/open.c:1435
 do_sys_open fs/open.c:1450 [inline]
 __do_sys_openat fs/open.c:1466 [inline]
 __se_sys_openat fs/open.c:1461 [inline]
 __x64_sys_openat+0x174/0x210 fs/open.c:1461
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xcd/0x4c0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f8de558eec9
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f8de6387038 EFLAGS: 00000246 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 00007f8de57e5fa0 RCX: 00007f8de558eec9
RDX: 00000000000c2202 RSI: 00002000000000c0 RDI: ffffffffffffff9c
RBP: 00007f8de5611f91 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f8de57e6038 R14: 00007f8de57e5fa0 R15: 00007ffd15517ef8
 </TASK>

Allocated by task 5877:
 kasan_save_stack+0x33/0x60 mm/kasan/common.c:47
 kasan_save_track+0x14/0x30 mm/kasan/common.c:68
 poison_kmalloc_redzone mm/kasan/common.c:388 [inline]
 __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:405
 kmalloc_noprof include/linux/slab.h:905 [inline]
 slab_free_hook mm/slub.c:2374 [inline]
 slab_free mm/slub.c:4695 [inline]
 kmem_cache_free+0x142/0x4d0 mm/slub.c:4797
 file_free fs/file_table.c:79 [inline]
 __fput+0x68d/0xb70 fs/file_table.c:481
 fput_close_sync+0x118/0x210 fs/file_table.c:573
 __do_sys_close fs/open.c:1587 [inline]
 __se_sys_close fs/open.c:1572 [inline]
 __x64_sys_close+0x8b/0x120 fs/open.c:1572
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xcd/0x4c0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Freed by task 23:
 kasan_save_stack+0x33/0x60 mm/kasan/common.c:47
 kasan_save_track+0x14/0x30 mm/kasan/common.c:68
 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:576
 poison_slab_object mm/kasan/common.c:243 [inline]
 __kasan_slab_free+0x60/0x70 mm/kasan/common.c:275
 kasan_slab_free include/linux/kasan.h:233 [inline]
 slab_free_hook mm/slub.c:2422 [inline]
 slab_free mm/slub.c:4695 [inline]
 kfree+0x2b4/0x4d0 mm/slub.c:4894
 slab_free_after_rcu_debug+0x60/0x340 mm/slub.c:4732
 rcu_do_batch kernel/rcu/tree.c:2605 [inline]
 rcu_core+0x799/0x1530 kernel/rcu/tree.c:2861
 handle_softirqs+0x216/0x8e0 kernel/softirq.c:579
 run_ksoftirqd kernel/softirq.c:968 [inline]
 run_ksoftirqd+0x3a/0x60 kernel/softirq.c:960
 smpboot_thread_fn+0x3f7/0xae0 kernel/smpboot.c:160
 kthread+0x3c5/0x780 kernel/kthread.c:463
 ret_from_fork+0x56d/0x730 arch/x86/kernel/process.c:148
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245

Last potentially related work creation:
 kasan_save_stack+0x33/0x60 mm/kasan/common.c:47
 kasan_record_aux_stack+0xa7/0xc0 mm/kasan/generic.c:548
 __call_rcu_common.constprop.0+0xa5/0xa10 kernel/rcu/tree.c:3123
 slab_free_hook mm/slub.c:2386 [inline]
 slab_free mm/slub.c:4695 [inline]
 kmem_cache_free+0x16d/0x4d0 mm/slub.c:4797
 file_free fs/file_table.c:79 [inline]
 __fput+0x68d/0xb70 fs/file_table.c:481
 fput_close_sync+0x118/0x210 fs/file_table.c:573
 __do_sys_close fs/open.c:1587 [inline]
 __se_sys_close fs/open.c:1572 [inline]
 __x64_sys_close+0x8b/0x120 fs/open.c:1572
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xcd/0x4c0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

The buggy address belongs to the object at ffff88802a5bf780
 which belongs to the cache kmalloc-32 of size 32
The buggy address is located 0 bytes inside of
 freed 32-byte region [ffff88802a5bf780, ffff88802a5bf7a0)

The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff88802a5bf780 pfn:0x2a5bf
flags: 0xfff00000000200(workingset|node=0|zone=1|lastcpupid=0x7ff)
page_type: f5(slab)
raw: 00fff00000000200 ffff88801b841780 ffffea0000abdd10 ffffea0000c76450
raw: ffff88802a5bf780 000000000040003c 00000000f5000000 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 0, migratetype Unmovable, gfp_mask 0x52800(GFP_NOWAIT|__GFP_NORETRY|__GFP_COMP), pid 2137, tgid 2137 (kworker/u8:1), ts 21582676427, free_ts 0
 set_page_owner include/linux/page_owner.h:32 [inline]
 post_alloc_hook+0x1c0/0x230 mm/page_alloc.c:1851
 prep_new_page mm/page_alloc.c:1859 [inline]
 get_page_from_freelist+0x132b/0x38e0 mm/page_alloc.c:3858
 __alloc_frozen_pages_noprof+0x261/0x23f0 mm/page_alloc.c:5148
 alloc_pages_mpol+0x1fb/0x550 mm/mempolicy.c:2416
 alloc_slab_page mm/slub.c:2492 [inline]
 allocate_slab mm/slub.c:2660 [inline]
 new_slab+0x247/0x330 mm/slub.c:2714
 ___slab_alloc+0xcf2/0x1750 mm/slub.c:3901
 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3992
 __slab_alloc_node mm/slub.c:4067 [inline]
 slab_alloc_node mm/slub.c:4228 [inline]
 __kmalloc_cache_noprof+0xfb/0x3e0 mm/slub.c:4402
 kmalloc_noprof include/linux/slab.h:905 [inline]
 slab_free_hook mm/slub.c:2374 [inline]
 slab_free mm/slub.c:4695 [inline]
 kmem_cache_free+0x142/0x4d0 mm/slub.c:4797
 __cleanup_sighand kernel/fork.c:1632 [inline]
 __cleanup_sighand+0x73/0xa0 kernel/fork.c:1624
 __exit_signal kernel/exit.c:218 [inline]
 release_task+0xd07/0x1ca0 kernel/exit.c:267
 exit_notify kernel/exit.c:778 [inline]
 do_exit+0x12c1/0x2bf0 kernel/exit.c:973
 call_usermodehelper_exec_async+0x379/0x4c0 kernel/umh.c:122
 ret_from_fork+0x56d/0x730 arch/x86/kernel/process.c:148
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
page_owner free stack trace missing

Memory state around the buggy address:
 ffff88802a5bf680: fa fb fb fb fc fc fc fc 00 00 00 00 fc fc fc fc
 ffff88802a5bf700: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
>ffff88802a5bf780: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
                   ^
 ffff88802a5bf800: fa fb fb fb fc fc fc fc 00 00 06 fc fc fc fc fc
 ffff88802a5bf880: 00 00 00 00 fc fc fc fc 00 00 03 fc fc fc fc fc
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/09/25 19:00 upstream bf40f4b87761 0abd0691 .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto KASAN: slab-use-after-free Read in snd_pcm_oss_look_for_setup
* Struck through repros no longer work on HEAD.