======================================================== WARNING: possible irq lock inversion dependency detected 6.8.0-syzkaller-08951-gfe46a7dd189e #0 Not tainted -------------------------------------------------------- modprobe/7804 just changed the state of lock: ffff88802ac30110 (&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 modprobe/7804: #0: ffff888024abb120 (&mm->mmap_lock){++++}-{3:3}, at: mmap_write_lock_killable include/linux/mmap_lock.h:124 [inline] #0: ffff888024abb120 (&mm->mmap_lock){++++}-{3:3}, at: vm_mmap_pgoff+0x160/0x3c0 mm/util.c:571 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_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 __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_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 __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_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] class_spinlock_irq_constructor include/linux/spinlock.h:567 [inline] snd_pcm_detach_substream+0x172/0x380 sound/core/pcm.c:992 snd_pcm_release_substream sound/core/pcm_native.c:2902 [inline] snd_pcm_release+0x1e0/0x260 sound/core/pcm_native.c:2895 __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_stop+0x197/0x1f0 sound/core/pcm_native.c:1520 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_stop sound/core/pcm_native.c:1543 [inline] snd_pcm_drop+0x165/0x2b0 sound/core/pcm_native.c:2208 snd_pcm_kernel_ioctl+0x22d/0x2d0 sound/core/pcm_native.c:3444 snd_pcm_oss_sync+0x227/0x7f0 sound/core/oss/pcm_oss.c:1734 snd_pcm_oss_release+0x291/0x320 sound/core/oss/pcm_oss.c:2575 __fput+0x270/0xb80 fs/file_table.c:422 task_work_run+0x14e/0x250 kernel/task_work.c:180 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] exit_to_user_mode_loop kernel/entry/common.c:108 [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+0x275/0x2a0 kernel/entry/common.c:212 do_syscall_64+0xe2/0x260 arch/x86/entry/common.c:89 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 ma_dead_node lib/maple_tree.c:560 [inline] mas_data_end lib/maple_tree.c:1450 [inline] mas_rev_awalk lib/maple_tree.c:4819 [inline] mas_empty_area_rev+0x7af/0x2400 lib/maple_tree.c:5131 unmapped_area_topdown mm/mmap.c:1645 [inline] vm_unmapped_area+0x318/0xb20 mm/mmap.c:1684 arch_get_unmapped_area_topdown+0x3a9/0x730 arch/x86/kernel/sys_x86_64.c:212 thp_get_unmapped_area mm/huge_memory.c:862 [inline] thp_get_unmapped_area+0x335/0x3e0 mm/huge_memory.c:852 get_unmapped_area+0x1df/0x3f0 mm/mmap.c:1847 do_mmap+0x27a/0xf10 mm/mmap.c:1263 vm_mmap_pgoff+0x1ab/0x3c0 mm/util.c:573 ksys_mmap_pgoff+0x425/0x5b0 mm/mmap.c:1433 __do_sys_mmap arch/x86/kernel/sys_x86_64.c:86 [inline] __se_sys_mmap arch/x86/kernel/sys_x86_64.c:79 [inline] __x64_sys_mmap+0x125/0x190 arch/x86/kernel/sys_x86_64.c:79 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_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_status64+0x9ae/0x15f0 sound/core/pcm_native.c:1008 snd_pcm_status_user64+0xf7/0x190 sound/core/pcm_native.c:1093 snd_pcm_common_ioctl+0x17f4/0x3140 sound/core/pcm_native.c:3324 snd_pcm_ioctl+0x84/0xc0 sound/core/pcm_native.c:3399 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:904 [inline] __se_sys_ioctl fs/ioctl.c:890 [inline] __x64_sys_ioctl+0x193/0x220 fs/ioctl.c:890 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 ma_dead_node lib/maple_tree.c:560 [inline] mas_data_end lib/maple_tree.c:1450 [inline] mas_rev_awalk lib/maple_tree.c:4819 [inline] mas_empty_area_rev+0x7af/0x2400 lib/maple_tree.c:5131 unmapped_area_topdown mm/mmap.c:1645 [inline] vm_unmapped_area+0x318/0xb20 mm/mmap.c:1684 arch_get_unmapped_area_topdown+0x3a9/0x730 arch/x86/kernel/sys_x86_64.c:212 thp_get_unmapped_area mm/huge_memory.c:862 [inline] thp_get_unmapped_area+0x335/0x3e0 mm/huge_memory.c:852 get_unmapped_area+0x1df/0x3f0 mm/mmap.c:1847 do_mmap+0x27a/0xf10 mm/mmap.c:1263 vm_mmap_pgoff+0x1ab/0x3c0 mm/util.c:573 ksys_mmap_pgoff+0x425/0x5b0 mm/mmap.c:1433 __do_sys_mmap arch/x86/kernel/sys_x86_64.c:86 [inline] __se_sys_mmap arch/x86/kernel/sys_x86_64.c:79 [inline] __x64_sys_mmap+0x125/0x190 arch/x86/kernel/sys_x86_64.c:79 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 stack backtrace: CPU: 1 PID: 7804 Comm: modprobe 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:ma_dead_node lib/maple_tree.c:560 [inline] RIP: 0010:mas_data_end lib/maple_tree.c:1450 [inline] RIP: 0010:mas_rev_awalk lib/maple_tree.c:4819 [inline] RIP: 0010:mas_empty_area_rev+0x7af/0x2400 lib/maple_tree.c:5131 Code: 89 f7 e8 44 84 cb f6 83 fd 02 77 0d 85 ed 74 09 e8 f6 88 cb f6 4c 8d 7b 08 e8 ed 88 cb f6 48 89 d8 48 c1 e8 03 42 80 3c 20 00 <0f> 85 29 1c 00 00 48 8b 03 30 c0 48 39 c3 0f 84 a8 12 00 00 e8 c8 RSP: 0018:ffffc90004017998 EFLAGS: 00000246 RAX: 1ffff1100fb7a540 RBX: ffff88807dbd2a00 RCX: ffffffff8ac16fac RDX: ffff88801bb98000 RSI: ffffffff8ac16fc3 RDI: 0000000000000005 RBP: 0000000000000001 R08: 0000000000000005 R09: 0000000000000003 R10: 0000000000000001 R11: 0000000000000000 R12: dffffc0000000000 R13: ffffc90004017b00 R14: 0000000000000001 R15: ffff88807dbd2a08 unmapped_area_topdown mm/mmap.c:1645 [inline] vm_unmapped_area+0x318/0xb20 mm/mmap.c:1684 arch_get_unmapped_area_topdown+0x3a9/0x730 arch/x86/kernel/sys_x86_64.c:212 thp_get_unmapped_area mm/huge_memory.c:862 [inline] thp_get_unmapped_area+0x335/0x3e0 mm/huge_memory.c:852 get_unmapped_area+0x1df/0x3f0 mm/mmap.c:1847 do_mmap+0x27a/0xf10 mm/mmap.c:1263 vm_mmap_pgoff+0x1ab/0x3c0 mm/util.c:573 ksys_mmap_pgoff+0x425/0x5b0 mm/mmap.c:1433 __do_sys_mmap arch/x86/kernel/sys_x86_64.c:86 [inline] __se_sys_mmap arch/x86/kernel/sys_x86_64.c:79 [inline] __x64_sys_mmap+0x125/0x190 arch/x86/kernel/sys_x86_64.c:79 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 RIP: 0033:0x7f006ef3cb74 Code: 63 08 44 89 e8 5b 41 5c 41 5d c3 41 89 ca 41 f7 c1 ff 0f 00 00 74 0c c7 05 f5 46 01 00 16 00 00 00 eb 17 b8 09 00 00 00 0f 05 <48> 3d 00 f0 ff ff 76 0c f7 d8 89 05 dc 46 01 00 48 83 c8 ff c3 0f RSP: 002b:00007ffcf9f3ad88 EFLAGS: 00000246 ORIG_RAX: 0000000000000009 RAX: ffffffffffffffda RBX: 00000fff9f3e75b2 RCX: 00007f006ef3cb74 RDX: 0000000000000001 RSI: 000000000000f888 RDI: 0000000000000000 RBP: 00007ffcf9f3b160 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000802 R11: 0000000000000246 R12: 00007f006ef19ac0 R13: 00007ffcf9f3b1e8 R14: fffffffffffff000 R15: 0000000000000000 vkms_vblank_simulate: vblank timer overrun vkms_vblank_simulate: vblank timer overrun yealink 2-1:36.0: urb_ctl_callback - urb status -2 ---------------- Code disassembly (best guess): 0: 89 f7 mov %esi,%edi 2: e8 44 84 cb f6 call 0xf6cb844b 7: 83 fd 02 cmp $0x2,%ebp a: 77 0d ja 0x19 c: 85 ed test %ebp,%ebp e: 74 09 je 0x19 10: e8 f6 88 cb f6 call 0xf6cb890b 15: 4c 8d 7b 08 lea 0x8(%rbx),%r15 19: e8 ed 88 cb f6 call 0xf6cb890b 1e: 48 89 d8 mov %rbx,%rax 21: 48 c1 e8 03 shr $0x3,%rax 25: 42 80 3c 20 00 cmpb $0x0,(%rax,%r12,1) * 2a: 0f 85 29 1c 00 00 jne 0x1c59 <-- trapping instruction 30: 48 8b 03 mov (%rbx),%rax 33: 30 c0 xor %al,%al 35: 48 39 c3 cmp %rax,%rbx 38: 0f 84 a8 12 00 00 je 0x12e6 3e: e8 .byte 0xe8 3f: c8 .byte 0xc8