================================ WARNING: inconsistent lock state 6.8.0-syzkaller-08951-gfe46a7dd189e #0 Not tainted -------------------------------- inconsistent {IN-HARDIRQ-W} -> {HARDIRQ-ON-W} usage. syz-executor389/5050 [HC0[0]:SC0[0]:HE1:SE1] takes: ffff888029572948 (&timer->lock){?...}-{2:2}, at: spin_lock include/linux/spinlock.h:351 [inline] ffff888029572948 (&timer->lock){?...}-{2:2}, at: class_spinlock_constructor include/linux/spinlock.h:561 [inline] ffff888029572948 (&timer->lock){?...}-{2:2}, at: snd_timer_close_locked+0x53/0x8d0 sound/core/timer.c:412 {IN-HARDIRQ-W} state was registered at: 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_hrtimer_callback+0x54/0x370 sound/core/hrtimer.c:38 __run_hrtimer kernel/time/hrtimer.c:1692 [inline] __hrtimer_run_queues+0x595/0xd00 kernel/time/hrtimer.c:1756 hrtimer_interrupt+0x396/0x990 kernel/time/hrtimer.c:1818 local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1032 [inline] __sysvec_apic_timer_interrupt+0x107/0x3a0 arch/x86/kernel/apic/apic.c:1049 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1043 [inline] sysvec_apic_timer_interrupt+0xa1/0xc0 arch/x86/kernel/apic/apic.c:1043 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 check_kcov_mode kernel/kcov.c:173 [inline] __sanitizer_cov_trace_pc+0x31/0x70 kernel/kcov.c:207 snd_seq_client_use_ptr+0x16/0xf10 sound/core/seq/seq_clientmgr.c:110 get_event_dest_client sound/core/seq/seq_clientmgr.c:535 [inline] snd_seq_deliver_single_event+0xf7/0xca0 sound/core/seq/seq_clientmgr.c:664 __deliver_to_subscribers+0x3ac/0x670 sound/core/seq/seq_clientmgr.c:744 deliver_to_subscribers sound/core/seq/seq_clientmgr.c:773 [inline] snd_seq_deliver_event+0x18b/0x4a0 sound/core/seq/seq_clientmgr.c:816 snd_seq_kernel_client_dispatch+0x204/0x300 sound/core/seq/seq_clientmgr.c:2496 dummy_input+0x1ce/0x2d0 sound/core/seq/seq_dummy.c:90 __snd_seq_deliver_single_event sound/core/seq/seq_clientmgr.c:638 [inline] snd_seq_deliver_single_event+0x542/0xca0 sound/core/seq/seq_clientmgr.c:695 snd_seq_kernel_client_dispatch+0x204/0x300 sound/core/seq/seq_clientmgr.c:2496 snd_seq_oss_dispatch sound/core/seq/oss/seq_oss_device.h:138 [inline] snd_seq_oss_midi_reset+0x46d/0x890 sound/core/seq/oss/seq_oss_midi.c:483 snd_seq_oss_reset+0x103/0x240 sound/core/seq/oss/seq_oss_init.c:435 snd_seq_oss_release+0xee/0x310 sound/core/seq/oss/seq_oss_init.c:407 odev_release+0x56/0x80 sound/core/seq/oss/seq_oss.c:144 __fput+0x429/0x8a0 fs/file_table.c:422 task_work_run+0x24f/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+0xfb/0x240 entry_SYSCALL_64_after_hwframe+0x6d/0x75 irq event stamp: 17735 hardirqs last enabled at (17735): [] __raw_spin_unlock_irq include/linux/spinlock_api_smp.h:159 [inline] hardirqs last enabled at (17735): [] _raw_spin_unlock_irq+0x23/0x50 kernel/locking/spinlock.c:202 hardirqs last disabled at (17734): [] __raw_spin_lock_irq include/linux/spinlock_api_smp.h:117 [inline] hardirqs last disabled at (17734): [] _raw_spin_lock_irq+0xad/0x120 kernel/locking/spinlock.c:170 softirqs last enabled at (17040): [] invoke_softirq kernel/softirq.c:428 [inline] softirqs last enabled at (17040): [] __irq_exit_rcu+0xf2/0x1c0 kernel/softirq.c:633 softirqs last disabled at (16889): [] invoke_softirq kernel/softirq.c:428 [inline] softirqs last disabled at (16889): [] __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-executor389/5050: #0: ffffffff8f2d3228 (register_mutex#4){+.+.}-{3:3}, at: odev_release+0x4e/0x80 sound/core/seq/oss/seq_oss.c:143 #1: ffff88801df82d78 (&q->timer_mutex){+.+.}-{3:3}, at: queue_delete sound/core/seq/seq_queue.c:124 [inline] #1: ffff88801df82d78 (&q->timer_mutex){+.+.}-{3:3}, at: snd_seq_queue_delete+0x5b/0xf0 sound/core/seq/seq_queue.c:188 #2: ffffffff8f2c1a68 (register_mutex){+.+.}-{3:3}, at: class_mutex_constructor include/linux/mutex.h:169 [inline] #2: ffffffff8f2c1a68 (register_mutex){+.+.}-{3:3}, at: snd_timer_close+0xa3/0x130 sound/core/timer.c:463 stack backtrace: CPU: 0 PID: 5050 Comm: syz-executor389 Not tainted 6.8.0-syzkaller-08951-gfe46a7dd189e #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/29/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 mark_usage kernel/locking/lockdep.c:4587 [inline] __lock_acquire+0x112d/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_delete+0x8f/0xf0 sound/core/seq/seq_queue.c:188 delete_seq_queue sound/core/seq/oss/seq_oss_init.c:371 [inline] snd_seq_oss_release+0x1d3/0x310 sound/core/seq/oss/seq_oss_init.c:416 odev_release+0x56/0x80 sound/core/seq/oss/seq_oss.c:144 __fput+0x429/0x8a0 fs/file_table.c:422 task_work_run+0x24f/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+0xfb/0x240 entry_SYSCALL_64_after_hwframe+0x6d/0x75 RIP: 0033:0x7f6b46e899a9 Code: Unable to access opcode bytes at 0x7f6b46e8997f. RSP: 002b:00007ffdb9e76dd8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f6b46e899a9 RDX: 000000000000003c RSI: 00000000000000e7 RDI: 0000000000000000 RBP: 00007f6b46f02350 R08: ffffffffffffffb8 R09: 0000000000000000