======================================================== WARNING: possible irq lock inversion dependency detected 6.8.0-syzkaller-08951-gfe46a7dd189e #0 Not tainted -------------------------------------------------------- syz-executor.4/5531 just changed the state of lock: ffff888029791910 (&group->lock#2){..-.}-{2:2}, at: _snd_pcm_stream_lock_irqsave+0xa0/0xd0 sound/core/pcm_native.c:170 but this lock took another, SOFTIRQ-unsafe lock in the past: (&timer->lock){+.+.}-{2:2} and interrupts could create inverse lock ordering between them. other info that might help us debug this: Possible interrupt unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&timer->lock); local_irq_disable(); lock(&group->lock#2); lock(&timer->lock); lock(&group->lock#2); *** DEADLOCK *** 1 lock held by syz-executor.4/5531: #0: ffffffff8d7b08e0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:298 [inline] #0: ffffffff8d7b08e0 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:750 [inline] #0: ffffffff8d7b08e0 (rcu_read_lock){....}-{1:2}, at: lock_vma_under_rcu+0xe3/0x950 mm/memory.c:5620 the shortest dependencies between 2nd lock and 1st lock: -> (&timer->lock){+.+.}-{2:2} { HARDIRQ-ON-W 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_client_leave+0x37/0x1a0 sound/core/seq/seq_queue.c:543 seq_free_client1.part.0+0x10a/0x260 sound/core/seq/seq_clientmgr.c:285 seq_free_client1 sound/core/seq/seq_clientmgr.c:278 [inline] seq_free_client+0x74/0x170 sound/core/seq/seq_clientmgr.c:306 snd_seq_release+0x50/0xe0 sound/core/seq/seq_clientmgr.c:387 __fput+0x270/0xb80 fs/file_table.c:422 __fput_sync+0x47/0x50 fs/file_table.c:507 __do_sys_close fs/open.c:1556 [inline] __se_sys_close fs/open.c:1541 [inline] __x64_sys_close+0x86/0x100 fs/open.c:1541 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xd2/0x260 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x6d/0x75 SOFTIRQ-ON-W 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_client_leave+0x37/0x1a0 sound/core/seq/seq_queue.c:543 seq_free_client1.part.0+0x10a/0x260 sound/core/seq/seq_clientmgr.c:285 seq_free_client1 sound/core/seq/seq_clientmgr.c:278 [inline] seq_free_client+0x74/0x170 sound/core/seq/seq_clientmgr.c:306 snd_seq_release+0x50/0xe0 sound/core/seq/seq_clientmgr.c:387 __fput+0x270/0xb80 fs/file_table.c:422 __fput_sync+0x47/0x50 fs/file_table.c:507 __do_sys_close fs/open.c:1556 [inline] __se_sys_close fs/open.c:1541 [inline] __x64_sys_close+0x86/0x100 fs/open.c:1541 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xd2/0x260 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x6d/0x75 INITIAL USE 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_client_leave+0x37/0x1a0 sound/core/seq/seq_queue.c:543 seq_free_client1.part.0+0x10a/0x260 sound/core/seq/seq_clientmgr.c:285 seq_free_client1 sound/core/seq/seq_clientmgr.c:278 [inline] seq_free_client+0x74/0x170 sound/core/seq/seq_clientmgr.c:306 snd_seq_release+0x50/0xe0 sound/core/seq/seq_clientmgr.c:387 __fput+0x270/0xb80 fs/file_table.c:422 __fput_sync+0x47/0x50 fs/file_table.c:507 __do_sys_close fs/open.c:1556 [inline] __se_sys_close fs/open.c:1541 [inline] __x64_sys_close+0x86/0x100 fs/open.c:1541 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xd2/0x260 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x6d/0x75 } ... key at: [] __key.6+0x0/0x40 ... acquired at: __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x3a/0x60 kernel/locking/spinlock.c:162 class_spinlock_irqsave_constructor include/linux/spinlock.h:574 [inline] snd_timer_notify+0x111/0x3e0 sound/core/timer.c:1040 snd_pcm_timer_notify sound/core/pcm_native.c:622 [inline] snd_pcm_post_start+0x272/0x350 sound/core/pcm_native.c:1459 snd_pcm_action_single+0x10a/0x150 sound/core/pcm_native.c:1289 snd_pcm_action+0x70/0x90 sound/core/pcm_native.c:1370 __snd_pcm_lib_xfer+0x13f5/0x1ea0 sound/core/pcm_lib.c:2371 snd_pcm_oss_write3+0xd5/0x1e0 sound/core/oss/pcm_oss.c:1242 io_playback_transfer+0x273/0x300 sound/core/oss/io.c:47 snd_pcm_plug_write_transfer+0x2cd/0x410 sound/core/oss/pcm_plugin.c:630 snd_pcm_oss_write2+0x24f/0x3f0 sound/core/oss/pcm_oss.c:1374 snd_pcm_oss_write1 sound/core/oss/pcm_oss.c:1440 [inline] snd_pcm_oss_write+0x733/0xa10 sound/core/oss/pcm_oss.c:2796 vfs_write+0x298/0x1100 fs/read_write.c:588 ksys_write+0x12f/0x260 fs/read_write.c:643 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xd2/0x260 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x6d/0x75 -> (&group->lock#2){..-.}-{2:2} { IN-SOFTIRQ-W at: lock_acquire kernel/locking/lockdep.c:5754 [inline] lock_acquire+0x1b1/0x540 kernel/locking/lockdep.c:5719 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x3a/0x60 kernel/locking/spinlock.c:162 _snd_pcm_stream_lock_irqsave+0xa0/0xd0 sound/core/pcm_native.c:170 class_pcm_stream_lock_irqsave_constructor include/sound/pcm.h:669 [inline] snd_pcm_period_elapsed+0x20/0x50 sound/core/pcm_lib.c:1904 dummy_hrtimer_callback+0x9d/0x1c0 sound/drivers/dummy.c:385 __run_hrtimer kernel/time/hrtimer.c:1692 [inline] __hrtimer_run_queues+0x20c/0xc20 kernel/time/hrtimer.c:1756 hrtimer_run_softirq+0x17d/0x350 kernel/time/hrtimer.c:1773 __do_softirq+0x218/0x8de kernel/softirq.c:554 invoke_softirq kernel/softirq.c:428 [inline] __irq_exit_rcu kernel/softirq.c:633 [inline] irq_exit_rcu+0xb9/0x120 kernel/softirq.c:645 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1043 [inline] sysvec_apic_timer_interrupt+0x95/0xb0 arch/x86/kernel/apic/apic.c:1043 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 lock_is_held include/linux/lockdep.h:231 [inline] rcu_read_lock_held kernel/rcu/update.c:351 [inline] rcu_read_lock_held+0x30/0x50 kernel/rcu/update.c:345 mt_slot lib/maple_tree.c:788 [inline] mtree_range_walk+0x25b/0xbe0 lib/maple_tree.c:2794 mas_state_walk lib/maple_tree.c:3680 [inline] mas_walk+0x4a8/0x8d0 lib/maple_tree.c:4911 lock_vma_under_rcu+0x125/0x950 mm/memory.c:5622 do_user_addr_fault+0x3d7/0x1080 arch/x86/mm/fault.c:1354 handle_page_fault arch/x86/mm/fault.c:1505 [inline] exc_page_fault+0x5c/0xc0 arch/x86/mm/fault.c:1563 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 INITIAL USE at: lock_acquire kernel/locking/lockdep.c:5754 [inline] lock_acquire+0x1b1/0x540 kernel/locking/lockdep.c:5719 __raw_spin_lock_irq include/linux/spinlock_api_smp.h:119 [inline] _raw_spin_lock_irq+0x36/0x50 kernel/locking/spinlock.c:170 spin_lock_irq include/linux/spinlock.h:376 [inline] snd_pcm_group_lock_irq sound/core/pcm_native.c:97 [inline] snd_pcm_stream_lock_irq sound/core/pcm_native.c:136 [inline] class_pcm_stream_lock_irq_constructor include/sound/pcm.h:666 [inline] snd_pcm_hw_params+0x151/0x1a30 sound/core/pcm_native.c:740 snd_pcm_kernel_ioctl+0x147/0x2d0 sound/core/pcm_native.c:3434 snd_pcm_oss_change_params_locked+0x146c/0x3aa0 sound/core/oss/pcm_oss.c:965 snd_pcm_oss_make_ready_locked+0xb7/0x130 sound/core/oss/pcm_oss.c:1187 snd_pcm_oss_write1 sound/core/oss/pcm_oss.c:1405 [inline] snd_pcm_oss_write+0x4af/0xa10 sound/core/oss/pcm_oss.c:2796 vfs_write+0x298/0x1100 fs/read_write.c:588 ksys_write+0x12f/0x260 fs/read_write.c:643 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xd2/0x260 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x6d/0x75 } ... key at: [] __key.5+0x0/0x40 ... acquired at: mark_usage kernel/locking/lockdep.c:4567 [inline] __lock_acquire+0x13d4/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_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x3a/0x60 kernel/locking/spinlock.c:162 _snd_pcm_stream_lock_irqsave+0xa0/0xd0 sound/core/pcm_native.c:170 class_pcm_stream_lock_irqsave_constructor include/sound/pcm.h:669 [inline] snd_pcm_period_elapsed+0x20/0x50 sound/core/pcm_lib.c:1904 dummy_hrtimer_callback+0x9d/0x1c0 sound/drivers/dummy.c:385 __run_hrtimer kernel/time/hrtimer.c:1692 [inline] __hrtimer_run_queues+0x20c/0xc20 kernel/time/hrtimer.c:1756 hrtimer_run_softirq+0x17d/0x350 kernel/time/hrtimer.c:1773 __do_softirq+0x218/0x8de kernel/softirq.c:554 invoke_softirq kernel/softirq.c:428 [inline] __irq_exit_rcu kernel/softirq.c:633 [inline] irq_exit_rcu+0xb9/0x120 kernel/softirq.c:645 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1043 [inline] sysvec_apic_timer_interrupt+0x95/0xb0 arch/x86/kernel/apic/apic.c:1043 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 lock_is_held include/linux/lockdep.h:231 [inline] rcu_read_lock_held kernel/rcu/update.c:351 [inline] rcu_read_lock_held+0x30/0x50 kernel/rcu/update.c:345 mt_slot lib/maple_tree.c:788 [inline] mtree_range_walk+0x25b/0xbe0 lib/maple_tree.c:2794 mas_state_walk lib/maple_tree.c:3680 [inline] mas_walk+0x4a8/0x8d0 lib/maple_tree.c:4911 lock_vma_under_rcu+0x125/0x950 mm/memory.c:5622 do_user_addr_fault+0x3d7/0x1080 arch/x86/mm/fault.c:1354 handle_page_fault arch/x86/mm/fault.c:1505 [inline] exc_page_fault+0x5c/0xc0 arch/x86/mm/fault.c:1563 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 stack backtrace: CPU: 0 PID: 5531 Comm: syz-executor.4 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+0x116/0x1f0 lib/dump_stack.c:114 print_irq_inversion_bug.part.0+0x3e9/0x5a0 kernel/locking/lockdep.c:4080 print_irq_inversion_bug kernel/locking/lockdep.c:4033 [inline] check_usage_forwards kernel/locking/lockdep.c:4111 [inline] mark_lock_irq kernel/locking/lockdep.c:4243 [inline] mark_lock+0x574/0xc60 kernel/locking/lockdep.c:4678 mark_usage kernel/locking/lockdep.c:4567 [inline] __lock_acquire+0x13d4/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_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x3a/0x60 kernel/locking/spinlock.c:162 _snd_pcm_stream_lock_irqsave+0xa0/0xd0 sound/core/pcm_native.c:170 class_pcm_stream_lock_irqsave_constructor include/sound/pcm.h:669 [inline] snd_pcm_period_elapsed+0x20/0x50 sound/core/pcm_lib.c:1904 dummy_hrtimer_callback+0x9d/0x1c0 sound/drivers/dummy.c:385 __run_hrtimer kernel/time/hrtimer.c:1692 [inline] __hrtimer_run_queues+0x20c/0xc20 kernel/time/hrtimer.c:1756 hrtimer_run_softirq+0x17d/0x350 kernel/time/hrtimer.c:1773 __do_softirq+0x218/0x8de kernel/softirq.c:554 invoke_softirq kernel/softirq.c:428 [inline] __irq_exit_rcu kernel/softirq.c:633 [inline] irq_exit_rcu+0xb9/0x120 kernel/softirq.c:645 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1043 [inline] sysvec_apic_timer_interrupt+0x95/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_is_held include/linux/lockdep.h:231 [inline] RIP: 0010:rcu_read_lock_held kernel/rcu/update.c:351 [inline] RIP: 0010:rcu_read_lock_held+0x30/0x50 kernel/rcu/update.c:345 Code: a2 5f 09 ba 01 00 00 00 85 c0 75 07 89 d0 c3 cc cc cc cc e8 92 eb 00 00 84 c0 74 1a e8 59 ec 00 00 84 c0 74 11 be ff ff ff ff <48> c7 c7 e0 08 7b 8d e9 b4 a0 5f 09 31 d2 89 d0 c3 cc cc cc cc 66 RSP: 0000:ffffc900045dfcc0 EFLAGS: 00000202 RAX: 0000000000000001 RBX: ffff888021e7ac0c RCX: ffffc9000aa22000 RDX: 0000000000000003 RSI: 00000000ffffffff RDI: ffffffff8d7bbdb0 RBP: 0000000000000000 R08: 0000000000000005 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000003 R13: 0000000000000000 R14: 0000000000000300 R15: 00007f06dea00fff mt_slot lib/maple_tree.c:788 [inline] mtree_range_walk+0x25b/0xbe0 lib/maple_tree.c:2794 mas_state_walk lib/maple_tree.c:3680 [inline] mas_walk+0x4a8/0x8d0 lib/maple_tree.c:4911 lock_vma_under_rcu+0x125/0x950 mm/memory.c:5622 do_user_addr_fault+0x3d7/0x1080 arch/x86/mm/fault.c:1354 handle_page_fault arch/x86/mm/fault.c:1505 [inline] exc_page_fault+0x5c/0xc0 arch/x86/mm/fault.c:1563 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 RIP: 0033:0x7f06dfe298e6 Code: f0 72 6e 48 63 cd 48 01 c1 49 39 4f 08 72 4c 8d 4d ff 85 ed 74 33 66 0f 1f 44 00 00 48 39 f0 72 1b 4d 8b 07 49 89 c1 49 29 f1 <47> 0f b6 0c 08 45 84 c9 74 08 45 88 0c 00 49 8b 47 10 48 83 c0 01 RSP: 002b:00007f06e0be5530 EFLAGS: 00010206 RAX: 0000000000094001 RBX: 00007f06e0be55d0 RCX: 00000000000000e4 RDX: 0000000000000000 RSI: 0000000000000001 RDI: 00007f06e0be5670 RBP: 0000000000000102 R08: 00007f06d5c00000 R09: 0000000000094000 R10: 0000000000000000 R11: 00007f06e0be55e0 R12: 0000000000000001 R13: 00007f06dfeece40 R14: 0000000000000000 R15: 00007f06e0be5670 vkms_vblank_simulate: vblank timer overrun ---------------- Code disassembly (best guess): 0: a2 5f 09 ba 01 00 00 movabs %al,0x8500000001ba095f 7: 00 85 9: c0 75 07 89 shlb $0x89,0x7(%rbp) d: d0 c3 rol %bl f: cc int3 10: cc int3 11: cc int3 12: cc int3 13: e8 92 eb 00 00 call 0xebaa 18: 84 c0 test %al,%al 1a: 74 1a je 0x36 1c: e8 59 ec 00 00 call 0xec7a 21: 84 c0 test %al,%al 23: 74 11 je 0x36 25: be ff ff ff ff mov $0xffffffff,%esi * 2a: 48 c7 c7 e0 08 7b 8d mov $0xffffffff8d7b08e0,%rdi <-- trapping instruction 31: e9 b4 a0 5f 09 jmp 0x95fa0ea 36: 31 d2 xor %edx,%edx 38: 89 d0 mov %edx,%eax 3a: c3 ret 3b: cc int3 3c: cc int3 3d: cc int3 3e: cc int3 3f: 66 data16