[moderation] [sound?] KASAN: slab-use-after-free Read in snd_pcm_action

0 views
Skip to first unread message

syzbot

unread,
Sep 18, 2025, 2:55:29 PM (2 days ago) Sep 18
to syzkaller-upst...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: f83a4f2a4d8c Merge tag 'erofs-for-6.17-rc6-fixes' of git:/..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=11fea762580000
kernel config: https://syzkaller.appspot.com/x/.config?x=f5b21423ca3f0a96
dashboard link: https://syzkaller.appspot.com/bug?extid=6c3ed41643a478d15c5d
compiler: Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD 20.1.8
CC: [linux-...@vger.kernel.org linux...@vger.kernel.org pe...@perex.cz ti...@suse.com]

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/50b5277b6ac5/disk-f83a4f2a.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/78760efc4d47/vmlinux-f83a4f2a.xz
kernel image: https://storage.googleapis.com/syzbot-assets/81bae8020e6e/bzImage-f83a4f2a.xz

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

==================================================================
BUG: KASAN: slab-use-after-free in rt_spin_lock+0x88/0x2c0 kernel/locking/spinlock_rt.c:56
Read of size 1 at addr ffff888036bac200 by task syz.6.1857/14042

CPU: 1 UID: 0 PID: 14042 Comm: syz.6.1857 Not tainted syzkaller #0 PREEMPT_{RT,(full)}
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/18/2025
Call Trace:
<TASK>
dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120
print_address_description mm/kasan/report.c:378 [inline]
print_report+0xca/0x240 mm/kasan/report.c:482
kasan_report+0x118/0x150 mm/kasan/report.c:595
__kasan_check_byte+0x2a/0x40 mm/kasan/common.c:568
kasan_check_byte include/linux/kasan.h:399 [inline]
lock_acquire+0x8d/0x360 kernel/locking/lockdep.c:5842
rt_spin_lock+0x88/0x2c0 kernel/locking/spinlock_rt.c:56
spin_lock include/linux/spinlock_rt.h:44 [inline]
__wake_up_common_lock+0x2f/0x1e0 kernel/sched/wait.c:124
snd_pcm_action_single sound/core/pcm_native.c:-1 [inline]
snd_pcm_action+0x1f1/0x240 sound/core/pcm_native.c:1388
loopback_check_format sound/drivers/aloop.c:363 [inline]
loopback_trigger+0xb01/0x1ac0 sound/drivers/aloop.c:411
snd_pcm_do_start+0xb4/0x180 sound/core/pcm_native.c:1449
snd_pcm_action_single sound/core/pcm_native.c:1305 [inline]
snd_pcm_action+0xe7/0x240 sound/core/pcm_native.c:1388
__snd_pcm_lib_xfer+0x1767/0x1ce0 sound/core/pcm_lib.c:2405
snd_pcm_oss_write3+0x1bc/0x320 sound/core/oss/pcm_oss.c:1241
snd_pcm_oss_write2 sound/core/oss/pcm_oss.c:1381 [inline]
snd_pcm_oss_sync1+0x345/0x770 sound/core/oss/pcm_oss.c:1615
snd_pcm_oss_sync+0x86c/0xc30 sound/core/oss/pcm_oss.c:1680
snd_pcm_oss_release+0x102/0x250 sound/core/oss/pcm_oss.c:2574
__fput+0x458/0xa80 fs/file_table.c:468
task_work_run+0x1d4/0x260 kernel/task_work.c:227
resume_user_mode_work include/linux/resume_user_mode.h:50 [inline]
exit_to_user_mode_loop+0xec/0x110 kernel/entry/common.c:43
exit_to_user_mode_prepare include/linux/irq-entry-common.h:225 [inline]
syscall_exit_to_user_mode_work include/linux/entry-common.h:175 [inline]
syscall_exit_to_user_mode include/linux/entry-common.h:210 [inline]
do_syscall_64+0x2bd/0x3b0 arch/x86/entry/syscall_64.c:100
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fb94d78eba9
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:00007ffd13a8ab78 EFLAGS: 00000246 ORIG_RAX: 00000000000001b4
RAX: 0000000000000000 RBX: 00007fb94d9d7da0 RCX: 00007fb94d78eba9
RDX: 0000000000000000 RSI: 000000000000001e RDI: 0000000000000003
RBP: 00007fb94d9d7da0 R08: 0000000000000050 R09: 0000000513a8ae6f
R10: 00007fb94d9d7cb0 R11: 0000000000000246 R12: 000000000012d330
R13: 00007fb94d9d6180 R14: ffffffffffffffff R15: 00007ffd13a8ac90
</TASK>

Allocated by task 14046:
kasan_save_stack mm/kasan/common.c:47 [inline]
kasan_save_track+0x3e/0x80 mm/kasan/common.c:68
poison_kmalloc_redzone mm/kasan/common.c:388 [inline]
__kasan_kmalloc+0x93/0xb0 mm/kasan/common.c:405
kasan_kmalloc include/linux/kasan.h:260 [inline]
__kmalloc_cache_noprof+0x1a8/0x320 mm/slub.c:4407
kmalloc_noprof include/linux/slab.h:905 [inline]
kzalloc_noprof include/linux/slab.h:1039 [inline]
snd_pcm_attach_substream+0x5b7/0xb50 sound/core/pcm.c:938
snd_pcm_open_substream+0xb9/0x23a0 sound/core/pcm_native.c:2751
snd_pcm_oss_open_file sound/core/oss/pcm_oss.c:2438 [inline]
snd_pcm_oss_open+0xf35/0x1bf0 sound/core/oss/pcm_oss.c:2519
chrdev_open+0x4cf/0x5e0 fs/char_dev.c:414
do_dentry_open+0x9b1/0x1350 fs/open.c:965
vfs_open+0x3b/0x350 fs/open.c:1095
do_open fs/namei.c:3887 [inline]
path_openat+0x2ef1/0x3840 fs/namei.c:4046
do_filp_open+0x1fa/0x410 fs/namei.c:4073
do_sys_openat2+0x121/0x1c0 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+0x138/0x170 fs/open.c:1461
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f

Freed by task 14046:
kasan_save_stack mm/kasan/common.c:47 [inline]
kasan_save_track+0x3e/0x80 mm/kasan/common.c:68
kasan_save_free_info+0x46/0x50 mm/kasan/generic.c:576
poison_slab_object mm/kasan/common.c:243 [inline]
__kasan_slab_free+0x5b/0x80 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+0x195/0x550 mm/slub.c:4894
snd_pcm_detach_substream+0x1e1/0x290 sound/core/pcm.c:1003
snd_pcm_oss_release_file sound/core/oss/pcm_oss.c:2397 [inline]
snd_pcm_oss_release+0x184/0x250 sound/core/oss/pcm_oss.c:2576
__fput+0x458/0xa80 fs/file_table.c:468
task_work_run+0x1d4/0x260 kernel/task_work.c:227
resume_user_mode_work include/linux/resume_user_mode.h:50 [inline]
exit_to_user_mode_loop+0xec/0x110 kernel/entry/common.c:43
exit_to_user_mode_prepare include/linux/irq-entry-common.h:225 [inline]
syscall_exit_to_user_mode_work include/linux/entry-common.h:175 [inline]
syscall_exit_to_user_mode include/linux/entry-common.h:210 [inline]
do_syscall_64+0x2bd/0x3b0 arch/x86/entry/syscall_64.c:100
entry_SYSCALL_64_after_hwframe+0x77/0x7f

The buggy address belongs to the object at ffff888036bac000
which belongs to the cache kmalloc-2k of size 2048
The buggy address is located 512 bytes inside of
freed 2048-byte region [ffff888036bac000, ffff888036bac800)

The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x36ba8
head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
anon flags: 0x80000000000040(head|node=0|zone=1)
page_type: f5(slab)
raw: 0080000000000040 ffff888019842000 0000000000000000 dead000000000001
raw: 0000000000000000 0000000000080008 00000000f5000000 0000000000000000
head: 0080000000000040 ffff888019842000 0000000000000000 dead000000000001
head: 0000000000000000 0000000000080008 00000000f5000000 0000000000000000
head: 0080000000000003 ffffea0000daea01 00000000ffffffff 00000000ffffffff
head: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000008
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 1229, tgid 1229 (kworker/1:2), ts 105047104183, free_ts 104968168334
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x240/0x2a0 mm/page_alloc.c:1851
prep_new_page mm/page_alloc.c:1859 [inline]
get_page_from_freelist+0x2119/0x21b0 mm/page_alloc.c:3858
__alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:5148
alloc_pages_mpol+0xd1/0x380 mm/mempolicy.c:2416
alloc_slab_page mm/slub.c:2492 [inline]
allocate_slab+0x8a/0x370 mm/slub.c:2660
new_slab mm/slub.c:2714 [inline]
___slab_alloc+0x8d1/0xdc0 mm/slub.c:3901
__slab_alloc mm/slub.c:3992 [inline]
__slab_alloc_node mm/slub.c:4067 [inline]
slab_alloc_node mm/slub.c:4228 [inline]
__do_kmalloc_node mm/slub.c:4375 [inline]
__kmalloc_node_track_caller_noprof+0x14c/0x450 mm/slub.c:4395
kmalloc_reserve+0x136/0x290 net/core/skbuff.c:600
__alloc_skb+0x142/0x2d0 net/core/skbuff.c:669
alloc_skb include/linux/skbuff.h:1336 [inline]
mld_newpack+0x13c/0xc40 net/ipv6/mcast.c:1780
add_grhead+0x5a/0x2a0 net/ipv6/mcast.c:1891
add_grec+0x1452/0x1740 net/ipv6/mcast.c:2030
mld_send_cr net/ipv6/mcast.c:2153 [inline]
mld_ifc_work+0x6ed/0xd60 net/ipv6/mcast.c:2698
process_one_work kernel/workqueue.c:3236 [inline]
process_scheduled_works+0xade/0x17b0 kernel/workqueue.c:3319
worker_thread+0x8a0/0xda0 kernel/workqueue.c:3400
kthread+0x70e/0x8a0 kernel/kthread.c:463
page last free pid 5206 tgid 5206 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
free_pages_prepare mm/page_alloc.c:1395 [inline]
__free_frozen_pages+0xb59/0xce0 mm/page_alloc.c:2895
__slab_free+0x2db/0x390 mm/slub.c:4606
qlink_free mm/kasan/quarantine.c:163 [inline]
qlist_free_all+0x97/0x140 mm/kasan/quarantine.c:179
kasan_quarantine_reduce+0x148/0x160 mm/kasan/quarantine.c:286
__kasan_slab_alloc+0x22/0x80 mm/kasan/common.c:340
kasan_slab_alloc include/linux/kasan.h:250 [inline]
slab_post_alloc_hook mm/slub.c:4191 [inline]
slab_alloc_node mm/slub.c:4240 [inline]
kmem_cache_alloc_noprof+0x143/0x310 mm/slub.c:4247
getname_flags+0xb8/0x540 fs/namei.c:146
getname include/linux/fs.h:2919 [inline]
getname_maybe_null include/linux/fs.h:2926 [inline]
vfs_fstatat+0x43/0x170 fs/stat.c:370
__do_sys_newfstatat fs/stat.c:542 [inline]
__se_sys_newfstatat fs/stat.c:536 [inline]
__x64_sys_newfstatat+0x116/0x190 fs/stat.c:536
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f

Memory state around the buggy address:
ffff888036bac100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888036bac180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888036bac200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888036bac280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888036bac300: 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