======================================================== WARNING: possible irq lock inversion dependency detected 5.11.0-syzkaller #0 Not tainted -------------------------------------------------------- syz-executor292/5880 just changed the state of lock: ffff88802ae300c0 (&new->fa_lock){.+..}-{2:2}, at: kill_fasync_rcu fs/fcntl.c:1004 [inline] ffff88802ae300c0 (&new->fa_lock){.+..}-{2:2}, at: kill_fasync fs/fcntl.c:1025 [inline] ffff88802ae300c0 (&new->fa_lock){.+..}-{2:2}, at: kill_fasync+0xec/0x310 fs/fcntl.c:1018 but this lock was taken by another, HARDIRQ-safe 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(&new->fa_lock); local_irq_disable(); lock(&timer->lock); lock(&new->fa_lock); lock(&timer->lock); *** DEADLOCK *** 3 locks held by syz-executor292/5880: #0: ffffffff8a76ad40 (rcu_read_lock){....}-{1:2}, at: sk_tx_queue_clear include/net/sock.h:1824 [inline] #0: ffffffff8a76ad40 (rcu_read_lock){....}-{1:2}, at: sk_dst_set include/net/sock.h:1992 [inline] #0: ffffffff8a76ad40 (rcu_read_lock){....}-{1:2}, at: sk_dst_reset include/net/sock.h:2007 [inline] #0: ffffffff8a76ad40 (rcu_read_lock){....}-{1:2}, at: sock_def_readable+0x0/0x340 net/core/sock.c:550 #1: ffffffff8a76ad40 (rcu_read_lock){....}-{1:2}, at: rcu_lock_release include/linux/rcupdate.h:264 [inline] #1: ffffffff8a76ad40 (rcu_read_lock){....}-{1:2}, at: rcu_read_unlock include/linux/rcupdate.h:702 [inline] #1: ffffffff8a76ad40 (rcu_read_lock){....}-{1:2}, at: sock_def_readable+0x134/0x340 net/core/sock.c:2905 #2: ffffffff8a76ad40 (rcu_read_lock){....}-{1:2}, at: kill_fasync+0x36/0x310 fs/fcntl.c:1023 the shortest dependencies between 2nd lock and 1st lock: -> (&timer->lock){-...}-{2:2} { IN-HARDIRQ-W at: lock_acquire kernel/locking/lockdep.c:5442 [inline] lock_acquire+0x1a8/0x720 kernel/locking/lockdep.c:5407 __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline] _raw_spin_lock+0x2a/0x40 kernel/locking/spinlock.c:151 spin_lock include/linux/spinlock.h:354 [inline] snd_hrtimer_callback+0x4a/0x380 sound/core/hrtimer.c:38 __run_hrtimer kernel/time/hrtimer.c:1519 [inline] __hrtimer_run_queues+0x4d7/0xb00 kernel/time/hrtimer.c:1583 hrtimer_interrupt+0x300/0x930 kernel/time/hrtimer.c:1645 local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1089 [inline] __sysvec_apic_timer_interrupt+0x146/0x540 arch/x86/kernel/apic/apic.c:1106 asm_call_irq_on_stack+0xf/0x20 __run_sysvec_on_irqstack arch/x86/include/asm/irq_stack.h:37 [inline] run_sysvec_on_irqstack_cond arch/x86/include/asm/irq_stack.h:89 [inline] sysvec_apic_timer_interrupt+0xbd/0x100 arch/x86/kernel/apic/apic.c:1100 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:629 native_restore_fl arch/x86/include/asm/irqflags.h:41 [inline] arch_local_irq_restore arch/x86/include/asm/irqflags.h:84 [inline] __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:160 [inline] _raw_spin_unlock_irqrestore+0x25/0x50 kernel/locking/spinlock.c:191 spin_unlock_irqrestore include/linux/spinlock.h:409 [inline] snd_seq_check_queue+0xd0/0x380 sound/core/seq/seq_queue.c:255 snd_seq_enqueue_event+0x17e/0x380 sound/core/seq/seq_queue.c:333 snd_seq_client_enqueue_event.constprop.0+0x1b0/0x3c0 sound/core/seq/seq_clientmgr.c:973 snd_seq_kernel_client_enqueue+0x12d/0x180 sound/core/seq/seq_clientmgr.c:2281 insert_queue sound/core/seq/oss/seq_oss_rw.c:173 [inline] snd_seq_oss_write+0x474/0x650 sound/core/seq/oss/seq_oss_rw.c:135 odev_write+0x37/0x70 sound/core/seq/oss/seq_oss.c:164 vfs_write+0x1c4/0x870 fs/read_write.c:603 ksys_write+0xf4/0x1d0 fs/read_write.c:658 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 INITIAL USE at: lock_acquire kernel/locking/lockdep.c:5442 [inline] lock_acquire+0x1a8/0x720 kernel/locking/lockdep.c:5407 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x39/0x50 kernel/locking/spinlock.c:159 snd_timer_notify sound/core/timer.c:1086 [inline] snd_timer_notify+0xcc/0x320 sound/core/timer.c:1073 snd_pcm_timer_notify sound/core/pcm_native.c:581 [inline] snd_pcm_post_stop+0x1a0/0x210 sound/core/pcm_native.c:1436 snd_pcm_action_single sound/core/pcm_native.c:1214 [inline] snd_pcm_action+0x10c/0x140 sound/core/pcm_native.c:1295 snd_pcm_stop sound/core/pcm_native.c:1460 [inline] snd_pcm_drop+0x165/0x290 sound/core/pcm_native.c:2138 snd_pcm_oss_sync+0x1ed/0x730 sound/core/oss/pcm_oss.c:1717 snd_pcm_oss_release+0x21f/0x2b0 sound/core/oss/pcm_oss.c:2556 __fput+0x204/0x870 fs/file_table.c:280 task_work_run+0xc0/0x160 kernel/task_work.c:140 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop kernel/entry/common.c:174 [inline] exit_to_user_mode_prepare+0x249/0x250 kernel/entry/common.c:201 __syscall_exit_to_user_mode_work kernel/entry/common.c:283 [inline] syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x44/0xa9 } ... key at: [] __key.12+0x0/0x40 ... acquired at: __raw_read_lock include/linux/rwlock_api_smp.h:149 [inline] _raw_read_lock+0x5b/0x70 kernel/locking/spinlock.c:223 kill_fasync_rcu fs/fcntl.c:1004 [inline] kill_fasync fs/fcntl.c:1025 [inline] kill_fasync+0xec/0x310 fs/fcntl.c:1018 snd_timer_user_ccallback+0x24d/0x300 sound/core/timer.c:1386 snd_timer_notify1+0x119/0x330 sound/core/timer.c:516 snd_timer_start1+0x3dd/0x6f0 sound/core/timer.c:577 snd_timer_start sound/core/timer.c:696 [inline] snd_timer_start sound/core/timer.c:689 [inline] snd_timer_user_start.isra.0+0x16d/0x1e0 sound/core/timer.c:1984 __snd_timer_user_ioctl.isra.0+0xb0b/0x1fc0 sound/core/timer.c:2107 snd_timer_user_ioctl+0x72/0xa0 sound/core/timer.c:2128 vfs_ioctl fs/ioctl.c:48 [inline] __do_sys_ioctl fs/ioctl.c:753 [inline] __se_sys_ioctl fs/ioctl.c:739 [inline] __x64_sys_ioctl+0x11f/0x190 fs/ioctl.c:739 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 -> (&new->fa_lock){.+..}-{2:2} { HARDIRQ-ON-R at: lock_acquire kernel/locking/lockdep.c:5442 [inline] lock_acquire+0x1a8/0x720 kernel/locking/lockdep.c:5407 __raw_read_lock include/linux/rwlock_api_smp.h:149 [inline] _raw_read_lock+0x5b/0x70 kernel/locking/spinlock.c:223 kill_fasync_rcu fs/fcntl.c:1004 [inline] kill_fasync fs/fcntl.c:1025 [inline] kill_fasync+0xec/0x310 fs/fcntl.c:1018 sock_wake_async+0xce/0x110 net/socket.c:1310 sk_wake_async include/net/sock.h:2286 [inline] sk_wake_async include/net/sock.h:2282 [inline] sock_def_readable+0x1cc/0x340 net/core/sock.c:2904 unix_dgram_sendmsg+0xcad/0x1710 net/unix/af_unix.c:1799 sock_sendmsg_nosec net/socket.c:652 [inline] sock_sendmsg+0xab/0xe0 net/socket.c:672 ____sys_sendmsg+0x392/0x7a0 net/socket.c:2345 ___sys_sendmsg+0xd3/0x150 net/socket.c:2399 __sys_sendmmsg+0x141/0x300 net/socket.c:2489 __do_sys_sendmmsg net/socket.c:2518 [inline] __se_sys_sendmmsg net/socket.c:2515 [inline] __x64_sys_sendmmsg+0x94/0x100 net/socket.c:2515 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 INITIAL READ USE at: lock_acquire kernel/locking/lockdep.c:5442 [inline] lock_acquire+0x1a8/0x720 kernel/locking/lockdep.c:5407 __raw_read_lock include/linux/rwlock_api_smp.h:149 [inline] _raw_read_lock+0x5b/0x70 kernel/locking/spinlock.c:223 kill_fasync_rcu fs/fcntl.c:1004 [inline] kill_fasync fs/fcntl.c:1025 [inline] kill_fasync+0xec/0x310 fs/fcntl.c:1018 snd_timer_user_ccallback+0x24d/0x300 sound/core/timer.c:1386 snd_timer_notify1+0x119/0x330 sound/core/timer.c:516 snd_timer_start1+0x3dd/0x6f0 sound/core/timer.c:577 snd_timer_start sound/core/timer.c:696 [inline] snd_timer_start sound/core/timer.c:689 [inline] snd_timer_user_start.isra.0+0x16d/0x1e0 sound/core/timer.c:1984 __snd_timer_user_ioctl.isra.0+0xb0b/0x1fc0 sound/core/timer.c:2107 snd_timer_user_ioctl+0x72/0xa0 sound/core/timer.c:2128 vfs_ioctl fs/ioctl.c:48 [inline] __do_sys_ioctl fs/ioctl.c:753 [inline] __se_sys_ioctl fs/ioctl.c:739 [inline] __x64_sys_ioctl+0x11f/0x190 fs/ioctl.c:739 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 } ... key at: [] __key.0+0x0/0x40 ... acquired at: mark_usage kernel/locking/lockdep.c:4312 [inline] __lock_acquire+0x11cb/0x57d0 kernel/locking/lockdep.c:4786 lock_acquire kernel/locking/lockdep.c:5442 [inline] lock_acquire+0x1a8/0x720 kernel/locking/lockdep.c:5407 __raw_read_lock include/linux/rwlock_api_smp.h:149 [inline] _raw_read_lock+0x5b/0x70 kernel/locking/spinlock.c:223 kill_fasync_rcu fs/fcntl.c:1004 [inline] kill_fasync fs/fcntl.c:1025 [inline] kill_fasync+0xec/0x310 fs/fcntl.c:1018 sock_wake_async+0xce/0x110 net/socket.c:1310 sk_wake_async include/net/sock.h:2286 [inline] sk_wake_async include/net/sock.h:2282 [inline] sock_def_readable+0x1cc/0x340 net/core/sock.c:2904 unix_dgram_sendmsg+0xcad/0x1710 net/unix/af_unix.c:1799 sock_sendmsg_nosec net/socket.c:652 [inline] sock_sendmsg+0xab/0xe0 net/socket.c:672 ____sys_sendmsg+0x392/0x7a0 net/socket.c:2345 ___sys_sendmsg+0xd3/0x150 net/socket.c:2399 __sys_sendmmsg+0x141/0x300 net/socket.c:2489 __do_sys_sendmmsg net/socket.c:2518 [inline] __se_sys_sendmmsg net/socket.c:2515 [inline] __x64_sys_sendmmsg+0x94/0x100 net/socket.c:2515 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 stack backtrace: CPU: 0 PID: 5880 Comm: syz-executor292 Not tainted 5.11.0-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:79 [inline] dump_stack+0x9a/0xcc lib/dump_stack.c:120 print_irq_inversion_bug kernel/locking/lockdep.c:4413 [inline] check_usage_backwards kernel/locking/lockdep.c:3884 [inline] mark_lock_irq kernel/locking/lockdep.c:3974 [inline] mark_lock.cold+0x6d/0x72 kernel/locking/lockdep.c:4411 mark_usage kernel/locking/lockdep.c:4312 [inline] __lock_acquire+0x11cb/0x57d0 kernel/locking/lockdep.c:4786 lock_acquire kernel/locking/lockdep.c:5442 [inline] lock_acquire+0x1a8/0x720 kernel/locking/lockdep.c:5407 __raw_read_lock include/linux/rwlock_api_smp.h:149 [inline] _raw_read_lock+0x5b/0x70 kernel/locking/spinlock.c:223 kill_fasync_rcu fs/fcntl.c:1004 [inline] kill_fasync fs/fcntl.c:1025 [inline] kill_fasync+0xec/0x310 fs/fcntl.c:1018 sock_wake_async+0xce/0x110 net/socket.c:1310 sk_wake_async include/net/sock.h:2286 [inline] sk_wake_async include/net/sock.h:2282 [inline] sock_def_readable+0x1cc/0x340 net/core/sock.c:2904 unix_dgram_sendmsg+0xcad/0x1710 net/unix/af_unix.c:1799 sock_sendmsg_nosec net/socket.c:652 [inline] sock_sendmsg+0xab/0xe0 net/socket.c:672 ____sys_sendmsg+0x392/0x7a0 net/socket.c:2345 ___sys_sendmsg+0xd3/0x150 net/socket.c:2399 __sys_sendmmsg+0x141/0x300 net/socket.c:2489 __do_sys_sendmmsg net/socket.c:2518 [inline] __se_sys_sendmmsg net/socket.c:2515 [inline] __x64_sys_sendmmsg+0x94/0x100 net/socket.c:2515 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x7fb40a1e6039 Code: 28 c3 e8 2a 14 00 00 66 2e 0f 1f 84 00 00 00 00 00 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 c0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffc770fcd88 EFLAGS: 00000246 ORIG_RAX: 0000000000000133 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fb40