======================================================== WARNING: possible irq lock inversion dependency detected 5.14.0-rc7-syzkaller #0 Not tainted -------------------------------------------------------- ksoftirqd/0/13 just changed the state of lock: ffff88814798b108 (&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 ksoftirqd/0/13. 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 dccp_rcv_request_sent_state_process net/dccp/input.c:476 [inline] dccp_rcv_state_process+0x12b5/0x19e0 net/dccp/input.c:676 dccp_v6_do_rcv+0x26a/0xb90 net/dccp/ipv6.c:653 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 inet_stream_connect+0x61/0xa0 net/ipv4/af_inet.c:728 __sys_connect_file net/socket.c:1879 [inline] __sys_connect+0x39b/0x420 net/socket.c:1896 __do_sys_connect net/socket.c:1906 [inline] __se_sys_connect net/socket.c:1903 [inline] __x64_sys_connect+0x76/0x80 net/socket.c:1903 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 IN-SOFTIRQ-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 sock_def_readable+0x152/0x200 net/core/sock.c:3017 dccp_fin net/dccp/input.c:40 [inline] dccp_rcv_reset net/dccp/input.c:152 [inline] __dccp_rcv_established+0x3e8/0x580 net/dccp/input.c:309 dccp_rcv_established+0x29b/0x310 net/dccp/input.c:376 dccp_v6_do_rcv+0x241/0xb90 net/dccp/ipv6.c:621 sk_backlog_rcv include/net/sock.h:1023 [inline] __sk_receive_skb+0x43a/0x9d0 net/core/sock.c:527 dccp_v6_rcv+0xd2b/0x1120 net/dccp/ipv6.c:790 ip6_protocol_deliver_rcu+0x9a5/0x1310 net/ipv6/ip6_input.c:422 ip6_input_finish net/ipv6/ip6_input.c:463 [inline] NF_HOOK include/linux/netfilter.h:307 [inline] ip6_input+0x10b/0x190 net/ipv6/ip6_input.c:472 __netif_receive_skb_one_core net/core/dev.c:5498 [inline] __netif_receive_skb+0x1d1/0x500 net/core/dev.c:5612 process_backlog+0x4d8/0x940 net/core/dev.c:6492 __napi_poll+0xba/0x4f0 net/core/dev.c:7047 napi_poll net/core/dev.c:7114 [inline] net_rx_action+0x62c/0xf30 net/core/dev.c:7201 __do_softirq+0x372/0x783 kernel/softirq.c:558 do_softirq+0x14a/0x210 kernel/softirq.c:459 __local_bh_enable_ip+0x184/0x1c0 kernel/softirq.c:383 inet_csk_listen_stop+0x79a/0xb00 net/ipv4/inet_connection_sock.c:1219 dccp_close+0x521/0x12c0 net/dccp/proto.c:993 inet_release+0x16e/0x1f0 net/ipv4/af_inet.c:431 __sock_release net/socket.c:648 [inline] sock_close+0xd8/0x260 net/socket.c:1300 __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 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 dccp_rcv_request_sent_state_process net/dccp/input.c:476 [inline] dccp_rcv_state_process+0x12b5/0x19e0 net/dccp/input.c:676 dccp_v6_do_rcv+0x26a/0xb90 net/dccp/ipv6.c:653 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 inet_stream_connect+0x61/0xa0 net/ipv4/af_inet.c:728 __sys_connect_file net/socket.c:1879 [inline] __sys_connect+0x39b/0x420 net/socket.c:1896 __do_sys_connect net/socket.c:1906 [inline] __se_sys_connect net/socket.c:1903 [inline] __x64_sys_connect+0x76/0x80 net/socket.c:1903 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 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 } ... 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_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 } ... 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 run_ksoftirqd+0xa2/0x100 kernel/softirq.c:920 smpboot_thread_fn+0x533/0x9d0 kernel/smpboot.c:164 kthread+0x453/0x480 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 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+0x587/0xee0 sound/core/oss/pcm_oss.c:1650 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 run_ksoftirqd+0xa2/0x100 kernel/softirq.c:920 smpboot_thread_fn+0x533/0x9d0 kernel/smpboot.c:164 kthread+0x453/0x480 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 stack backtrace: CPU: 0 PID: 13 Comm: ksoftirqd/0 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 run_ksoftirqd+0xa2/0x100 kernel/softirq.c:920 smpboot_thread_fn+0x533/0x9d0 kernel/smpboot.c:164 kthread+0x453/0x480 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295