===================================================== WARNING: HARDIRQ-safe -> HARDIRQ-unsafe lock order detected 5.14.0-rc2-syzkaller #0 Not tainted ----------------------------------------------------- syz-executor476/8421 [HC0[0]:SC0[0]:HE0:SE1] is trying to acquire: ffff88802083a138 (&f->f_owner.lock){.+.+}-{2:2}, at: send_sigio+0x2f/0x300 fs/fcntl.c:795 and this task is already holding: ffff88803700d018 (&new->fa_lock){....}-{2:2}, at: kill_fasync_rcu fs/fcntl.c:1012 [inline] ffff88803700d018 (&new->fa_lock){....}-{2:2}, at: kill_fasync+0x13b/0x430 fs/fcntl.c:1033 which would create a new lock dependency: (&new->fa_lock){....}-{2:2} -> (&f->f_owner.lock){.+.+}-{2:2} but this new dependency connects a HARDIRQ-irq-safe lock: (&timer->lock){-...}-{2:2} ... which became HARDIRQ-irq-safe at: lock_acquire+0x182/0x4a0 kernel/locking/lockdep.c:5625 __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+0x51/0x360 sound/core/hrtimer.c:38 __run_hrtimer kernel/time/hrtimer.c:1537 [inline] __hrtimer_run_queues+0x50b/0xa60 kernel/time/hrtimer.c:1601 hrtimer_interrupt+0x3b3/0x1040 kernel/time/hrtimer.c:1663 local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1089 [inline] __sysvec_apic_timer_interrupt+0xf9/0x270 arch/x86/kernel/apic/apic.c:1106 sysvec_apic_timer_interrupt+0x3e/0xb0 arch/x86/kernel/apic/apic.c:1100 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:638 to a HARDIRQ-irq-unsafe lock: (&f->f_owner.lock){.+.+}-{2:2} ... which became HARDIRQ-irq-unsafe 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 f_getown+0x22/0x210 fs/fcntl.c:153 do_fcntl+0x1a8/0x1510 fs/fcntl.c:388 __do_sys_fcntl fs/fcntl.c:471 [inline] __se_sys_fcntl+0xd8/0x1b0 fs/fcntl.c:456 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 other info that might help us debug this: Chain exists of: &timer->lock --> &new->fa_lock --> &f->f_owner.lock Possible interrupt unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&f->f_owner.lock); local_irq_disable(); lock(&timer->lock); lock(&new->fa_lock); lock(&timer->lock); *** DEADLOCK *** 4 locks held by syz-executor476/8421: #0: ffff888037105d68 (&tu->ioctl_lock){+.+.}-{3:3}, at: snd_timer_user_ioctl+0x4d/0x80 sound/core/timer.c:2128 #1: ffff8880283e2948 (&timer->lock){-...}-{2:2}, at: snd_timer_start1+0x5b/0x640 sound/core/timer.c:541 #2: ffffffff8c7177c0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x5/0x30 include/linux/rcupdate.h:266 #3: ffff88803700d018 (&new->fa_lock){....}-{2:2}, at: kill_fasync_rcu fs/fcntl.c:1012 [inline] #3: ffff88803700d018 (&new->fa_lock){....}-{2:2}, at: kill_fasync+0x13b/0x430 fs/fcntl.c:1033 the dependencies between HARDIRQ-irq-safe lock and the holding lock: -> (&timer->lock){-...}-{2:2} { IN-HARDIRQ-W at: lock_acquire+0x182/0x4a0 kernel/locking/lockdep.c:5625 __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+0x51/0x360 sound/core/hrtimer.c:38 __run_hrtimer kernel/time/hrtimer.c:1537 [inline] __hrtimer_run_queues+0x50b/0xa60 kernel/time/hrtimer.c:1601 hrtimer_interrupt+0x3b3/0x1040 kernel/time/hrtimer.c:1663 local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1089 [inline] __sysvec_apic_timer_interrupt+0xf9/0x270 arch/x86/kernel/apic/apic.c:1106 sysvec_apic_timer_interrupt+0x3e/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_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xb3/0x100 kernel/locking/spinlock.c:159 snd_timer_resolution+0x4d/0xe0 sound/core/timer.c:489 initialize_timer sound/core/seq/seq_timer.c:373 [inline] seq_timer_start sound/core/seq/seq_timer.c:391 [inline] snd_seq_timer_start+0x298/0x4e0 sound/core/seq/seq_timer.c:405 snd_seq_queue_process_event sound/core/seq/seq_queue.c:650 [inline] snd_seq_control_queue+0x323/0x19d0 sound/core/seq/seq_queue.c:711 snd_seq_deliver_single_event+0x550/0xcc0 sound/core/seq/seq_clientmgr.c:640 snd_seq_deliver_event+0x233/0x950 sound/core/seq/seq_clientmgr.c:841 snd_seq_kernel_client_dispatch+0x1f6/0x2f0 sound/core/seq/seq_clientmgr.c:2339 send_timer_event sound/core/seq/oss/seq_oss_timer.c:140 [inline] snd_seq_oss_timer_start+0x48a/0x8d0 sound/core/seq/oss/seq_oss_timer.c:161 insert_queue sound/core/seq/oss/seq_oss_rw.c:167 [inline] snd_seq_oss_write+0x4f6/0xba0 sound/core/seq/oss/seq_oss_rw.c:135 odev_write+0x5a/0x80 sound/core/seq/oss/seq_oss.c:168 vfs_write+0x289/0xc90 fs/read_write.c:603 ksys_write+0x171/0x2a0 fs/read_write.c:658 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 -> (&new->fa_lock){....}-{2:2} { 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 the dependencies between the lock to be acquired and HARDIRQ-irq-unsafe lock: -> (&f->f_owner.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 f_getown+0x22/0x210 fs/fcntl.c:153 do_fcntl+0x1a8/0x1510 fs/fcntl.c:388 __do_sys_fcntl fs/fcntl.c:471 [inline] __se_sys_fcntl+0xd8/0x1b0 fs/fcntl.c:456 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 f_getown+0x22/0x210 fs/fcntl.c:153 do_fcntl+0x1a8/0x1510 fs/fcntl.c:388 __do_sys_fcntl fs/fcntl.c:471 [inline] __se_sys_fcntl+0xd8/0x1b0 fs/fcntl.c:456 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 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 f_getown+0x22/0x210 fs/fcntl.c:153 do_fcntl+0x1a8/0x1510 fs/fcntl.c:388 __do_sys_fcntl fs/fcntl.c:471 [inline] __se_sys_fcntl+0xd8/0x1b0 fs/fcntl.c:456 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: [] __alloc_file.__key+0x0/0x10 ... acquired at: lock_acquire+0x182/0x4a0 kernel/locking/lockdep.c:5625 __raw_read_lock_irqsave include/linux/rwlock_api_smp.h:159 [inline] _raw_read_lock_irqsave+0xbb/0x100 kernel/locking/spinlock.c:231 send_sigio+0x2f/0x300 fs/fcntl.c:795 kill_fasync_rcu fs/fcntl.c:1019 [inline] kill_fasync+0x1e3/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 stack backtrace: CPU: 0 PID: 8421 Comm: syz-executor476 Not tainted 5.14.0-rc2-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_bad_irq_dependency kernel/locking/lockdep.c:2565 [inline] check_irq_usage kernel/locking/lockdep.c:2804 [inline] check_prev_add kernel/locking/lockdep.c:3055 [inline] check_prevs_add+0x4eaa/0x5b30 kernel/locking/lockdep.c:3174 validate_chain kernel/locking/lockdep.c:3789 [inline] __lock_acquire+0x4476/0x6100 kernel/locking/lockdep.c:5015 lock_acquire+0x182/0x4a0 kernel/locking/lockdep.c:5625 __raw_read_lock_irqsave include/linux/rwlock_api_smp.h:159 [inline] _raw_read_lock_irqsave+0xbb/0x100 kernel/locking/spinlock.c:231 send_sigio+0x2f/0x300 fs/fcntl.c:795 kill_fasync_rcu fs/fcntl.c:1019 [inline] kill_fasync+0x1e3/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 RIP: 0033:0x43fbd9 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:00007ffca846a608 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 0000000000400488 RCX: 00000