================================ WARNING: inconsistent lock state 6.8.0-syzkaller-08951-gfe46a7dd189e #0 Not tainted -------------------------------- inconsistent {IN-SOFTIRQ-W} -> {SOFTIRQ-ON-W} usage. syz-executor350/5070 [HC0[0]:SC0[0]:HE1:SE1] takes: ffff8880299a8148 (&timer->lock){+.?.}-{2:2}, at: spin_lock include/linux/spinlock.h:351 [inline] ffff8880299a8148 (&timer->lock){+.?.}-{2:2}, at: class_spinlock_constructor include/linux/spinlock.h:561 [inline] ffff8880299a8148 (&timer->lock){+.?.}-{2:2}, at: snd_timer_close_locked+0x53/0x8d0 sound/core/timer.c:412 {IN-SOFTIRQ-W} state was registered at: lock_acquire+0x1e4/0x530 kernel/locking/lockdep.c:5754 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xd5/0x120 kernel/locking/spinlock.c:162 class_spinlock_irqsave_constructor include/linux/spinlock.h:574 [inline] snd_timer_notify+0x103/0x3d0 sound/core/timer.c:1040 snd_pcm_timer_notify sound/core/pcm_native.c:622 [inline] snd_pcm_post_stop sound/core/pcm_native.c:1520 [inline] snd_pcm_drain_done+0x2b8/0x3e0 sound/core/pcm_native.c:1558 snd_pcm_update_state+0x31b/0x410 sound/core/pcm_lib.c:216 snd_pcm_update_hw_ptr0+0x1066/0x1a70 sound/core/pcm_lib.c:490 snd_pcm_period_elapsed_under_stream_lock+0xeb/0x210 sound/core/pcm_lib.c:1875 snd_pcm_period_elapsed+0x2c/0x50 sound/core/pcm_lib.c:1905 dummy_hrtimer_callback+0x7f/0x180 sound/drivers/dummy.c:385 __run_hrtimer kernel/time/hrtimer.c:1692 [inline] __hrtimer_run_queues+0x597/0xd00 kernel/time/hrtimer.c:1756 hrtimer_run_softirq+0x19a/0x2c0 kernel/time/hrtimer.c:1773 __do_softirq+0x2be/0x943 kernel/softirq.c:554 invoke_softirq kernel/softirq.c:428 [inline] __irq_exit_rcu+0xf2/0x1c0 kernel/softirq.c:633 irq_exit_rcu+0x9/0x30 kernel/softirq.c:645 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1043 [inline] sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1043 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 native_safe_halt arch/x86/include/asm/irqflags.h:48 [inline] arch_safe_halt arch/x86/include/asm/irqflags.h:86 [inline] acpi_safe_halt+0x21/0x30 drivers/acpi/processor_idle.c:112 acpi_idle_enter+0xe4/0x140 drivers/acpi/processor_idle.c:707 cpuidle_enter_state+0x11a/0x490 drivers/cpuidle/cpuidle.c:267 cpuidle_enter+0x5d/0xa0 drivers/cpuidle/cpuidle.c:388 call_cpuidle kernel/sched/idle.c:155 [inline] cpuidle_idle_call kernel/sched/idle.c:236 [inline] do_idle+0x375/0x5d0 kernel/sched/idle.c:332 cpu_startup_entry+0x42/0x60 kernel/sched/idle.c:430 __pfx_ap_starting+0x0/0x10 arch/x86/kernel/smpboot.c:313 common_startup_64+0x13e/0x147 irq event stamp: 5101 hardirqs last enabled at (5101): [] __raw_spin_unlock_irq include/linux/spinlock_api_smp.h:159 [inline] hardirqs last enabled at (5101): [] _raw_spin_unlock_irq+0x23/0x50 kernel/locking/spinlock.c:202 hardirqs last disabled at (5100): [] __raw_spin_lock_irq include/linux/spinlock_api_smp.h:117 [inline] hardirqs last disabled at (5100): [] _raw_spin_lock_irq+0xad/0x120 kernel/locking/spinlock.c:170 softirqs last enabled at (4508): [] invoke_softirq kernel/softirq.c:428 [inline] softirqs last enabled at (4508): [] __irq_exit_rcu+0xf2/0x1c0 kernel/softirq.c:633 softirqs last disabled at (4463): [] invoke_softirq kernel/softirq.c:428 [inline] softirqs last disabled at (4463): [] __irq_exit_rcu+0xf2/0x1c0 kernel/softirq.c:633 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&timer->lock); lock(&timer->lock); *** DEADLOCK *** 3 locks held by syz-executor350/5070: #0: ffffffff8f2e2ae8 (register_mutex#3){+.+.}-{3:3}, at: seq_free_client+0x27/0x180 sound/core/seq/seq_clientmgr.c:298 #1: ffff88801e261578 (&q->timer_mutex){+.+.}-{3:3}, at: queue_delete sound/core/seq/seq_queue.c:124 [inline] #1: ffff88801e261578 (&q->timer_mutex){+.+.}-{3:3}, at: snd_seq_queue_client_leave+0x54/0x2b0 sound/core/seq/seq_queue.c:543 #2: ffffffff8f2d3f68 (register_mutex){+.+.}-{3:3}, at: class_mutex_constructor include/linux/mutex.h:169 [inline] #2: ffffffff8f2d3f68 (register_mutex){+.+.}-{3:3}, at: snd_timer_close+0xa3/0x130 sound/core/timer.c:463 stack backtrace: CPU: 1 PID: 5070 Comm: syz-executor350 Not tainted 6.8.0-syzkaller-08951-gfe46a7dd189e #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114 valid_state+0x13a/0x1c0 kernel/locking/lockdep.c:4013 mark_lock_irq+0xbb/0xc20 kernel/locking/lockdep.c:4216 mark_lock+0x223/0x350 kernel/locking/lockdep.c:4678 __lock_acquire+0x116e/0x1fd0 kernel/locking/lockdep.c:5091 lock_acquire+0x1e4/0x530 kernel/locking/lockdep.c:5754 __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline] _raw_spin_lock+0x2e/0x40 kernel/locking/spinlock.c:154 spin_lock include/linux/spinlock.h:351 [inline] class_spinlock_constructor include/linux/spinlock.h:561 [inline] snd_timer_close_locked+0x53/0x8d0 sound/core/timer.c:412 snd_timer_close+0xae/0x130 sound/core/timer.c:464 snd_seq_timer_close+0xa9/0xe0 sound/core/seq/seq_timer.c:302 queue_delete sound/core/seq/seq_queue.c:126 [inline] snd_seq_queue_client_leave+0x7f/0x2b0 sound/core/seq/seq_queue.c:543 seq_free_client1+0xfe/0x2b0 sound/core/seq/seq_clientmgr.c:285 seq_free_client+0x6c/0x180 sound/core/seq/seq_clientmgr.c:306 snd_seq_release+0x48/0xc0 sound/core/seq/seq_clientmgr.c:387 __fput+0x42b/0x8a0 fs/file_table.c:422 task_work_run+0x251/0x310 kernel/task_work.c:180 exit_task_work include/linux/task_work.h:38 [inline] do_exit+0xa1b/0x27e0 kernel/exit.c:878 do_group_exit+0x207/0x2c0 kernel/exit.c:1027 __do_sys_exit_group kernel/exit.c:1038 [inline] __se_sys_exit_group kernel/exit.c:1036 [inline] __x64_sys_exit_group+0x3f/0x40 kernel/exit.c:1036 do_syscall_64+0xfd/0x240 entry_SYSCALL_64_after_hwframe+0x6d/0x75 RIP: 0033:0x7f4c98b56d39 Code: Unable to access opcode bytes at 0x7f4c98b56d0f. RSP: 002b:00007ffde4496158 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f4c98b56d39 RDX: 000000000000003c RSI: 00000000000000e7 RDI: 0000000000000000 RBP: 00007f4c98bd1290 R08: ffffffffffffffb8 R09: 00007ffde4496378 R10: 00007ffde4496378 R11: 0000000000000246 R12: 00007f4c98bd1290