============================================ WARNING: possible recursive locking detected syzkaller #0 Tainted: G L -------------------------------------------- syz.1.767/8830 is trying to acquire lock: ffff8880588a2160 (&rmidi->open_mutex){+.+.}-{4:4}, at: class_mutex_constructor include/linux/mutex.h:253 [inline] ffff8880588a2160 (&rmidi->open_mutex){+.+.}-{4:4}, at: rawmidi_release_priv+0x45/0x280 sound/core/rawmidi.c:574 but task is already holding lock: ffff888035a6c960 (&rmidi->open_mutex){+.+.}-{4:4}, at: class_mutex_constructor include/linux/mutex.h:253 [inline] ffff888035a6c960 (&rmidi->open_mutex){+.+.}-{4:4}, at: rawmidi_release_priv+0x45/0x280 sound/core/rawmidi.c:574 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&rmidi->open_mutex); lock(&rmidi->open_mutex); *** DEADLOCK *** May be due to missing lock nesting notation locks held by syz.1.767/8830: 2, last CPU#3: #0: ffff888035a6c960 (&rmidi->open_mutex){+.+.}-{4:4}, at: class_mutex_constructor include/linux/mutex.h:253 [inline] #0: ffff888035a6c960 (&rmidi->open_mutex){+.+.}-{4:4}, at: rawmidi_release_priv+0x45/0x280 sound/core/rawmidi.c:574 #1: ffff8880588a2460 (&ump->open_mutex){+.+.}-{4:4}, at: class_mutex_constructor include/linux/mutex.h:253 [inline] #1: ffff8880588a2460 (&ump->open_mutex){+.+.}-{4:4}, at: snd_ump_legacy_close+0x117/0x300 sound/core/ump.c:1182 stack backtrace: CPU: 3 UID: 0 PID: 8830 Comm: syz.1.767 Tainted: G L syzkaller #0 PREEMPT(full) Tainted: [L]=SOFTLOCKUP Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120 print_deadlock_bug.cold+0xbd/0xca kernel/locking/lockdep.c:3057 check_deadlock kernel/locking/lockdep.c:3109 [inline] validate_chain kernel/locking/lockdep.c:3911 [inline] __lock_acquire+0x1343/0x1ec0 kernel/locking/lockdep.c:5253 lock_acquire kernel/locking/lockdep.c:5886 [inline] lock_acquire+0x1b9/0x370 kernel/locking/lockdep.c:5843 __mutex_lock_common kernel/locking/mutex.c:646 [inline] __mutex_lock+0x1a4/0x1bc0 kernel/locking/mutex.c:821 class_mutex_constructor include/linux/mutex.h:253 [inline] rawmidi_release_priv+0x45/0x280 sound/core/rawmidi.c:574 snd_rawmidi_kernel_release+0x3a/0xd0 sound/core/rawmidi.c:596 snd_ump_legacy_close+0x234/0x300 sound/core/ump.c:1187 close_substream.part.0+0x16b/0x860 sound/core/rawmidi.c:560 close_substream include/linux/mutex.h:253 [inline] rawmidi_release_priv+0x210/0x280 sound/core/rawmidi.c:580 snd_rawmidi_release+0x5a/0xf0 sound/core/rawmidi.c:610 __fput+0x3ff/0xb50 fs/file_table.c:512 task_work_run+0x150/0x240 kernel/task_work.c:233 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] __exit_to_user_mode_loop kernel/entry/common.c:70 [inline] exit_to_user_mode_loop+0x1d8/0x700 kernel/entry/common.c:101 __exit_to_user_mode_prepare include/linux/irq-entry-common.h:207 [inline] syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:230 [inline] syscall_exit_to_user_mode include/linux/entry-common.h:336 [inline] do_syscall_64+0x661/0x790 arch/x86/entry/syscall_64.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f9e4319e0d9 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:00007ffce0aa8578 EFLAGS: 00000246 ORIG_RAX: 00000000000001b4 RAX: 0000000000000000 RBX: 00007ffce0aa8660 RCX: 00007f9e4319e0d9 RDX: 0000000000000000 RSI: 000000000000001e RDI: 0000000000000003 RBP: 000000000001a66a R08: 0000000000000001 R09: 0000000000000000 R10: 0000001b31820000 R11: 0000000000000246 R12: 00007ffce0aa86a0 R13: 00007f9e43425fac R14: 000000000001a6c3 R15: 00007f9e43425fa0 syz_tun (unregistering): left allmulticast mode