======================================================== WARNING: possible irq lock inversion dependency detected 6.8.0-syzkaller-08951-gfe46a7dd189e #0 Not tainted -------------------------------------------------------- syz-executor.0/5204 just changed the state of lock: ffff888029abb910 (&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.0/5204: #0: ffffffff8e374d28 (tty_mutex){+.+.}-{3:3}, at: tty_release_struct+0xad/0xe0 drivers/tty/tty_io.c:1706 #1: ffffc90000007cb0 ((&dpcm->timer)){+.-.}-{0:0}, at: call_timer_fn+0x11a/0x5b0 kernel/time/timer.c:1789 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_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] do_select+0xca2/0x17b0 fs/select.c:538 core_sys_select+0x459/0xb80 fs/select.c:681 do_pselect.constprop.0+0x1a0/0x1f0 fs/select.c:763 __do_sys_pselect6 fs/select.c:804 [inline] __se_sys_pselect6 fs/select.c:795 [inline] __x64_sys_pselect6+0x150/0x1d0 fs/select.c:795 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] do_select+0xca2/0x17b0 fs/select.c:538 core_sys_select+0x459/0xb80 fs/select.c:681 do_pselect.constprop.0+0x1a0/0x1f0 fs/select.c:763 __do_sys_pselect6 fs/select.c:804 [inline] __se_sys_pselect6 fs/select.c:795 [inline] __x64_sys_pselect6+0x150/0x1d0 fs/select.c:795 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 loopback_jiffies_timer_function+0x1c8/0x240 sound/drivers/aloop.c:713 call_timer_fn+0x1a0/0x5b0 kernel/time/timer.c:1792 expire_timers kernel/time/timer.c:1843 [inline] __run_timers+0x74b/0xab0 kernel/time/timer.c:2408 __run_timer_base kernel/time/timer.c:2419 [inline] __run_timer_base kernel/time/timer.c:2412 [inline] run_timer_base+0x111/0x190 kernel/time/timer.c:2428 run_timer_softirq+0x1a/0x40 kernel/time/timer.c:2438 __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 queue_work_on+0x92/0x120 kernel/workqueue.c:2439 kref_put include/linux/kref.h:65 [inline] tty_kref_put drivers/tty/tty_io.c:1572 [inline] tty_kref_put drivers/tty/tty_io.c:1569 [inline] release_tty+0x4e1/0x600 drivers/tty/tty_io.c:1608 tty_release_struct+0xb7/0xe0 drivers/tty/tty_io.c:1707 tty_release+0xe33/0x1420 drivers/tty/tty_io.c:1867 __fput+0x270/0xb80 fs/file_table.c:422 task_work_run+0x14e/0x250 kernel/task_work.c:180 get_signal+0x105e/0x2760 kernel/signal.c:2683 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_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] do_select+0xca2/0x17b0 fs/select.c:538 core_sys_select+0x459/0xb80 fs/select.c:681 do_pselect.constprop.0+0x1a0/0x1f0 fs/select.c:763 __do_sys_pselect6 fs/select.c:804 [inline] __se_sys_pselect6 fs/select.c:795 [inline] __x64_sys_pselect6+0x150/0x1d0 fs/select.c:795 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 loopback_jiffies_timer_function+0x1c8/0x240 sound/drivers/aloop.c:713 call_timer_fn+0x1a0/0x5b0 kernel/time/timer.c:1792 expire_timers kernel/time/timer.c:1843 [inline] __run_timers+0x74b/0xab0 kernel/time/timer.c:2408 __run_timer_base kernel/time/timer.c:2419 [inline] __run_timer_base kernel/time/timer.c:2412 [inline] run_timer_base+0x111/0x190 kernel/time/timer.c:2428 run_timer_softirq+0x1a/0x40 kernel/time/timer.c:2438 __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 queue_work_on+0x92/0x120 kernel/workqueue.c:2439 kref_put include/linux/kref.h:65 [inline] tty_kref_put drivers/tty/tty_io.c:1572 [inline] tty_kref_put drivers/tty/tty_io.c:1569 [inline] release_tty+0x4e1/0x600 drivers/tty/tty_io.c:1608 tty_release_struct+0xb7/0xe0 drivers/tty/tty_io.c:1707 tty_release+0xe33/0x1420 drivers/tty/tty_io.c:1867 __fput+0x270/0xb80 fs/file_table.c:422 task_work_run+0x14e/0x250 kernel/task_work.c:180 get_signal+0x105e/0x2760 kernel/signal.c:2683 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 stack backtrace: CPU: 0 PID: 5204 Comm: syz-executor.0 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 loopback_jiffies_timer_function+0x1c8/0x240 sound/drivers/aloop.c:713 call_timer_fn+0x1a0/0x5b0 kernel/time/timer.c:1792 expire_timers kernel/time/timer.c:1843 [inline] __run_timers+0x74b/0xab0 kernel/time/timer.c:2408 __run_timer_base kernel/time/timer.c:2419 [inline] __run_timer_base kernel/time/timer.c:2412 [inline] run_timer_base+0x111/0x190 kernel/time/timer.c:2428 run_timer_softirq+0x1a/0x40 kernel/time/timer.c:2438 __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:queue_work_on+0x92/0x120 kernel/workqueue.c:2440 Code: ff 48 89 ee e8 af b1 34 00 48 85 ed 75 42 e8 95 b6 34 00 9c 5b 81 e3 00 02 00 00 31 ff 48 89 de e8 93 b1 34 00 48 85 db 75 6d 79 b6 34 00 44 89 e8 5b 5d 41 5c 41 5d 41 5e 41 5f c3 cc cc cc RSP: 0018:ffffc9000256fae0 EFLAGS: 00000246 RAX: 0000000000040000 RBX: 0000000000000000 RCX: ffffc900038b1000 RDX: 0000000000040000 RSI: ffffffff8158427e RDI: 0000000000000007 RBP: 0000000000000200 R08: 0000000000000007 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000008 R13: 0000000000000001 R14: ffff888015078800 R15: ffff8880591e2600 kref_put include/linux/kref.h:65 [inline] tty_kref_put drivers/tty/tty_io.c:1572 [inline] tty_kref_put drivers/tty/tty_io.c:1569 [inline] release_tty+0x4e1/0x600 drivers/tty/tty_io.c:1608 tty_release_struct+0xb7/0xe0 drivers/tty/tty_io.c:1707 tty_release+0xe33/0x1420 drivers/tty/tty_io.c:1867 __fput+0x270/0xb80 fs/file_table.c:422 task_work_run+0x14e/0x250 kernel/task_work.c:180 get_signal+0x105e/0x2760 kernel/signal.c:2683 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 RIP: 0033:0x7f2a1aa7de69 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f2a1b8180c8 EFLAGS: 00000246 ORIG_RAX: 000000000000010e RAX: 0000000000000007 RBX: 00007f2a1ababf80 RCX: 00007f2a1aa7de69 RDX: 0000000000000000 RSI: 00000000200001c0 RDI: 0000000000000040 RBP: 00007f2a1aaca47a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000020000080 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f2a1ababf80 R15: 00007ffe10c36558 TCP: request_sock_TCPv6: Possible SYN flooding on port [::1]:20002. Sending cookies. ---------------- Code disassembly (best guess): 0: ff 48 89 decl -0x77(%rax) 3: ee out %al,(%dx) 4: e8 af b1 34 00 call 0x34b1b8 9: 48 85 ed test %rbp,%rbp c: 75 42 jne 0x50 e: e8 95 b6 34 00 call 0x34b6a8 13: 9c pushf 14: 5b pop %rbx 15: 81 e3 00 02 00 00 and $0x200,%ebx 1b: 31 ff xor %edi,%edi 1d: 48 89 de mov %rbx,%rsi 20: e8 93 b1 34 00 call 0x34b1b8 25: 48 85 db test %rbx,%rbx 28: 75 6d jne 0x97 * 2a: e8 79 b6 34 00 call 0x34b6a8 <-- trapping instruction 2f: 44 89 e8 mov %r13d,%eax 32: 5b pop %rbx 33: 5d pop %rbp 34: 41 5c pop %r12 36: 41 5d pop %r13 38: 41 5e pop %r14 3a: 41 5f pop %r15 3c: c3 ret 3d: cc int3 3e: cc int3 3f: cc int3