================================ WARNING: inconsistent lock state 6.8.0-syzkaller-08951-gfe46a7dd189e #0 Not tainted -------------------------------- inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W} usage. syz-executor398/5097 [HC1[1]:SC0[0]:HE0:SE1] takes: ffff888029686948 (&timer->lock){?.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:351 [inline] ffff888029686948 (&timer->lock){?.+.}-{2:2}, at: class_spinlock_constructor include/linux/spinlock.h:561 [inline] ffff888029686948 (&timer->lock){?.+.}-{2:2}, at: snd_hrtimer_callback+0x54/0x370 sound/core/hrtimer.c:38 {HARDIRQ-ON-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_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 irq event stamp: 1614 hardirqs last enabled at (1613): [] __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:151 [inline] hardirqs last enabled at (1613): [] _raw_spin_unlock_irqrestore+0x8f/0x140 kernel/locking/spinlock.c:194 hardirqs last disabled at (1614): [] sysvec_apic_timer_interrupt+0xe/0xc0 arch/x86/kernel/apic/apic.c:1043 softirqs last enabled at (1526): [] invoke_softirq kernel/softirq.c:428 [inline] softirqs last enabled at (1526): [] __irq_exit_rcu+0xf2/0x1c0 kernel/softirq.c:633 softirqs last disabled at (1077): [] invoke_softirq kernel/softirq.c:428 [inline] softirqs last disabled at (1077): [] __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 *** 2 locks held by syz-executor398/5097: #0: ffffffff8f2d3228 (register_mutex#4){+.+.}-{3:3}, at: odev_release+0x4e/0x80 sound/core/seq/oss/seq_oss.c:143 #1: ffff8880299ea0f0 (&grp->list_mutex#2/2){.+.+}-{3:3}, at: __deliver_to_subscribers+0xfc/0x670 sound/core/seq/seq_clientmgr.c:734 stack backtrace: CPU: 1 PID: 5097 Comm: syz-executor398 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:4564 [inline] __lock_acquire+0xb8e/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_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 RIP: 0010:__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:152 [inline] RIP: 0010:_raw_spin_unlock_irqrestore+0xd8/0x140 kernel/locking/spinlock.c:194 Code: 9c 8f 44 24 20 42 80 3c 23 00 74 08 4c 89 f7 e8 fe 9e 7e f6 f6 44 24 21 02 75 52 41 f7 c7 00 02 00 00 74 01 fb bf 01 00 00 00 c3 94 ee f5 65 8b 05 d4 79 8d 74 85 c0 74 43 48 c7 04 24 0e 36 RSP: 0018:ffffc90004547160 EFLAGS: 00000206 RAX: d56b20d93c6d1500 RBX: 1ffff920008a8e30 RCX: ffffffff81720b2a RDX: dffffc0000000000 RSI: ffffffff8baac1e0 RDI: 0000000000000001 RBP: ffffc900045471e8 R08: ffffffff92cae5cf R09: 1ffffffff2595cb9 R10: dffffc0000000000 R11: fffffbfff2595cba R12: dffffc0000000000 R13: 1ffff920008a8e2c R14: ffffc90004547180 R15: 0000000000000246 find_slot+0x1b6/0x1d0 snd_seq_oss_midi_input+0xf6/0xd40 sound/core/seq/oss/seq_oss_midi.c:528 __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 __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 RIP: 0033:0x7f12ebd2bb89 Code: Unable to access opcode bytes at 0x7f12ebd2bb5f. RSP: 002b:00007fff4553e0a8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f12ebd2bb89 RDX: 000000000000003c RSI: 00000000000000e7 RDI: 0000000000000000 RBP: 00007f12ebda6290 R08: ffffffffffffffb8 R09: 0000000000000006 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f12ebda6290 R13: 0000000000000000 R14: 00007f12ebda6ce0 R15: 00007f12ebcfcdd0 ---------------- Code disassembly (best guess): 0: 9c pushf 1: 8f 44 24 20 pop 0x20(%rsp) 5: 42 80 3c 23 00 cmpb $0x0,(%rbx,%r12,1) a: 74 08 je 0x14 c: 4c 89 f7 mov %r14,%rdi f: e8 fe 9e 7e f6 call 0xf67e9f12 14: f6 44 24 21 02 testb $0x2,0x21(%rsp) 19: 75 52 jne 0x6d 1b: 41 f7 c7 00 02 00 00 test $0x200,%r15d 22: 74 01 je 0x25 24: fb sti 25: bf 01 00 00 00 mov $0x1,%edi * 2a: e8 c3 94 ee f5 call 0xf5ee94f2 <-- trapping instruction 2f: 65 8b 05 d4 79 8d 74 mov %gs:0x748d79d4(%rip),%eax # 0x748d7a0a 36: 85 c0 test %eax,%eax 38: 74 43 je 0x7d 3a: 48 rex.W 3b: c7 .byte 0xc7 3c: 04 24 add $0x24,%al 3e: 0e (bad) 3f: 36 ss