======================================================== WARNING: possible irq lock inversion dependency detected 6.8.0-syzkaller-08951-gfe46a7dd189e #0 Not tainted -------------------------------------------------------- kworker/0:0/7 just changed the state of lock: ffff888029cc2110 ( &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 *** 3 locks held by kworker/0:0/7: #0: ffff888015079948 ((wq_completion)events_power_efficient){+.+.}-{0:0}, at: process_one_work+0x1296/0x1a60 kernel/workqueue.c:3229 #1: ffffc900000c7d80 ((work_completion)(&(&gc_work->dwork)->work)){+.+.}-{0:0}, at: process_one_work+0x906/0x1a60 kernel/workqueue.c:3230 #2: ffffffff8d7b08e0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:298 [inline] #2: ffffffff8d7b08e0 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:750 [inline] #2: ffffffff8d7b08e0 (rcu_read_lock){....}-{1:2}, at: gc_worker+0x247/0x1830 net/netfilter/nf_conntrack_core.c:1488 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 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 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 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 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 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 } ... 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 __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 -> (&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 seqcount_lockdep_reader_access include/linux/seqlock.h:74 [inline] nf_conntrack_get_ht include/net/netfilter/nf_conntrack.h:345 [inline] gc_worker+0x2e1/0x1830 net/netfilter/nf_conntrack_core.c:1490 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 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_change_params sound/core/oss/pcm_oss.c:1105 [inline] snd_pcm_oss_make_ready+0xe6/0x1b0 sound/core/oss/pcm_oss.c:1164 snd_pcm_oss_get_odelay sound/core/oss/pcm_oss.c:2166 [inline] snd_pcm_oss_ioctl+0x155a/0x37a0 sound/core/oss/pcm_oss.c:2732 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 seqcount_lockdep_reader_access include/linux/seqlock.h:74 [inline] nf_conntrack_get_ht include/net/netfilter/nf_conntrack.h:345 [inline] gc_worker+0x2e1/0x1830 net/netfilter/nf_conntrack_core.c:1490 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 stack backtrace: CPU: 0 PID: 7 Comm: kworker/0:0 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_power_efficient gc_worker 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:__seqprop_spinlock_sequence include/linux/seqlock.h:227 [inline] RIP: 0010:nf_conntrack_get_ht include/net/netfilter/nf_conntrack.h:345 [inline] RIP: 0010:gc_worker+0x2e1/0x1830 net/netfilter/nf_conntrack_core.c:1490 Code: 00 00 48 c7 c7 68 19 9f 8f e8 9b 0f 74 f8 9c 5b 81 e3 00 02 00 00 31 ff 48 89 de e8 e9 c0 95 f8 48 85 db 58 0f 85 fa 10 00 00 ca c5 95 f8 eb 07 e8 c3 c5 95 f8 f3 90 44 8b 35 6a e6 a7 06 31 RSP: 0018:ffffc900000c7bd0 EFLAGS: 00000293 RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffffffff88f73f0a RDX: ffff888017693c00 RSI: ffffffff88f73f19 RDI: 0000000000000007 RBP: ffff88801dc00000 R08: 0000000000000007 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000003 R12: 0000000000005bdb R13: dffffc0000000000 R14: 000000000000b7b5 R15: 0000000000040000 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 vkms_vblank_simulate: vblank timer overrun vkms_vblank_simulate: vblank timer overrun vkms_vblank_simulate: vblank timer overrun vkms_vblank_simulate: vblank timer overrun ---------------- Code disassembly (best guess): 0: 00 00 add %al,(%rax) 2: 48 c7 c7 68 19 9f 8f mov $0xffffffff8f9f1968,%rdi 9: e8 9b 0f 74 f8 call 0xf8740fa9 e: 9c pushf f: 5b pop %rbx 10: 81 e3 00 02 00 00 and $0x200,%ebx 16: 31 ff xor %edi,%edi 18: 48 89 de mov %rbx,%rsi 1b: e8 e9 c0 95 f8 call 0xf895c109 20: 48 85 db test %rbx,%rbx 23: 58 pop %rax 24: 0f 85 fa 10 00 00 jne 0x1124 * 2a: e8 ca c5 95 f8 call 0xf895c5f9 <-- trapping instruction 2f: eb 07 jmp 0x38 31: e8 c3 c5 95 f8 call 0xf895c5f9 36: f3 90 pause 38: 44 8b 35 6a e6 a7 06 mov 0x6a7e66a(%rip),%r14d # 0x6a7e6a9 3f: 31 .byte 0x31