syzbot


possible deadlock in snd_mixer_oss_ioctl1

Status: fixed on 2022/03/08 16:11
Subsystems: sound
[Documentation on labels]
Reported-by: syzbot+ace149a75a9a0a399ac7@syzkaller.appspotmail.com
Fix commit: 3ab799201845 ALSA: mixer: fix deadlock in snd_mixer_oss_set_volume
First crash: 1089d, last: 1084d
Cause bisection: introduced by (bisect log) :
commit 411cef6adfb38a5bb6bd9af3941b28198e7fb680
Author: Takashi Iwai <tiwai@suse.de>
Date: Wed Oct 20 16:48:46 2021 +0000

  ALSA: mixer: oss: Fix racy access to slots

Crash: possible deadlock in snd_mixer_oss_ioctl1 (log)
Repro: C syz .config
  
Discussions (11)
Title Replies (including bot) Last reply
[PATCH 5.10 000/575] 5.10.80-rc1 review 595 (595) 2022/07/31 10:51
[PATCH 4.19 000/323] 4.19.218-rc1 review 339 (339) 2021/12/04 10:30
[PATCH 4.4 000/162] 4.4.293-rc1 review 168 (168) 2021/11/25 13:11
[PATCH 4.14 000/251] 4.14.256-rc1 review 262 (262) 2021/11/25 13:07
[PATCH 4.9 000/207] 4.9.291-rc1 review 216 (216) 2021/11/25 12:58
[PATCH 5.15 000/917] 5.15.3-rc1 review 945 (945) 2021/11/24 18:04
[PATCH 5.4 000/355] 5.4.160-rc1 review 373 (373) 2021/11/16 16:50
[PATCH 5.14 000/849] 5.14.19-rc1 review 859 (859) 2021/11/16 14:04
[PATCH stable-5.4.y 1/2] ALSA: mixer: oss: Fix racy access to slots 3 (3) 2021/11/14 13:43
[PATCH next] ALSA: mixer: fix deadlock in snd_mixer_oss_set_volume 2 (2) 2021/10/26 06:00
[syzbot] possible deadlock in snd_mixer_oss_ioctl1 1 (2) 2021/10/24 14:07

Sample crash report:
============================================
WARNING: possible recursive locking detected
5.15.0-rc6-next-20211022-syzkaller #0 Not tainted
--------------------------------------------
syz-executor206/6529 is trying to acquire lock:
ffff888021ff09c8 (&mixer->reg_mutex){+.+.}-{3:3}, at: snd_mixer_oss_set_volume sound/core/oss/mixer_oss.c:316 [inline]
ffff888021ff09c8 (&mixer->reg_mutex){+.+.}-{3:3}, at: snd_mixer_oss_ioctl1+0x630/0x19a0 sound/core/oss/mixer_oss.c:375

but task is already holding lock:
ffff888021ff09c8 (&mixer->reg_mutex){+.+.}-{3:3}, at: snd_mixer_oss_set_volume sound/core/oss/mixer_oss.c:300 [inline]
ffff888021ff09c8 (&mixer->reg_mutex){+.+.}-{3:3}, at: snd_mixer_oss_ioctl1+0x4b1/0x19a0 sound/core/oss/mixer_oss.c:375

other info that might help us debug this:
 Possible unsafe locking scenario:

       CPU0
       ----
  lock(&mixer->reg_mutex);
  lock(&mixer->reg_mutex);

 *** DEADLOCK ***

 May be due to missing lock nesting notation

1 lock held by syz-executor206/6529:
 #0: ffff888021ff09c8 (&mixer->reg_mutex){+.+.}-{3:3}, at: snd_mixer_oss_set_volume sound/core/oss/mixer_oss.c:300 [inline]
 #0: ffff888021ff09c8 (&mixer->reg_mutex){+.+.}-{3:3}, at: snd_mixer_oss_ioctl1+0x4b1/0x19a0 sound/core/oss/mixer_oss.c:375

stack backtrace:
CPU: 0 PID: 6529 Comm: syz-executor206 Not tainted 5.15.0-rc6-next-20211022-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106
 print_deadlock_bug kernel/locking/lockdep.c:2956 [inline]
 check_deadlock kernel/locking/lockdep.c:2999 [inline]
 validate_chain kernel/locking/lockdep.c:3788 [inline]
 __lock_acquire.cold+0x149/0x3ab kernel/locking/lockdep.c:5027
 lock_acquire kernel/locking/lockdep.c:5637 [inline]
 lock_acquire+0x1ab/0x510 kernel/locking/lockdep.c:5602
 __mutex_lock_common kernel/locking/mutex.c:607 [inline]
 __mutex_lock+0x12f/0x12f0 kernel/locking/mutex.c:740
 snd_mixer_oss_set_volume sound/core/oss/mixer_oss.c:316 [inline]
 snd_mixer_oss_ioctl1+0x630/0x19a0 sound/core/oss/mixer_oss.c:375
 snd_mixer_oss_ioctl+0x40/0x50 sound/core/oss/mixer_oss.c:390
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:874 [inline]
 __se_sys_ioctl fs/ioctl.c:860 [inline]
 __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:860
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7f0c06979fe9
Code: 28 c3 e8 2a 14 00 00 66 2e 0f 1f 84 00 00 00 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 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffea97dd558 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f0c06979fe9
RDX: 0000000020000080 RSI: 00000000c0044d00 RDI: 0000000000000003
RBP: 00007f0c0693dfd0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f0c0693e060
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
 </TASK>

Crashes (149):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2021/10/22 21:49 linux-next cf6c9d12750c 282f03fb .config console log report syz C ci-upstream-linux-next-kasan-gce-root possible deadlock in snd_mixer_oss_ioctl1
2021/10/27 10:36 linux-next 2376e5fe91bc d50eb50a .config console log report info ci-upstream-linux-next-kasan-gce-root possible deadlock in snd_mixer_oss_ioctl1
2021/10/27 09:30 linux-next 2376e5fe91bc d50eb50a .config console log report info ci-upstream-linux-next-kasan-gce-root possible deadlock in snd_mixer_oss_ioctl1
2021/10/27 05:57 linux-next 2376e5fe91bc d50eb50a .config console log report info ci-upstream-linux-next-kasan-gce-root possible deadlock in snd_mixer_oss_ioctl1
2021/10/27 03:58 linux-next 2376e5fe91bc d50eb50a .config console log report info ci-upstream-linux-next-kasan-gce-root possible deadlock in snd_mixer_oss_ioctl1
2021/10/27 03:29 linux-next 2376e5fe91bc d50eb50a .config console log report info ci-upstream-linux-next-kasan-gce-root possible deadlock in snd_mixer_oss_ioctl1
2021/10/27 02:28 linux-next 2376e5fe91bc d50eb50a .config console log report info ci-upstream-linux-next-kasan-gce-root possible deadlock in snd_mixer_oss_ioctl1
2021/10/27 00:49 linux-next 2376e5fe91bc d50eb50a .config console log report info ci-upstream-linux-next-kasan-gce-root possible deadlock in snd_mixer_oss_ioctl1
2021/10/26 23:43 linux-next 2376e5fe91bc d50eb50a .config console log report info ci-upstream-linux-next-kasan-gce-root possible deadlock in snd_mixer_oss_ioctl1
2021/10/26 22:33 linux-next 2376e5fe91bc d50eb50a .config console log report info ci-upstream-linux-next-kasan-gce-root possible deadlock in snd_mixer_oss_ioctl1
2021/10/26 19:25 linux-next 2376e5fe91bc d50eb50a .config console log report info ci-upstream-linux-next-kasan-gce-root possible deadlock in snd_mixer_oss_ioctl1
2021/10/26 18:37 linux-next 2376e5fe91bc d50eb50a .config console log report info ci-upstream-linux-next-kasan-gce-root possible deadlock in snd_mixer_oss_ioctl1
2021/10/26 17:16 linux-next 2376e5fe91bc d50eb50a .config console log report info ci-upstream-linux-next-kasan-gce-root possible deadlock in snd_mixer_oss_ioctl1
2021/10/26 11:19 linux-next 9ae1fbdeabd3 c1132b49 .config console log report info ci-upstream-linux-next-kasan-gce-root possible deadlock in snd_mixer_oss_ioctl1
2021/10/26 09:15 linux-next 9ae1fbdeabd3 c1132b49 .config console log report info ci-upstream-linux-next-kasan-gce-root possible deadlock in snd_mixer_oss_ioctl1
2021/10/26 08:09 linux-next 9ae1fbdeabd3 c1132b49 .config console log report info ci-upstream-linux-next-kasan-gce-root possible deadlock in snd_mixer_oss_ioctl1
2021/10/26 05:33 linux-next 9ae1fbdeabd3 c1132b49 .config console log report info ci-upstream-linux-next-kasan-gce-root possible deadlock in snd_mixer_oss_ioctl1
2021/10/26 02:01 linux-next 9ae1fbdeabd3 c1132b49 .config console log report info ci-upstream-linux-next-kasan-gce-root possible deadlock in snd_mixer_oss_ioctl1
2021/10/25 22:58 linux-next 9ae1fbdeabd3 4f0000ee .config console log report info ci-upstream-linux-next-kasan-gce-root possible deadlock in snd_mixer_oss_ioctl1
2021/10/25 21:36 linux-next 9ae1fbdeabd3 4f0000ee .config console log report info ci-upstream-linux-next-kasan-gce-root possible deadlock in snd_mixer_oss_ioctl1
2021/10/25 21:36 linux-next 9ae1fbdeabd3 4f0000ee .config console log report info ci-upstream-linux-next-kasan-gce-root possible deadlock in snd_mixer_oss_ioctl1
2021/10/25 20:35 linux-next 9ae1fbdeabd3 4f0000ee .config console log report info ci-upstream-linux-next-kasan-gce-root possible deadlock in snd_mixer_oss_ioctl1
2021/10/25 17:05 linux-next 9ae1fbdeabd3 4f0000ee .config console log report info ci-upstream-linux-next-kasan-gce-root possible deadlock in snd_mixer_oss_ioctl1
2021/10/25 15:06 linux-next 9ae1fbdeabd3 4f0000ee .config console log report info ci-upstream-linux-next-kasan-gce-root possible deadlock in snd_mixer_oss_ioctl1
2021/10/25 09:01 linux-next cf6c9d12750c 4f0000ee .config console log report info ci-upstream-linux-next-kasan-gce-root possible deadlock in snd_mixer_oss_ioctl1
2021/10/25 07:20 linux-next cf6c9d12750c 4f0000ee .config console log report info ci-upstream-linux-next-kasan-gce-root possible deadlock in snd_mixer_oss_ioctl1
2021/10/25 02:49 linux-next cf6c9d12750c 282f03fb .config console log report info ci-upstream-linux-next-kasan-gce-root possible deadlock in snd_mixer_oss_ioctl1
2021/10/25 01:34 linux-next cf6c9d12750c 282f03fb .config console log report info ci-upstream-linux-next-kasan-gce-root possible deadlock in snd_mixer_oss_ioctl1
2021/10/25 00:04 linux-next cf6c9d12750c 282f03fb .config console log report info ci-upstream-linux-next-kasan-gce-root possible deadlock in snd_mixer_oss_ioctl1
2021/10/24 19:42 linux-next cf6c9d12750c 282f03fb .config console log report info ci-upstream-linux-next-kasan-gce-root possible deadlock in snd_mixer_oss_ioctl1
2021/10/24 15:04 linux-next cf6c9d12750c 282f03fb .config console log report info ci-upstream-linux-next-kasan-gce-root possible deadlock in snd_mixer_oss_ioctl1
2021/10/24 13:10 linux-next cf6c9d12750c 282f03fb .config console log report info ci-upstream-linux-next-kasan-gce-root possible deadlock in snd_mixer_oss_ioctl1
2021/10/24 08:35 linux-next cf6c9d12750c 282f03fb .config console log report info ci-upstream-linux-next-kasan-gce-root possible deadlock in snd_mixer_oss_ioctl1
2021/10/24 06:41 linux-next cf6c9d12750c 282f03fb .config console log report info ci-upstream-linux-next-kasan-gce-root possible deadlock in snd_mixer_oss_ioctl1
2021/10/24 05:37 linux-next cf6c9d12750c 282f03fb .config console log report info ci-upstream-linux-next-kasan-gce-root possible deadlock in snd_mixer_oss_ioctl1
2021/10/24 04:23 linux-next cf6c9d12750c 282f03fb .config console log report info ci-upstream-linux-next-kasan-gce-root possible deadlock in snd_mixer_oss_ioctl1
2021/10/24 04:22 linux-next cf6c9d12750c 282f03fb .config console log report info ci-upstream-linux-next-kasan-gce-root possible deadlock in snd_mixer_oss_ioctl1
2021/10/24 03:13 linux-next cf6c9d12750c 282f03fb .config console log report info ci-upstream-linux-next-kasan-gce-root possible deadlock in snd_mixer_oss_ioctl1
2021/10/24 01:07 linux-next cf6c9d12750c 282f03fb .config console log report info ci-upstream-linux-next-kasan-gce-root possible deadlock in snd_mixer_oss_ioctl1
2021/10/24 00:03 linux-next cf6c9d12750c 282f03fb .config console log report info ci-upstream-linux-next-kasan-gce-root possible deadlock in snd_mixer_oss_ioctl1
2021/10/23 22:44 linux-next cf6c9d12750c 282f03fb .config console log report info ci-upstream-linux-next-kasan-gce-root possible deadlock in snd_mixer_oss_ioctl1
2021/10/23 21:43 linux-next cf6c9d12750c 282f03fb .config console log report info ci-upstream-linux-next-kasan-gce-root possible deadlock in snd_mixer_oss_ioctl1
2021/10/23 20:23 linux-next cf6c9d12750c 282f03fb .config console log report info ci-upstream-linux-next-kasan-gce-root possible deadlock in snd_mixer_oss_ioctl1
2021/10/23 19:15 linux-next cf6c9d12750c 282f03fb .config console log report info ci-upstream-linux-next-kasan-gce-root possible deadlock in snd_mixer_oss_ioctl1
2021/10/23 18:39 linux-next cf6c9d12750c 282f03fb .config console log report info ci-upstream-linux-next-kasan-gce-root possible deadlock in snd_mixer_oss_ioctl1
2021/10/23 18:07 linux-next cf6c9d12750c 282f03fb .config console log report info ci-upstream-linux-next-kasan-gce-root possible deadlock in snd_mixer_oss_ioctl1
2021/10/22 19:22 linux-next cf6c9d12750c 282f03fb .config console log report info ci-upstream-linux-next-kasan-gce-root possible deadlock in snd_mixer_oss_ioctl1
* Struck through repros no longer work on HEAD.