======================================================== WARNING: possible irq lock inversion dependency detected 6.8.0-syzkaller-08951-gfe46a7dd189e #0 Not tainted -------------------------------------------------------- syz-executor.4/10721 just changed the state of lock: ffff888029e91910 (&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 *** 2 locks held by syz-executor.4/10721: #0: ffff888024be94a0 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:165 [inline] #0: ffff888024be94a0 (&mm->mmap_lock){++++}-{3:3}, at: get_mmap_lock_carefully mm/memory.c:5497 [inline] #0: ffff888024be94a0 (&mm->mmap_lock){++++}-{3:3}, at: lock_mm_and_find_vma+0x35/0x580 mm/memory.c:5557 #1: ffffffff8d7b08e0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:298 [inline] #1: ffffffff8d7b08e0 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:750 [inline] #1: ffffffff8d7b08e0 (rcu_read_lock){....}-{1:2}, at: __pte_offset_map+0x42/0x540 mm/pgtable-generic.c:285 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 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 } ... 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_action_lock_irq+0xa1/0x1a0 sound/core/pcm_native.c:1383 snd_pcm_start_lock_irq sound/core/pcm_native.c:1485 [inline] snd_pcm_kernel_ioctl+0x10f/0x2d0 sound/core/pcm_native.c:3440 snd_pcm_oss_set_trigger.isra.0+0x35f/0x6b0 sound/core/oss/pcm_oss.c:2134 snd_pcm_oss_poll+0x9a0/0xb80 sound/core/oss/pcm_oss.c:2863 vfs_poll include/linux/poll.h:84 [inline] __io_arm_poll_handler+0x484/0xea0 io_uring/poll.c:622 io_poll_add+0x170/0x2a0 io_uring/poll.c:983 io_issue_sqe+0x177/0xdd0 io_uring/io_uring.c:1897 io_queue_sqe io_uring/io_uring.c:2106 [inline] io_submit_sqe io_uring/io_uring.c:2365 [inline] io_submit_sqes+0x975/0x1d80 io_uring/io_uring.c:2480 __do_sys_io_uring_enter+0x71d/0x1120 io_uring/io_uring.c:3656 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 __sanitizer_cov_trace_const_cmp8+0x0/0x20 kernel/kcov.c:304 pmd_pfn_mask arch/x86/include/asm/pgtable_types.h:452 [inline] pmd_pfn arch/x86/include/asm/pgtable.h:235 [inline] pte_lockptr include/linux/mm.h:2893 [inline] pte_offset_map_nolock+0x15c/0x1c0 mm/pgtable-generic.c:314 handle_pte_fault mm/memory.c:5150 [inline] __handle_mm_fault+0xba4/0x4920 mm/memory.c:5305 handle_mm_fault+0x476/0xa00 mm/memory.c:5470 do_user_addr_fault+0x2e5/0x1080 arch/x86/mm/fault.c:1413 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+0x92/0xb0 sound/core/pcm_native.c:136 class_pcm_stream_lock_irq_constructor include/sound/pcm.h:666 [inline] snd_pcm_oss_poll+0x2f6/0xb80 sound/core/oss/pcm_oss.c:2852 vfs_poll include/linux/poll.h:84 [inline] __io_arm_poll_handler+0x484/0xea0 io_uring/poll.c:622 io_poll_add+0x170/0x2a0 io_uring/poll.c:983 io_issue_sqe+0x177/0xdd0 io_uring/io_uring.c:1897 io_queue_sqe io_uring/io_uring.c:2106 [inline] io_submit_sqe io_uring/io_uring.c:2365 [inline] io_submit_sqes+0x975/0x1d80 io_uring/io_uring.c:2480 __do_sys_io_uring_enter+0x71d/0x1120 io_uring/io_uring.c:3656 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 __sanitizer_cov_trace_const_cmp8+0x0/0x20 kernel/kcov.c:304 pmd_pfn_mask arch/x86/include/asm/pgtable_types.h:452 [inline] pmd_pfn arch/x86/include/asm/pgtable.h:235 [inline] pte_lockptr include/linux/mm.h:2893 [inline] pte_offset_map_nolock+0x15c/0x1c0 mm/pgtable-generic.c:314 handle_pte_fault mm/memory.c:5150 [inline] __handle_mm_fault+0xba4/0x4920 mm/memory.c:5305 handle_mm_fault+0x476/0xa00 mm/memory.c:5470 do_user_addr_fault+0x2e5/0x1080 arch/x86/mm/fault.c:1413 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: 10721 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:__sanitizer_cov_trace_const_cmp8+0x0/0x20 kernel/kcov.c:310 Code: 0c 24 89 f2 89 fe bf 05 00 00 00 e9 2a fe ff ff 66 2e 0f 1f 84 00 00 00 00 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 0f 1e fa 48 8b 0c 24 48 89 f2 48 89 fe bf 07 00 00 00 e9 f8 fd RSP: 0000:ffffc9000386fc80 EFLAGS: 00000246 RAX: 0000000000000000 RBX: 000000004e001067 RCX: ffffffff81d70d2a RDX: ffff88802ef63c00 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000007 R09: 0000000000000000 R10: 000000004e001067 R11: 0000000000000001 R12: 1ffff9200070df91 R13: ffff88804e001bf0 R14: ffffc9000386fdf8 R15: ffffea0000000000 pmd_pfn_mask arch/x86/include/asm/pgtable_types.h:452 [inline] pmd_pfn arch/x86/include/asm/pgtable.h:235 [inline] pte_lockptr include/linux/mm.h:2893 [inline] pte_offset_map_nolock+0x15c/0x1c0 mm/pgtable-generic.c:314 handle_pte_fault mm/memory.c:5150 [inline] __handle_mm_fault+0xba4/0x4920 mm/memory.c:5305 handle_mm_fault+0x476/0xa00 mm/memory.c:5470 do_user_addr_fault+0x2e5/0x1080 arch/x86/mm/fault.c:1413 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:0x7f2e19053146 Code: 8d 3c 30 4c 89 de 4c 89 54 24 38 e8 f4 ad 02 00 4c 8b 54 24 38 85 c0 0f 85 57 01 00 00 48 8b 44 24 28 48 89 df 4c 89 54 24 38 <4c> 89 93 98 06 00 00 48 89 83 90 06 00 00 48 8d 83 10 03 00 00 4c RSP: 002b:00007ffd0e0623a0 EFLAGS: 00010246 RAX: 00007f2e19d5e000 RBX: 00007f2e19d7e6c0 RCX: 00007f2e1907df27 RDX: 0000000000000003 RSI: 0000000000020000 RDI: 00007f2e19d7e6c0 RBP: 0000000000000000 R08: 00000000ffffffff R09: 0000000000000000 R10: 0000000000021000 R11: 0000000000000206 R12: 00007ffd0e062640 R13: ffffffffffffffc0 R14: 0000000000001000 R15: 0000000000000000 ---------------- Code disassembly (best guess): 0: 0c 24 or $0x24,%al 2: 89 f2 mov %esi,%edx 4: 89 fe mov %edi,%esi 6: bf 05 00 00 00 mov $0x5,%edi b: e9 2a fe ff ff jmp 0xfffffe3a 10: 66 2e 0f 1f 84 00 00 cs nopw 0x0(%rax,%rax,1) 17: 00 00 00 1a: 90 nop 1b: 90 nop 1c: 90 nop 1d: 90 nop 1e: 90 nop 1f: 90 nop 20: 90 nop 21: 90 nop 22: 90 nop 23: 90 nop 24: 90 nop 25: 90 nop 26: 90 nop 27: 90 nop 28: 90 nop 29: 90 nop * 2a: f3 0f 1e fa endbr64 <-- trapping instruction 2e: 48 8b 0c 24 mov (%rsp),%rcx 32: 48 89 f2 mov %rsi,%rdx 35: 48 89 fe mov %rdi,%rsi 38: bf 07 00 00 00 mov $0x7,%edi 3d: e9 .byte 0xe9 3e: f8 clc 3f: fd std