======================================================== WARNING: possible irq lock inversion dependency detected 5.6.0-syzkaller #0 Not tainted -------------------------------------------------------- swapper/1/0 just changed the state of lock: ffff8880a83f1cd8 (&ctx->ctx_lock){..-.}-{2:2}, at: spin_lock_irq include/linux/spinlock.h:378 [inline] ffff8880a83f1cd8 (&ctx->ctx_lock){..-.}-{2:2}, at: free_ioctx_users+0x30/0x1c0 fs/aio.c:618 but this lock took another, SOFTIRQ-unsafe lock in the past: (&pid->wait_pidfd){+.+.}-{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(&pid->wait_pidfd); local_irq_disable(); lock(&ctx->ctx_lock); lock(&pid->wait_pidfd); lock(&ctx->ctx_lock); *** DEADLOCK *** 2 locks held by swapper/1/0: #0: ffffffff892e6c20 (rcu_callback){....}-{0:0}, at: rcu_lock_acquire+0x0/0x30 lib/xarray.c:75 #1: ffffffff892e6bd0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x5/0x30 include/linux/rcupdate.h:207 the shortest dependencies between 2nd lock and 1st lock: -> (&pid->wait_pidfd){+.+.}-{2:2} { HARDIRQ-ON-W at: lock_acquire+0x169/0x480 kernel/locking/lockdep.c:4923 __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:353 [inline] proc_pid_make_inode+0x187/0x2d0 fs/proc/base.c:1880 proc_pid_instantiate+0x4b/0x1a0 fs/proc/base.c:3285 proc_pid_lookup+0x218/0x2f0 fs/proc/base.c:3320 proc_root_lookup+0x1b/0x50 fs/proc/root.c:243 __lookup_slow+0x240/0x370 fs/namei.c:1530 lookup_slow fs/namei.c:1547 [inline] walk_component+0x442/0x680 fs/namei.c:1846 link_path_walk+0x66d/0xba0 fs/namei.c:2165 path_openat+0x21d/0x38b0 fs/namei.c:3342 do_filp_open+0x191/0x3a0 fs/namei.c:3373 do_sys_openat2+0x463/0x770 fs/open.c:1148 do_sys_open fs/open.c:1164 [inline] ksys_open include/linux/syscalls.h:1386 [inline] __do_sys_open fs/open.c:1170 [inline] __se_sys_open fs/open.c:1168 [inline] __x64_sys_open+0x1af/0x1e0 fs/open.c:1168 do_syscall_64+0xf3/0x1b0 arch/x86/entry/common.c:295 entry_SYSCALL_64_after_hwframe+0x49/0xb3 SOFTIRQ-ON-W at: lock_acquire+0x169/0x480 kernel/locking/lockdep.c:4923 __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:353 [inline] proc_pid_make_inode+0x187/0x2d0 fs/proc/base.c:1880 proc_pid_instantiate+0x4b/0x1a0 fs/proc/base.c:3285 proc_pid_lookup+0x218/0x2f0 fs/proc/base.c:3320 proc_root_lookup+0x1b/0x50 fs/proc/root.c:243 __lookup_slow+0x240/0x370 fs/namei.c:1530 lookup_slow fs/namei.c:1547 [inline] walk_component+0x442/0x680 fs/namei.c:1846 link_path_walk+0x66d/0xba0 fs/namei.c:2165 path_openat+0x21d/0x38b0 fs/namei.c:3342 do_filp_open+0x191/0x3a0 fs/namei.c:3373 do_sys_openat2+0x463/0x770 fs/open.c:1148 do_sys_open fs/open.c:1164 [inline] ksys_open include/linux/syscalls.h:1386 [inline] __do_sys_open fs/open.c:1170 [inline] __se_sys_open fs/open.c:1168 [inline] __x64_sys_open+0x1af/0x1e0 fs/open.c:1168 do_syscall_64+0xf3/0x1b0 arch/x86/entry/common.c:295 entry_SYSCALL_64_after_hwframe+0x49/0xb3 INITIAL USE at: lock_acquire+0x169/0x480 kernel/locking/lockdep.c:4923 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x9e/0xc0 kernel/locking/spinlock.c:159 __wake_up_common_lock kernel/sched/wait.c:122 [inline] __wake_up+0xb8/0x150 kernel/sched/wait.c:142 do_notify_pidfd kernel/signal.c:1900 [inline] do_notify_parent+0x167/0xce0 kernel/signal.c:1927 exit_notify kernel/exit.c:660 [inline] do_exit+0x12c5/0x1f80 kernel/exit.c:816 call_usermodehelper_exec_async+0x47c/0x480 kernel/umh.c:125 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352 } ... key at: [] alloc_pid.__key+0x0/0x10 ... acquired at: lock_acquire+0x169/0x480 kernel/locking/lockdep.c:4923 __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:353 [inline] aio_poll fs/aio.c:1767 [inline] __io_submit_one fs/aio.c:1841 [inline] io_submit_one+0x10f5/0x1a80 fs/aio.c:1878 __do_sys_io_submit fs/aio.c:1937 [inline] __se_sys_io_submit+0x117/0x220 fs/aio.c:1907 do_syscall_64+0xf3/0x1b0 arch/x86/entry/common.c:295 entry_SYSCALL_64_after_hwframe+0x49/0xb3 -> (&ctx->ctx_lock){..-.}-{2:2} { IN-SOFTIRQ-W at: lock_acquire+0x169/0x480 kernel/locking/lockdep.c:4923 __raw_spin_lock_irq include/linux/spinlock_api_smp.h:128 [inline] _raw_spin_lock_irq+0x67/0x80 kernel/locking/spinlock.c:167 spin_lock_irq include/linux/spinlock.h:378 [inline] free_ioctx_users+0x30/0x1c0 fs/aio.c:618 percpu_ref_put_many include/linux/percpu-refcount.h:309 [inline] percpu_ref_put+0x18d/0x1a0 include/linux/percpu-refcount.h:325 rcu_do_batch kernel/rcu/tree.c:2206 [inline] rcu_core+0x816/0x1120 kernel/rcu/tree.c:2433 __do_softirq+0x268/0x80c kernel/softirq.c:292 invoke_softirq kernel/softirq.c:373 [inline] irq_exit+0x223/0x230 kernel/softirq.c:413 exiting_irq arch/x86/include/asm/apic.h:546 [inline] smp_apic_timer_interrupt+0x113/0x280 arch/x86/kernel/apic/apic.c:1140 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:829 native_safe_halt+0xe/0x10 arch/x86/include/asm/irqflags.h:60 arch_safe_halt arch/x86/include/asm/paravirt.h:144 [inline] default_idle+0x4c/0x70 arch/x86/kernel/process.c:697 cpuidle_idle_call kernel/sched/idle.c:154 [inline] do_idle+0x1ee/0x650 kernel/sched/idle.c:269 cpu_startup_entry+0x15/0x20 kernel/sched/idle.c:361 start_secondary+0x386/0x410 arch/x86/kernel/smpboot.c:268 secondary_startup_64+0xa4/0xb0 arch/x86/kernel/head_64.S:242 INITIAL USE at: lock_acquire+0x169/0x480 kernel/locking/lockdep.c:4923 __raw_spin_lock_irq include/linux/spinlock_api_smp.h:128 [inline] _raw_spin_lock_irq+0x67/0x80 kernel/locking/spinlock.c:167 spin_lock_irq include/linux/spinlock.h:378 [inline] aio_poll fs/aio.c:1765 [inline] __io_submit_one fs/aio.c:1841 [inline] io_submit_one+0x10cb/0x1a80 fs/aio.c:1878 __do_sys_io_submit fs/aio.c:1937 [inline] __se_sys_io_submit+0x117/0x220 fs/aio.c:1907 do_syscall_64+0xf3/0x1b0 arch/x86/entry/common.c:295 entry_SYSCALL_64_after_hwframe+0x49/0xb3 } ... key at: [] ioctx_alloc.__key+0x0/0x10 ... acquired at: mark_lock_irq kernel/locking/lockdep.c:3585 [inline] mark_lock+0x529/0x1b00 kernel/locking/lockdep.c:3935 mark_usage kernel/locking/lockdep.c:3834 [inline] __lock_acquire+0xaa7/0x2b90 kernel/locking/lockdep.c:4298 lock_acquire+0x169/0x480 kernel/locking/lockdep.c:4923 __raw_spin_lock_irq include/linux/spinlock_api_smp.h:128 [inline] _raw_spin_lock_irq+0x67/0x80 kernel/locking/spinlock.c:167 spin_lock_irq include/linux/spinlock.h:378 [inline] free_ioctx_users+0x30/0x1c0 fs/aio.c:618 percpu_ref_put_many include/linux/percpu-refcount.h:309 [inline] percpu_ref_put+0x18d/0x1a0 include/linux/percpu-refcount.h:325 rcu_do_batch kernel/rcu/tree.c:2206 [inline] rcu_core+0x816/0x1120 kernel/rcu/tree.c:2433 __do_softirq+0x268/0x80c kernel/softirq.c:292 invoke_softirq kernel/softirq.c:373 [inline] irq_exit+0x223/0x230 kernel/softirq.c:413 exiting_irq arch/x86/include/asm/apic.h:546 [inline] smp_apic_timer_interrupt+0x113/0x280 arch/x86/kernel/apic/apic.c:1140 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:829 native_safe_halt+0xe/0x10 arch/x86/include/asm/irqflags.h:60 arch_safe_halt arch/x86/include/asm/paravirt.h:144 [inline] default_idle+0x4c/0x70 arch/x86/kernel/process.c:697 cpuidle_idle_call kernel/sched/idle.c:154 [inline] do_idle+0x1ee/0x650 kernel/sched/idle.c:269 cpu_startup_entry+0x15/0x20 kernel/sched/idle.c:361 start_secondary+0x386/0x410 arch/x86/kernel/smpboot.c:268 secondary_startup_64+0xa4/0xb0 arch/x86/kernel/head_64.S:242 stack backtrace: CPU: 1 PID: 0 Comm: swapper/1 Not tainted 5.6.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:77 [inline] dump_stack+0x1e9/0x30e lib/dump_stack.c:118 print_irq_inversion_bug+0xb67/0xe90 kernel/locking/lockdep.c:3447 check_usage_forwards+0x13f/0x240 kernel/locking/lockdep.c:3472 mark_lock_irq kernel/locking/lockdep.c:3585 [inline] mark_lock+0x529/0x1b00 kernel/locking/lockdep.c:3935 mark_usage kernel/locking/lockdep.c:3834 [inline] __lock_acquire+0xaa7/0x2b90 kernel/locking/lockdep.c:4298 lock_acquire+0x169/0x480 kernel/locking/lockdep.c:4923 __raw_spin_lock_irq include/linux/spinlock_api_smp.h:128 [inline] _raw_spin_lock_irq+0x67/0x80 kernel/locking/spinlock.c:167 spin_lock_irq include/linux/spinlock.h:378 [inline] free_ioctx_users+0x30/0x1c0 fs/aio.c:618 percpu_ref_put_many include/linux/percpu-refcount.h:309 [inline] percpu_ref_put+0x18d/0x1a0 include/linux/percpu-refcount.h:325 rcu_do_batch kernel/rcu/tree.c:2206 [inline] rcu_core+0x816/0x1120 kernel/rcu/tree.c:2433 __do_softirq+0x268/0x80c kernel/softirq.c:292 invoke_softirq kernel/softirq.c:373 [inline] irq_exit+0x223/0x230 kernel/softirq.c:413 exiting_irq arch/x86/include/asm/apic.h:546 [inline] smp_apic_timer_interrupt+0x113/0x280 arch/x86/kernel/apic/apic.c:1140 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:829 RIP: 0010:native_safe_halt+0xe/0x10 arch/x86/include/asm/irqflags.h:61 Code: 80 e1 07 80 c1 03 38 c1 7c bc 48 89 df e8 4a 29 a7 f9 eb b2 cc cc cc cc cc cc cc cc e9 07 00 00 00 0f 00 2d 36 c3 58 00 fb f4 90 e9 07 00 00 00 0f 00 2d 26 c3 58 00 f4 c3 cc cc 41 56 53 65 RSP: 0018:ffffc90000d3fe60 EFLAGS: 00000282 ORIG_RAX: ffffffffffffff13 RAX: 1ffffffff1257409 RBX: ffff8880a9a3c340 RCX: dffffc0000000000 RDX: dffffc0000000000 RSI: 0000000000000000 RDI: ffff8880a9a3cba4 RBP: ffffffff896b9ee0 R08: ffffffff8178ec90 R09: ffffed1015347869 R10: ffffed1015347869 R11: 0000000000000000 R12: 1ffff11015347868 R13: dffffc0000000000 R14: 1ffffffff1257407 R15: 0000000000000001 arch_safe_halt arch/x86/include/asm/paravirt.h:144 [inline] default_idle+0x4c/0x70 arch/x86/kernel/process.c:697 cpuidle_idle_call kernel/sched/idle.c:154 [inline] do_idle+0x1ee/0x650 kernel/sched/idle.c:269 cpu_startup_entry+0x15/0x20 kernel/sched/idle.c:361 start_secondary+0x386/0x410 arch/x86/kernel/smpboot.c:268 secondary_startup_64+0xa4/0xb0 arch/x86/kernel/head_64.S:242