======================================================== WARNING: possible irq lock inversion dependency detected 5.14.0-rc6-syzkaller #0 Not tainted -------------------------------------------------------- syz-executor.1/8456 just changed the state of lock: ffff888147f15908 (&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.1/8456. 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 lease_break_callback+0x22/0x30 fs/locks.c:585 __break_lease+0xe32/0x1970 fs/locks.c:1657 break_lease include/linux/fs.h:2668 [inline] do_dentry_open+0x722/0x1020 fs/open.c:817 do_open fs/namei.c:3374 [inline] path_openat+0x27e7/0x36b0 fs/namei.c:3507 do_filp_open+0x253/0x4d0 fs/namei.c:3534 do_sys_openat2+0x124/0x460 fs/open.c:1204 do_sys_open fs/open.c:1220 [inline] __do_sys_open fs/open.c:1228 [inline] __se_sys_open fs/open.c:1224 [inline] __x64_sys_open+0x221/0x270 fs/open.c:1224 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 lease_break_callback+0x22/0x30 fs/locks.c:585 __break_lease+0xe32/0x1970 fs/locks.c:1657 break_lease include/linux/fs.h:2668 [inline] do_dentry_open+0x722/0x1020 fs/open.c:817 do_open fs/namei.c:3374 [inline] path_openat+0x27e7/0x36b0 fs/namei.c:3507 do_filp_open+0x253/0x4d0 fs/namei.c:3534 do_sys_openat2+0x124/0x460 fs/open.c:1204 do_sys_open fs/open.c:1220 [inline] __do_sys_open fs/open.c:1228 [inline] __se_sys_open fs/open.c:1224 [inline] __x64_sys_open+0x221/0x270 fs/open.c:1224 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 lease_break_callback+0x22/0x30 fs/locks.c:585 __break_lease+0xe32/0x1970 fs/locks.c:1657 break_lease include/linux/fs.h:2668 [inline] do_dentry_open+0x722/0x1020 fs/open.c:817 do_open fs/namei.c:3374 [inline] path_openat+0x27e7/0x36b0 fs/namei.c:3507 do_filp_open+0x253/0x4d0 fs/namei.c:3534 do_sys_openat2+0x124/0x460 fs/open.c:1204 do_sys_open fs/open.c:1220 [inline] __do_sys_open fs/open.c:1228 [inline] __se_sys_open fs/open.c:1224 [inline] __x64_sys_open+0x221/0x270 fs/open.c:1224 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_start sound/core/pcm_native.c:1387 [inline] snd_pcm_action_single sound/core/pcm_native.c:1224 [inline] snd_pcm_action sound/core/pcm_native.c:1305 [inline] snd_pcm_action_lock_irq sound/core/pcm_native.c:1320 [inline] snd_pcm_start_lock_irq sound/core/pcm_native.c:1413 [inline] snd_pcm_kernel_ioctl+0xb7c/0x1380 sound/core/pcm_native.c:3358 snd_pcm_oss_set_trigger+0x96a/0xd00 sound/core/oss/pcm_oss.c:2123 snd_pcm_oss_poll+0x6a8/0x8f0 sound/core/oss/pcm_oss.c:2859 vfs_poll include/linux/poll.h:90 [inline] do_pollfd fs/select.c:869 [inline] do_poll fs/select.c:917 [inline] do_sys_poll+0xa5d/0x1450 fs/select.c:1011 __do_sys_ppoll fs/select.c:1117 [inline] __se_sys_ppoll+0x2bd/0x320 fs/select.c:1097 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_start sound/core/pcm_native.c:1387 [inline] snd_pcm_action_single sound/core/pcm_native.c:1224 [inline] snd_pcm_action sound/core/pcm_native.c:1305 [inline] snd_pcm_action_lock_irq sound/core/pcm_native.c:1320 [inline] snd_pcm_start_lock_irq sound/core/pcm_native.c:1413 [inline] snd_pcm_kernel_ioctl+0xb7c/0x1380 sound/core/pcm_native.c:3358 snd_pcm_oss_set_trigger+0x96a/0xd00 sound/core/oss/pcm_oss.c:2123 snd_pcm_oss_poll+0x6a8/0x8f0 sound/core/oss/pcm_oss.c:2859 vfs_poll include/linux/poll.h:90 [inline] do_pollfd fs/select.c:869 [inline] do_poll fs/select.c:917 [inline] do_sys_poll+0xa5d/0x1450 fs/select.c:1011 __do_sys_ppoll fs/select.c:1117 [inline] __se_sys_ppoll+0x2bd/0x320 fs/select.c:1097 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 -> (&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+0x91/0xb0 arch/x86/kernel/apic/apic.c:1100 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:638 finish_lock_switch+0xf0/0x1c0 kernel/sched/core.c:4436 finish_task_switch+0x140/0x630 kernel/sched/core.c:4553 context_switch kernel/sched/core.c:4684 [inline] __schedule+0xc0f/0x11f0 kernel/sched/core.c:5938 schedule+0x14b/0x210 kernel/sched/core.c:6017 freezable_schedule include/linux/freezer.h:172 [inline] do_nanosleep+0x1b6/0x7b0 kernel/time/hrtimer.c:1896 hrtimer_nanosleep+0x239/0x470 kernel/time/hrtimer.c:1949 __do_sys_clock_nanosleep kernel/time/posix-timers.c:1267 [inline] __se_sys_clock_nanosleep kernel/time/posix-timers.c:1245 [inline] __x64_sys_clock_nanosleep+0x344/0x3d0 kernel/time/posix-timers.c:1245 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_spin_lock_irq include/linux/spinlock_api_smp.h:128 [inline] _raw_spin_lock_irq+0xae/0xf0 kernel/locking/spinlock.c:167 snd_pcm_oss_poll+0x4b9/0x8f0 sound/core/oss/pcm_oss.c:2848 vfs_poll include/linux/poll.h:90 [inline] do_pollfd fs/select.c:869 [inline] do_poll fs/select.c:917 [inline] do_sys_poll+0xa5d/0x1450 fs/select.c:1011 __do_sys_ppoll fs/select.c:1117 [inline] __se_sys_ppoll+0x2bd/0x320 fs/select.c:1097 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_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+0x91/0xb0 arch/x86/kernel/apic/apic.c:1100 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:638 finish_lock_switch+0xf0/0x1c0 kernel/sched/core.c:4436 finish_task_switch+0x140/0x630 kernel/sched/core.c:4553 context_switch kernel/sched/core.c:4684 [inline] __schedule+0xc0f/0x11f0 kernel/sched/core.c:5938 schedule+0x14b/0x210 kernel/sched/core.c:6017 freezable_schedule include/linux/freezer.h:172 [inline] do_nanosleep+0x1b6/0x7b0 kernel/time/hrtimer.c:1896 hrtimer_nanosleep+0x239/0x470 kernel/time/hrtimer.c:1949 __do_sys_clock_nanosleep kernel/time/posix-timers.c:1267 [inline] __se_sys_clock_nanosleep kernel/time/posix-timers.c:1245 [inline] __x64_sys_clock_nanosleep+0x344/0x3d0 kernel/time/posix-timers.c:1245 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: 8456 Comm: syz-executor.1 Not tainted 5.14.0-rc6-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+0x91/0xb0 arch/x86/kernel/apic/apic.c:1100 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:638 RIP: 0010:finish_lock_switch+0xf0/0x1c0 kernel/sched/core.c:4436 Code: 61 0c 00 74 11 48 89 df be ff ff ff ff e8 08 13 80 08 85 c0 74 27 4d 85 ff 75 44 4c 89 f7 e8 87 bd 82 08 e8 82 40 2d 00 fb 5b <41> 5c 41 5d 41 5e 41 5f 5d c3 0f 0b 4d 85 ff 75 92 eb a8 0f 0b 4d RSP: 0018:ffffc900015cfa30 EFLAGS: 00000282 RAX: e749a83244582000 RBX: ffff8880271cb8b4 RCX: ffffffff9070b703 RDX: dffffc0000000000 RSI: 0000000000000001 RDI: 0000000000000000 RBP: 1ffff1101738a400 R08: ffffffff8186a4c0 R09: ffffed101738a2a9 R10: ffffed101738a2a9 R11: 0000000000000000 R12: ffff8880b9c52000 R13: dffffc0000000000 R14: ffff8880b9c51540 R15: 0000000000000000 finish_task_switch+0x140/0x630 kernel/sched/core.c:4553 context_switch kernel/sched/core.c:4684 [inline] __schedule+0xc0f/0x11f0 kernel/sched/core.c:5938 schedule+0x14b/0x210 kernel/sched/core.c:6017 freezable_schedule include/linux/freezer.h:172 [inline] do_nanosleep+0x1b6/0x7b0 kernel/time/hrtimer.c:1896 hrtimer_nanosleep+0x239/0x470 kernel/time/hrtimer.c:1949 __do_sys_clock_nanosleep kernel/time/posix-timers.c:1267 [inline] __se_sys_clock_nanosleep kernel/time/posix-timers.c:1245 [inline] __x64_sys_clock_nanosleep+0x344/0x3d0 kernel/time/posix-timers.c:1245 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:0x48a7b1 Code: 24 0c 89 3c 24 48 89 4c 24 18 e8 aa e7 ff ff 4c 8b 54 24 18 48 8b 54 24 10 41 89 c0 8b 74 24 0c 8b 3c 24 b8 e6 00 00 00 0f 05 <44> 89 c7 48 89 04 24 e8 e3 e7 ff ff 48 8b 04 24 eb 97 66 2e 0f 1f RSP: 002b:00007ffdd30d4670 EFLAGS: 00000293 ORIG_RAX: 00000000000000e6 RAX: ffffffffffffffda RBX: 00000000000003ea RCX: 000000000048a7b1 RDX: 00007ffdd30d46b0 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 00007ffdd30d474c R08: 0000000000000000 R09: 0000000000000010 R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000032 R13: 000000000005e820 R14: 0000000000000001 R15: 00007ffdd30d47b0 ---------------- Code disassembly (best guess), 1 bytes skipped: 0: 0c 00 or $0x0,%al 2: 74 11 je 0x15 4: 48 89 df mov %rbx,%rdi 7: be ff ff ff ff mov $0xffffffff,%esi c: e8 08 13 80 08 callq 0x8801319 11: 85 c0 test %eax,%eax 13: 74 27 je 0x3c 15: 4d 85 ff test %r15,%r15 18: 75 44 jne 0x5e 1a: 4c 89 f7 mov %r14,%rdi 1d: e8 87 bd 82 08 callq 0x882bda9 22: e8 82 40 2d 00 callq 0x2d40a9 27: fb sti 28: 5b pop %rbx 29: 41 5c pop %r12 <-- trapping instruction 2b: 41 5d pop %r13 2d: 41 5e pop %r14 2f: 41 5f pop %r15 31: 5d pop %rbp 32: c3 retq 33: 0f 0b ud2 35: 4d 85 ff test %r15,%r15 38: 75 92 jne 0xffffffcc 3a: eb a8 jmp 0xffffffe4 3c: 0f 0b ud2 3e: 4d rex.WRB