======================================================== WARNING: possible irq lock inversion dependency detected 5.14.0-rc7-syzkaller #0 Not tainted -------------------------------------------------------- syz-executor.2/18683 just changed the state of lock: ffff888147feb108 (&group->lock){..-.}-{2:2}, at: snd_pcm_period_elapsed+0x2c/0x210 sound/core/pcm_lib.c:1847 but this lock took another, SOFTIRQ-READ-unsafe lock in the past: (&new->fa_lock){.+.+}-{2:2} and interrupts could create inverse lock ordering between them. other info that might help us debug this: Chain exists of: &group->lock --> &timer->lock --> &new->fa_lock Possible interrupt unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&new->fa_lock); local_irq_disable(); lock(&group->lock); lock(&timer->lock); lock(&group->lock); *** DEADLOCK *** no locks held by syz-executor.2/18683. the shortest dependencies between 2nd lock and 1st lock: -> (&new->fa_lock){.+.+}-{2:2} { HARDIRQ-ON-R at: lock_acquire+0x182/0x4a0 kernel/locking/lockdep.c:5625 __raw_read_lock include/linux/rwlock_api_smp.h:149 [inline] _raw_read_lock+0x32/0x40 kernel/locking/spinlock.c:223 kill_fasync_rcu fs/fcntl.c:1012 [inline] kill_fasync+0x13b/0x430 fs/fcntl.c:1033 sock_wake_async+0x133/0x150 net/socket.c:1354 rcu_read_unlock include/linux/rcupdate.h:716 [inline] sk_wake_async+0x12e/0x200 include/net/sock.h:2328 tcp_rcv_state_process+0x1052/0x2410 net/ipv4/tcp_input.c:6437 tcp_v4_do_rcv+0x5b3/0x880 net/ipv4/tcp_ipv4.c:1716 sk_backlog_rcv include/net/sock.h:1023 [inline] __release_sock+0x1d8/0x4c0 net/core/sock.c:2655 release_sock+0x5d/0x1c0 net/core/sock.c:3179 inet_wait_for_connect net/ipv4/af_inet.c:597 [inline] __inet_stream_connect+0x5e2/0xe50 net/ipv4/af_inet.c:689 tcp_sendmsg_fastopen net/ipv4/tcp.c:1190 [inline] tcp_sendmsg_locked+0x3bb1/0x4230 net/ipv4/tcp.c:1232 tcp_sendmsg+0x2c/0x40 net/ipv4/tcp.c:1461 sock_sendmsg_nosec net/socket.c:703 [inline] sock_sendmsg net/socket.c:723 [inline] __sys_sendto+0x541/0x720 net/socket.c:2019 __do_sys_sendto net/socket.c:2031 [inline] __se_sys_sendto net/socket.c:2027 [inline] __x64_sys_sendto+0xda/0xf0 net/socket.c:2027 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae SOFTIRQ-ON-R at: lock_acquire+0x182/0x4a0 kernel/locking/lockdep.c:5625 __raw_read_lock include/linux/rwlock_api_smp.h:149 [inline] _raw_read_lock+0x32/0x40 kernel/locking/spinlock.c:223 kill_fasync_rcu fs/fcntl.c:1012 [inline] kill_fasync+0x13b/0x430 fs/fcntl.c:1033 sock_wake_async+0x133/0x150 net/socket.c:1354 rcu_read_unlock include/linux/rcupdate.h:716 [inline] sk_wake_async+0x12e/0x200 include/net/sock.h:2328 tcp_rcv_state_process+0x1052/0x2410 net/ipv4/tcp_input.c:6437 tcp_v4_do_rcv+0x5b3/0x880 net/ipv4/tcp_ipv4.c:1716 sk_backlog_rcv include/net/sock.h:1023 [inline] __release_sock+0x1d8/0x4c0 net/core/sock.c:2655 release_sock+0x5d/0x1c0 net/core/sock.c:3179 inet_wait_for_connect net/ipv4/af_inet.c:597 [inline] __inet_stream_connect+0x5e2/0xe50 net/ipv4/af_inet.c:689 tcp_sendmsg_fastopen net/ipv4/tcp.c:1190 [inline] tcp_sendmsg_locked+0x3bb1/0x4230 net/ipv4/tcp.c:1232 tcp_sendmsg+0x2c/0x40 net/ipv4/tcp.c:1461 sock_sendmsg_nosec net/socket.c:703 [inline] sock_sendmsg net/socket.c:723 [inline] __sys_sendto+0x541/0x720 net/socket.c:2019 __do_sys_sendto net/socket.c:2031 [inline] __se_sys_sendto net/socket.c:2027 [inline] __x64_sys_sendto+0xda/0xf0 net/socket.c:2027 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae INITIAL USE at: lock_acquire+0x182/0x4a0 kernel/locking/lockdep.c:5625 __raw_write_lock_irq include/linux/rwlock_api_smp.h:196 [inline] _raw_write_lock_irq+0xae/0xf0 kernel/locking/spinlock.c:311 fasync_remove_entry+0xff/0x1d0 fs/fcntl.c:890 lease_modify+0x4dd/0x6a0 fs/locks.c:1522 locks_remove_lease fs/locks.c:2771 [inline] locks_remove_file+0x52e/0xfd0 fs/locks.c:2796 __fput+0x2bf/0x7b0 fs/file_table.c:272 task_work_run+0x146/0x1c0 kernel/task_work.c:164 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop kernel/entry/common.c:175 [inline] exit_to_user_mode_prepare+0x201/0x220 kernel/entry/common.c:209 __syscall_exit_to_user_mode_work kernel/entry/common.c:291 [inline] syscall_exit_to_user_mode+0x26/0x60 kernel/entry/common.c:302 do_syscall_64+0x4c/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae INITIAL READ USE at: lock_acquire+0x182/0x4a0 kernel/locking/lockdep.c:5625 __raw_read_lock include/linux/rwlock_api_smp.h:149 [inline] _raw_read_lock+0x32/0x40 kernel/locking/spinlock.c:223 kill_fasync_rcu fs/fcntl.c:1012 [inline] kill_fasync+0x13b/0x430 fs/fcntl.c:1033 sock_wake_async+0x133/0x150 net/socket.c:1354 rcu_read_unlock include/linux/rcupdate.h:716 [inline] sk_wake_async+0x12e/0x200 include/net/sock.h:2328 tcp_rcv_state_process+0x1052/0x2410 net/ipv4/tcp_input.c:6437 tcp_v4_do_rcv+0x5b3/0x880 net/ipv4/tcp_ipv4.c:1716 sk_backlog_rcv include/net/sock.h:1023 [inline] __release_sock+0x1d8/0x4c0 net/core/sock.c:2655 release_sock+0x5d/0x1c0 net/core/sock.c:3179 inet_wait_for_connect net/ipv4/af_inet.c:597 [inline] __inet_stream_connect+0x5e2/0xe50 net/ipv4/af_inet.c:689 tcp_sendmsg_fastopen net/ipv4/tcp.c:1190 [inline] tcp_sendmsg_locked+0x3bb1/0x4230 net/ipv4/tcp.c:1232 tcp_sendmsg+0x2c/0x40 net/ipv4/tcp.c:1461 sock_sendmsg_nosec net/socket.c:703 [inline] sock_sendmsg net/socket.c:723 [inline] __sys_sendto+0x541/0x720 net/socket.c:2019 __do_sys_sendto net/socket.c:2031 [inline] __se_sys_sendto net/socket.c:2027 [inline] __x64_sys_sendto+0xda/0xf0 net/socket.c:2027 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae } ... key at: [] fasync_insert_entry.__key+0x0/0x40 ... acquired at: lock_acquire+0x182/0x4a0 kernel/locking/lockdep.c:5625 __raw_read_lock include/linux/rwlock_api_smp.h:149 [inline] _raw_read_lock+0x32/0x40 kernel/locking/spinlock.c:223 kill_fasync_rcu fs/fcntl.c:1012 [inline] kill_fasync+0x13b/0x430 fs/fcntl.c:1033 snd_timer_user_ccallback+0x3ee/0x710 sound/core/timer.c:1387 snd_timer_notify1+0x19e/0x340 sound/core/timer.c:516 snd_timer_start1+0x53d/0x640 sound/core/timer.c:578 snd_timer_start sound/core/timer.c:697 [inline] snd_timer_user_start sound/core/timer.c:1985 [inline] __snd_timer_user_ioctl+0xe18/0x5ed0 sound/core/timer.c:2108 snd_timer_user_ioctl+0x5d/0x80 sound/core/timer.c:2129 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:1069 [inline] __se_sys_ioctl+0xfb/0x170 fs/ioctl.c:1055 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae -> (&timer->lock){....}-{2:2} { INITIAL USE at: lock_acquire+0x182/0x4a0 kernel/locking/lockdep.c:5625 __raw_spin_lock_irq include/linux/spinlock_api_smp.h:128 [inline] _raw_spin_lock_irq+0xae/0xf0 kernel/locking/spinlock.c:167 spin_lock_irq include/linux/spinlock.h:379 [inline] snd_timer_close_locked+0x5c/0x8e0 sound/core/timer.c:396 snd_timer_close+0xaa/0x120 sound/core/timer.c:463 snd_seq_timer_close+0x9b/0xd0 sound/core/seq/seq_timer.c:326 snd_seq_queue_timer_close+0x9e/0xe0 sound/core/seq/seq_queue.c:456 snd_seq_ioctl_set_queue_timer+0x128/0x340 sound/core/seq/seq_clientmgr.c:1780 snd_seq_ioctl+0x204/0x380 sound/core/seq/seq_clientmgr.c:2173 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:1069 [inline] __se_sys_ioctl+0xfb/0x170 fs/ioctl.c:1055 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae } ... key at: [] snd_timer_new.__key+0x0/0x40 ... acquired at: lock_acquire+0x182/0x4a0 kernel/locking/lockdep.c:5625 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xb3/0x100 kernel/locking/spinlock.c:159 snd_timer_notify+0x105/0x3e0 sound/core/timer.c:1087 snd_pcm_timer_notify sound/core/pcm_native.c:590 [inline] snd_pcm_post_stop sound/core/pcm_native.c:1448 [inline] snd_pcm_action_single sound/core/pcm_native.c:1224 [inline] snd_pcm_action sound/core/pcm_native.c:1305 [inline] snd_pcm_stop+0x3b8/0x4c0 sound/core/pcm_native.c:1471 snd_pcm_drop+0x16d/0x290 sound/core/pcm_native.c:2150 snd_pcm_oss_sync+0x4f4/0xee0 sound/core/oss/pcm_oss.c:1721 snd_pcm_oss_release+0x119/0x270 sound/core/oss/pcm_oss.c:2571 __fput+0x352/0x7b0 fs/file_table.c:280 task_work_run+0x146/0x1c0 kernel/task_work.c:164 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop kernel/entry/common.c:175 [inline] exit_to_user_mode_prepare+0x201/0x220 kernel/entry/common.c:209 __syscall_exit_to_user_mode_work kernel/entry/common.c:291 [inline] syscall_exit_to_user_mode+0x26/0x60 kernel/entry/common.c:302 do_syscall_64+0x4c/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae -> (&group->lock){..-.}-{2:2} { IN-SOFTIRQ-W at: lock_acquire+0x182/0x4a0 kernel/locking/lockdep.c:5625 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xb3/0x100 kernel/locking/spinlock.c:159 snd_pcm_period_elapsed+0x2c/0x210 sound/core/pcm_lib.c:1847 dummy_hrtimer_callback+0x87/0x190 sound/drivers/dummy.c:377 __run_hrtimer kernel/time/hrtimer.c:1537 [inline] __hrtimer_run_queues+0x50b/0xa60 kernel/time/hrtimer.c:1601 hrtimer_run_softirq+0x176/0x1e0 kernel/time/hrtimer.c:1618 __do_softirq+0x372/0x783 kernel/softirq.c:558 invoke_softirq kernel/softirq.c:432 [inline] __irq_exit_rcu+0x21b/0x260 kernel/softirq.c:636 irq_exit_rcu+0x5/0x20 kernel/softirq.c:648 sysvec_apic_timer_interrupt+0x43/0xb0 arch/x86/kernel/apic/apic.c:1100 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:638 INITIAL USE at: lock_acquire+0x182/0x4a0 kernel/locking/lockdep.c:5625 __raw_spin_lock_irq include/linux/spinlock_api_smp.h:128 [inline] _raw_spin_lock_irq+0xae/0xf0 kernel/locking/spinlock.c:167 spin_lock_irq include/linux/spinlock.h:379 [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] snd_pcm_hw_params+0xca/0x1740 sound/core/pcm_native.c:681 snd_pcm_oss_change_params_locked+0x245a/0x4390 sound/core/oss/pcm_oss.c:947 snd_pcm_oss_change_params sound/core/oss/pcm_oss.c:1091 [inline] snd_pcm_oss_make_ready sound/core/oss/pcm_oss.c:1150 [inline] snd_pcm_oss_sync+0x37c/0xee0 sound/core/oss/pcm_oss.c:1717 snd_pcm_oss_release+0x119/0x270 sound/core/oss/pcm_oss.c:2571 __fput+0x352/0x7b0 fs/file_table.c:280 task_work_run+0x146/0x1c0 kernel/task_work.c:164 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop kernel/entry/common.c:175 [inline] exit_to_user_mode_prepare+0x201/0x220 kernel/entry/common.c:209 __syscall_exit_to_user_mode_work kernel/entry/common.c:291 [inline] syscall_exit_to_user_mode+0x26/0x60 kernel/entry/common.c:302 do_syscall_64+0x4c/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae } ... key at: [] snd_pcm_group_init.__key+0x0/0x40 ... acquired at: mark_usage kernel/locking/lockdep.c:4488 [inline] __lock_acquire+0xca1/0x6100 kernel/locking/lockdep.c:4969 lock_acquire+0x182/0x4a0 kernel/locking/lockdep.c:5625 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xb3/0x100 kernel/locking/spinlock.c:159 snd_pcm_period_elapsed+0x2c/0x210 sound/core/pcm_lib.c:1847 dummy_hrtimer_callback+0x87/0x190 sound/drivers/dummy.c:377 __run_hrtimer kernel/time/hrtimer.c:1537 [inline] __hrtimer_run_queues+0x50b/0xa60 kernel/time/hrtimer.c:1601 hrtimer_run_softirq+0x176/0x1e0 kernel/time/hrtimer.c:1618 __do_softirq+0x372/0x783 kernel/softirq.c:558 invoke_softirq kernel/softirq.c:432 [inline] __irq_exit_rcu+0x21b/0x260 kernel/softirq.c:636 irq_exit_rcu+0x5/0x20 kernel/softirq.c:648 sysvec_apic_timer_interrupt+0x43/0xb0 arch/x86/kernel/apic/apic.c:1100 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:638 stack backtrace: CPU: 0 PID: 18683 Comm: syz-executor.2 Not tainted 5.14.0-rc7-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1ae/0x29f lib/dump_stack.c:105 print_irq_inversion_bug+0xa58/0xda0 kernel/locking/lockdep.c:4000 check_usage_forwards kernel/locking/lockdep.c:2585 [inline] mark_lock_irq kernel/locking/lockdep.c:4163 [inline] mark_lock+0x1064/0x1eb0 kernel/locking/lockdep.c:4593 mark_usage kernel/locking/lockdep.c:4488 [inline] __lock_acquire+0xca1/0x6100 kernel/locking/lockdep.c:4969 lock_acquire+0x182/0x4a0 kernel/locking/lockdep.c:5625 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xb3/0x100 kernel/locking/spinlock.c:159 snd_pcm_period_elapsed+0x2c/0x210 sound/core/pcm_lib.c:1847 dummy_hrtimer_callback+0x87/0x190 sound/drivers/dummy.c:377 __run_hrtimer kernel/time/hrtimer.c:1537 [inline] __hrtimer_run_queues+0x50b/0xa60 kernel/time/hrtimer.c:1601 hrtimer_run_softirq+0x176/0x1e0 kernel/time/hrtimer.c:1618 __do_softirq+0x372/0x783 kernel/softirq.c:558 invoke_softirq kernel/softirq.c:432 [inline] __irq_exit_rcu+0x21b/0x260 kernel/softirq.c:636 irq_exit_rcu+0x5/0x20 kernel/softirq.c:648 sysvec_apic_timer_interrupt+0x43/0xb0 arch/x86/kernel/apic/apic.c:1100 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:638 RIP: 0033:0x414a30 Code: ff fe ff ff 66 0f 1f 44 00 00 47 89 44 95 00 e9 b3 fe ff ff 49 39 d4 74 73 48 8d 72 10 4c 39 e6 75 0b eb 2c 66 0f 1f 44 00 00 <48> 8b 3a 4c 8b 06 48 8d 42 08 49 39 f8 74 0e 48 8d 7a 10 4c 89 42 RSP: 002b:00007ffe06f2a220 EFLAGS: 00000202 RAX: 00007fe2f041f388 RBX: 00007fe2f041f008 RCX: 00007fe2f041f058 RDX: 00007fe2f041f380 RSI: 00007fe2f0425d20 RDI: 00007fe2f041f388 RBP: 0000000000001caa R08: ffffffff81ac4603 R09: 0000001b2c9223c8 R10: 0000000000000f7e R11: 00000000f44e6f82 R12: 00007fe2f042d558 R13: 00007fe2f042d558 R14: ffffffff81a68832 R15: 000000000056c008