================================ WARNING: inconsistent lock state 6.8.0-syzkaller-08951-gfe46a7dd189e #0 Not tainted -------------------------------- inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W} usage. kworker/1:1H/57 [HC1[1]:SC0[0]:HE0:SE1] takes: ffff8880298ca948 (&timer->lock){?.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:351 [inline] ffff8880298ca948 (&timer->lock){?.+.}-{2:2}, at: class_spinlock_constructor include/linux/spinlock.h:561 [inline] ffff8880298ca948 (&timer->lock){?.+.}-{2:2}, at: snd_hrtimer_callback+0x4d/0x420 sound/core/hrtimer.c:38 {HARDIRQ-ON-W} state was registered at: lock_acquire kernel/locking/lockdep.c:5754 [inline] lock_acquire+0x1b1/0x540 kernel/locking/lockdep.c:5719 __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+0x65/0xbd0 sound/core/timer.c:412 snd_timer_close+0x8b/0xf0 sound/core/timer.c:464 snd_seq_timer_close+0xa4/0x100 sound/core/seq/seq_timer.c:302 queue_delete+0x49/0xa0 sound/core/seq/seq_queue.c:126 snd_seq_queue_delete+0x45/0x60 sound/core/seq/seq_queue.c:188 snd_seq_kernel_client_ctl+0x107/0x1c0 sound/core/seq/seq_clientmgr.c:2526 delete_seq_queue.isra.0+0xc8/0x150 sound/core/seq/oss/seq_oss_init.c:371 odev_release+0x52/0x80 sound/core/seq/oss/seq_oss.c:144 __fput+0x270/0xb80 fs/file_table.c:422 task_work_run+0x14e/0x250 kernel/task_work.c:180 exit_task_work include/linux/task_work.h:38 [inline] do_exit+0xa7d/0x2be0 kernel/exit.c:878 do_group_exit+0xd3/0x2a0 kernel/exit.c:1027 get_signal+0x2390/0x2760 kernel/signal.c:2907 arch_do_signal_or_restart+0x90/0x7e0 arch/x86/kernel/signal.c:310 exit_to_user_mode_loop kernel/entry/common.c:105 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:201 [inline] syscall_exit_to_user_mode+0x14a/0x2a0 kernel/entry/common.c:212 do_syscall_64+0xe2/0x260 arch/x86/entry/common.c:89 entry_SYSCALL_64_after_hwframe+0x6d/0x75 irq event stamp: 8148 hardirqs last enabled at (8147): [] __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:151 [inline] hardirqs last enabled at (8147): [] _raw_spin_unlock_irqrestore+0x52/0x80 kernel/locking/spinlock.c:194 hardirqs last disabled at (8148): [] sysvec_apic_timer_interrupt+0xe/0xb0 arch/x86/kernel/apic/apic.c:1043 softirqs last enabled at (7000): [] softirq_handle_end kernel/softirq.c:400 [inline] softirqs last enabled at (7000): [] __do_softirq+0x596/0x8de kernel/softirq.c:583 softirqs last disabled at (6995): [] invoke_softirq kernel/softirq.c:428 [inline] softirqs last disabled at (6995): [] __irq_exit_rcu kernel/softirq.c:633 [inline] softirqs last disabled at (6995): [] irq_exit_rcu+0xb9/0x120 kernel/softirq.c:645 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&timer->lock); lock(&timer->lock); *** DEADLOCK *** 4 locks held by kworker/1:1H/57: #0: ffff888015078d48 ((wq_completion)events_highpri){+.+.}-{0:0}, at: process_one_work+0x1296/0x1a60 kernel/workqueue.c:3229 #1: ffffc9000132fd80 ((work_completion)(&vmidi->output_work)){+.+.}-{0:0}, at: process_one_work+0x906/0x1a60 kernel/workqueue.c:3230 #2: ffff888029de50f0 (&grp->list_mutex/1){.+.+}-{3:3}, at: __deliver_to_subscribers+0x32d/0x4d0 sound/core/seq/seq_clientmgr.c:734 #3: ffff8880298cc8b0 (&client->ports_lock){.+.+}-{2:2}, at: class_read_lock_constructor include/linux/spinlock.h:582 [inline] #3: ffff8880298cc8b0 (&client->ports_lock){.+.+}-{2:2}, at: snd_seq_port_use_ptr+0x3c/0x1a0 sound/core/seq/seq_ports.c:51 stack backtrace: CPU: 1 PID: 57 Comm: kworker/1:1H Not tainted 6.8.0-syzkaller-08951-gfe46a7dd189e #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 Workqueue: events_highpri snd_vmidi_output_work Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:114 print_usage_bug kernel/locking/lockdep.c:3971 [inline] valid_state kernel/locking/lockdep.c:4013 [inline] mark_lock_irq kernel/locking/lockdep.c:4216 [inline] mark_lock+0x923/0xc60 kernel/locking/lockdep.c:4678 mark_usage kernel/locking/lockdep.c:4564 [inline] __lock_acquire+0x1359/0x3b30 kernel/locking/lockdep.c:5091 lock_acquire kernel/locking/lockdep.c:5754 [inline] lock_acquire+0x1b1/0x540 kernel/locking/lockdep.c:5719 __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+0x4d/0x420 sound/core/hrtimer.c:38 __run_hrtimer kernel/time/hrtimer.c:1692 [inline] __hrtimer_run_queues+0x20c/0xc20 kernel/time/hrtimer.c:1756 hrtimer_interrupt+0x31b/0x800 kernel/time/hrtimer.c:1818 local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1032 [inline] __sysvec_apic_timer_interrupt+0x10f/0x410 arch/x86/kernel/apic/apic.c:1049 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1043 [inline] sysvec_apic_timer_interrupt+0x90/0xb0 arch/x86/kernel/apic/apic.c:1043 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 RIP: 0010:lock_acquire+0x1f2/0x540 kernel/locking/lockdep.c:5722 Code: c1 05 ea 37 97 7e 83 f8 01 0f 85 c8 02 00 00 9c 58 f6 c4 02 0f 85 b3 02 00 00 48 85 ed 74 01 fb 48 b8 00 00 00 00 00 fc ff df <48> 01 c3 48 c7 03 00 00 00 00 48 c7 43 08 00 00 00 00 48 8b 84 24 RSP: 0018:ffffc9000132f898 EFLAGS: 00000206 RAX: dffffc0000000000 RBX: 1ffff92000265f15 RCX: ffffffff816a5d5e RDX: 0000000000000001 RSI: ffffffff8b0cba40 RDI: ffffffff8b6e88a0 RBP: 0000000000000200 R08: 0000000000000000 R09: fffffbfff27b4e40 R10: ffffffff93da7207 R11: 0000000000000003 R12: 0000000000000001 R13: 0000000000000000 R14: ffff8880298cc8b0 R15: 0000000000000000 __raw_read_lock include/linux/rwlock_api_smp.h:150 [inline] _raw_read_lock+0x5f/0x70 kernel/locking/spinlock.c:228 class_read_lock_constructor include/linux/spinlock.h:582 [inline] snd_seq_port_use_ptr+0x3c/0x1a0 sound/core/seq/seq_ports.c:51 snd_seq_deliver_single_event.constprop.0+0x1b9/0x6e0 sound/core/seq/seq_clientmgr.c:667 __deliver_to_subscribers+0x166/0x4d0 sound/core/seq/seq_clientmgr.c:744 deliver_to_subscribers sound/core/seq/seq_clientmgr.c:773 [inline] snd_seq_deliver_event+0x17b/0x4b0 sound/core/seq/seq_clientmgr.c:816 snd_seq_kernel_client_dispatch+0x14d/0x180 sound/core/seq/seq_clientmgr.c:2496 snd_vmidi_output_work+0x1d2/0x390 sound/core/seq/seq_virmidi.c:157 process_one_work+0x9a9/0x1a60 kernel/workqueue.c:3254 process_scheduled_works kernel/workqueue.c:3335 [inline] worker_thread+0x6c8/0xf70 kernel/workqueue.c:3416 kthread+0x2c1/0x3a0 kernel/kthread.c:388 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:243 ---------------- Code disassembly (best guess): 0: c1 05 ea 37 97 7e 83 roll $0x83,0x7e9737ea(%rip) # 0x7e9737f1 7: f8 clc 8: 01 0f add %ecx,(%rdi) a: 85 c8 test %ecx,%eax c: 02 00 add (%rax),%al e: 00 9c 58 f6 c4 02 0f add %bl,0xf02c4f6(%rax,%rbx,2) 15: 85 b3 02 00 00 48 test %esi,0x48000002(%rbx) 1b: 85 ed test %ebp,%ebp 1d: 74 01 je 0x20 1f: fb sti 20: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax 27: fc ff df * 2a: 48 01 c3 add %rax,%rbx <-- trapping instruction 2d: 48 c7 03 00 00 00 00 movq $0x0,(%rbx) 34: 48 c7 43 08 00 00 00 movq $0x0,0x8(%rbx) 3b: 00 3c: 48 rex.W 3d: 8b .byte 0x8b 3e: 84 .byte 0x84 3f: 24 .byte 0x24