lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <67de5489.050a0220.31a16b.002a.GAE@google.com>
Date: Fri, 21 Mar 2025 23:11:21 -0700
From: syzbot <syzbot+04dc474cd658421fd07c@...kaller.appspotmail.com>
To: linux-kernel@...r.kernel.org, linux-sound@...r.kernel.org, perex@...ex.cz, 
	syzkaller-bugs@...glegroups.com, tiwai@...e.com
Subject: [syzbot] [sound?] possible deadlock in snd_timer_open

Hello,

syzbot found the following issue on:

HEAD commit:    fc444ada1310 Merge tag 'soc-fixes-6.14-2' of git://git.ker..
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=13dee068580000
kernel config:  https://syzkaller.appspot.com/x/.config?x=7f1ab0f4f8e33050
dashboard link: https://syzkaller.appspot.com/bug?extid=04dc474cd658421fd07c
compiler:       gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40

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

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/d8091bec0ef8/disk-fc444ada.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/0addc811ee52/vmlinux-fc444ada.xz
kernel image: https://storage.googleapis.com/syzbot-assets/f3df78bd6e03/bzImage-fc444ada.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+04dc474cd658421fd07c@...kaller.appspotmail.com

======================================================
WARNING: possible circular locking dependency detected
6.14.0-rc7-syzkaller-00050-gfc444ada1310 #0 Not tainted
------------------------------------------------------
syz.3.1481/11930 is trying to acquire lock:
ffffffff8fdaf688 (register_mutex){+.+.}-{4:4}, at: snd_timer_open+0x90/0x1020 sound/core/timer.c:307

but task is already holding lock:
ffff888030624ac0 (&loopback->cable_lock){+.+.}-{4:4}, at: loopback_open+0x110/0x13a0 sound/drivers/aloop.c:1240

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #2 (&loopback->cable_lock){+.+.}-{4:4}:
       __mutex_lock_common kernel/locking/mutex.c:585 [inline]
       __mutex_lock+0x19b/0xb10 kernel/locking/mutex.c:730
       rule_format+0x111/0x3b0 sound/drivers/aloop.c:982
       constrain_params_by_rules+0x547/0xca0 sound/core/pcm_native.c:436
       snd_pcm_hw_refine sound/core/pcm_native.c:567 [inline]
       snd_pcm_hw_refine+0x7e8/0xad0 sound/core/pcm_native.c:545
       snd_pcm_hw_param_mask sound/core/oss/pcm_oss.c:190 [inline]
       snd_pcm_oss_change_params_locked+0x645/0x3a60 sound/core/oss/pcm_oss.c:886
       snd_pcm_oss_change_params sound/core/oss/pcm_oss.c:1105 [inline]
       snd_pcm_oss_mmap+0x603/0x7c0 sound/core/oss/pcm_oss.c:2914
       call_mmap include/linux/fs.h:2245 [inline]
       mmap_file mm/internal.h:124 [inline]
       __mmap_new_file_vma mm/vma.c:2296 [inline]
       __mmap_new_vma mm/vma.c:2360 [inline]
       __mmap_region+0x181f/0x2760 mm/vma.c:2461
       mmap_region+0x1ab/0x3f0 mm/vma.c:2539
       do_mmap+0xd8d/0x11b0 mm/mmap.c:561
       vm_mmap_pgoff+0x279/0x440 mm/util.c:578
       ksys_mmap_pgoff+0x32c/0x5c0 mm/mmap.c:607
       __do_sys_mmap arch/x86/kernel/sys_x86_64.c:89 [inline]
       __se_sys_mmap arch/x86/kernel/sys_x86_64.c:82 [inline]
       __x64_sys_mmap+0x125/0x190 arch/x86/kernel/sys_x86_64.c:82
       do_syscall_x64 arch/x86/entry/common.c:52 [inline]
       do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83
       entry_SYSCALL_64_after_hwframe+0x77/0x7f

-> #1 (&mm->mmap_lock){++++}-{4:4}:
       __might_fault mm/memory.c:6839 [inline]
       __might_fault+0x11b/0x190 mm/memory.c:6832
       _inline_copy_to_user include/linux/uaccess.h:192 [inline]
       _copy_to_user+0x2d/0xd0 lib/usercopy.c:26
       copy_to_user include/linux/uaccess.h:225 [inline]
       snd_timer_user_gstatus sound/core/timer.c:1699 [inline]
       __snd_timer_user_ioctl.isra.0+0xd47/0x2640 sound/core/timer.c:2256
       snd_timer_user_ioctl+0x72/0xb0 sound/core/timer.c:2291
       vfs_ioctl fs/ioctl.c:51 [inline]
       __do_sys_ioctl fs/ioctl.c:906 [inline]
       __se_sys_ioctl fs/ioctl.c:892 [inline]
       __x64_sys_ioctl+0x190/0x200 fs/ioctl.c:892
       do_syscall_x64 arch/x86/entry/common.c:52 [inline]
       do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83
       entry_SYSCALL_64_after_hwframe+0x77/0x7f

-> #0 (register_mutex){+.+.}-{4:4}:
       check_prev_add kernel/locking/lockdep.c:3163 [inline]
       check_prevs_add kernel/locking/lockdep.c:3282 [inline]
       validate_chain kernel/locking/lockdep.c:3906 [inline]
       __lock_acquire+0x249e/0x3c40 kernel/locking/lockdep.c:5228
       lock_acquire.part.0+0x11b/0x380 kernel/locking/lockdep.c:5851
       __mutex_lock_common kernel/locking/mutex.c:585 [inline]
       __mutex_lock+0x19b/0xb10 kernel/locking/mutex.c:730
       snd_timer_open+0x90/0x1020 sound/core/timer.c:307
       loopback_snd_timer_open+0xaca/0x1020 sound/drivers/aloop.c:1202
       loopback_open+0x2bf/0x13a0 sound/drivers/aloop.c:1268
       snd_pcm_open_substream+0xa50/0x17c0 sound/core/pcm_native.c:2753
       snd_pcm_open_file sound/core/pcm_native.c:2789 [inline]
       snd_pcm_open+0x29b/0x700 sound/core/pcm_native.c:2854
       snd_pcm_playback_open sound/core/pcm_native.c:2814 [inline]
       snd_pcm_playback_open+0x86/0xe0 sound/core/pcm_native.c:2806
       snd_open+0x1fe/0x450 sound/core/sound.c:166
       chrdev_open+0x237/0x6a0 fs/char_dev.c:414
       do_dentry_open+0x735/0x1c40 fs/open.c:956
       vfs_open+0x82/0x3f0 fs/open.c:1086
       do_open fs/namei.c:3830 [inline]
       path_openat+0x1e88/0x2d80 fs/namei.c:3989
       do_filp_open+0x20c/0x470 fs/namei.c:4016
       do_sys_openat2+0x17a/0x1e0 fs/open.c:1428
       do_sys_open fs/open.c:1443 [inline]
       __do_sys_openat fs/open.c:1459 [inline]
       __se_sys_openat fs/open.c:1454 [inline]
       __x64_sys_openat+0x175/0x210 fs/open.c:1454
       do_syscall_x64 arch/x86/entry/common.c:52 [inline]
       do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83
       entry_SYSCALL_64_after_hwframe+0x77/0x7f

other info that might help us debug this:

Chain exists of:
  register_mutex --> &mm->mmap_lock --> &loopback->cable_lock

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&loopback->cable_lock);
                               lock(&mm->mmap_lock);
                               lock(&loopback->cable_lock);
  lock(register_mutex);

 *** DEADLOCK ***

2 locks held by syz.3.1481/11930:
 #0: ffff88814d02fae0 (&pcm->open_mutex){+.+.}-{4:4}, at: snd_pcm_open+0x261/0x700 sound/core/pcm_native.c:2852
 #1: ffff888030624ac0 (&loopback->cable_lock){+.+.}-{4:4}, at: loopback_open+0x110/0x13a0 sound/drivers/aloop.c:1240

stack backtrace:
CPU: 1 UID: 0 PID: 11930 Comm: syz.3.1481 Not tainted 6.14.0-rc7-syzkaller-00050-gfc444ada1310 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:94 [inline]
 dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120
 print_circular_bug+0x490/0x760 kernel/locking/lockdep.c:2076
 check_noncircular+0x31a/0x400 kernel/locking/lockdep.c:2208
 check_prev_add kernel/locking/lockdep.c:3163 [inline]
 check_prevs_add kernel/locking/lockdep.c:3282 [inline]
 validate_chain kernel/locking/lockdep.c:3906 [inline]
 __lock_acquire+0x249e/0x3c40 kernel/locking/lockdep.c:5228
 lock_acquire.part.0+0x11b/0x380 kernel/locking/lockdep.c:5851
 __mutex_lock_common kernel/locking/mutex.c:585 [inline]
 __mutex_lock+0x19b/0xb10 kernel/locking/mutex.c:730
 snd_timer_open+0x90/0x1020 sound/core/timer.c:307
 loopback_snd_timer_open+0xaca/0x1020 sound/drivers/aloop.c:1202
 loopback_open+0x2bf/0x13a0 sound/drivers/aloop.c:1268
 snd_pcm_open_substream+0xa50/0x17c0 sound/core/pcm_native.c:2753
 snd_pcm_open_file sound/core/pcm_native.c:2789 [inline]
 snd_pcm_open+0x29b/0x700 sound/core/pcm_native.c:2854
 snd_pcm_playback_open sound/core/pcm_native.c:2814 [inline]
 snd_pcm_playback_open+0x86/0xe0 sound/core/pcm_native.c:2806
 snd_open+0x1fe/0x450 sound/core/sound.c:166
 chrdev_open+0x237/0x6a0 fs/char_dev.c:414
 do_dentry_open+0x735/0x1c40 fs/open.c:956
 vfs_open+0x82/0x3f0 fs/open.c:1086
 do_open fs/namei.c:3830 [inline]
 path_openat+0x1e88/0x2d80 fs/namei.c:3989
 do_filp_open+0x20c/0x470 fs/namei.c:4016
 do_sys_openat2+0x17a/0x1e0 fs/open.c:1428
 do_sys_open fs/open.c:1443 [inline]
 __do_sys_openat fs/open.c:1459 [inline]
 __se_sys_openat fs/open.c:1454 [inline]
 __x64_sys_openat+0x175/0x210 fs/open.c:1454
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f55a1f8d169
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:00007f55a2e8e038 EFLAGS: 00000246 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 00007f55a21a5fa0 RCX: 00007f55a1f8d169
RDX: 0000000000080000 RSI: 0000400000000c40 RDI: ffffffffffffff9c
RBP: 00007f55a200e2a0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007f55a21a5fa0 R15: 00007ffcdede93a8
 </TASK>


---
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 syzkaller@...glegroups.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ