======================================================== WARNING: possible irq lock inversion dependency detected 5.6.0-syzkaller #0 Not tainted -------------------------------------------------------- swapper/0/0 just changed the state of lock: ffff888097305cd8 (&ctx->ctx_lock){..-.}-{2:2}, at: spin_lock_irq include/linux/spinlock.h:378 [inline] ffff888097305cd8 (&ctx->ctx_lock){..-.}-{2:2}, at: free_ioctx_users+0x2b/0x450 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/0/0: #0: ffffffff899bbaa0 (rcu_callback){....}-{0:0}, at: rcu_do_batch kernel/rcu/tree.c:2196 [inline] #0: ffffffff899bbaa0 (rcu_callback){....}-{0:0}, at: rcu_core+0x520/0x1370 kernel/rcu/tree.c:2433 #1: ffffffff899bbbc0 (rcu_read_lock){....}-{1:2}, at: percpu_ref_call_confirm_rcu lib/percpu-refcount.c:127 [inline] #1: ffffffff899bbbc0 (rcu_read_lock){....}-{1:2}, at: percpu_ref_switch_to_atomic_rcu+0x209/0x540 lib/percpu-refcount.c:166 the shortest dependencies between 2nd lock and 1st lock: -> (&pid->wait_pidfd){+.+.}-{2:2} { HARDIRQ-ON-W at: lock_acquire+0x1f2/0x8f0 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+0x1f9/0x3c0 fs/proc/base.c:1880 proc_pid_instantiate+0x51/0x150 fs/proc/base.c:3285 proc_pid_lookup+0x1da/0x340 fs/proc/base.c:3320 proc_root_lookup+0x20/0x60 fs/proc/root.c:243 __lookup_slow+0x256/0x490 fs/namei.c:1530 lookup_slow fs/namei.c:1547 [inline] walk_component+0x418/0x6a0 fs/namei.c:1846 link_path_walk.part.0+0x4f1/0xb50 fs/namei.c:2166 link_path_walk fs/namei.c:2098 [inline] path_openat+0x25a/0x27d0 fs/namei.c:3342 do_filp_open+0x192/0x260 fs/namei.c:3373 do_sys_openat2+0x585/0x7d0 fs/open.c:1148 do_sys_open+0xc3/0x140 fs/open.c:1164 do_syscall_64+0xf6/0x7d0 arch/x86/entry/common.c:295 entry_SYSCALL_64_after_hwframe+0x49/0xb3 SOFTIRQ-ON-W at: lock_acquire+0x1f2/0x8f0 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+0x1f9/0x3c0 fs/proc/base.c:1880 proc_pid_instantiate+0x51/0x150 fs/proc/base.c:3285 proc_pid_lookup+0x1da/0x340 fs/proc/base.c:3320 proc_root_lookup+0x20/0x60 fs/proc/root.c:243 __lookup_slow+0x256/0x490 fs/namei.c:1530 lookup_slow fs/namei.c:1547 [inline] walk_component+0x418/0x6a0 fs/namei.c:1846 link_path_walk.part.0+0x4f1/0xb50 fs/namei.c:2166 link_path_walk fs/namei.c:2098 [inline] path_openat+0x25a/0x27d0 fs/namei.c:3342 do_filp_open+0x192/0x260 fs/namei.c:3373 do_sys_openat2+0x585/0x7d0 fs/open.c:1148 do_sys_open+0xc3/0x140 fs/open.c:1164 do_syscall_64+0xf6/0x7d0 arch/x86/entry/common.c:295 entry_SYSCALL_64_after_hwframe+0x49/0xb3 INITIAL USE at: lock_acquire+0x1f2/0x8f0 kernel/locking/lockdep.c:4923 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x8c/0xbf kernel/locking/spinlock.c:159 __wake_up_common_lock+0xb4/0x130 kernel/sched/wait.c:122 do_notify_pidfd kernel/signal.c:1900 [inline] do_notify_parent+0x19e/0xe60 kernel/signal.c:1927 exit_notify kernel/exit.c:660 [inline] do_exit+0x238f/0x2dd0 kernel/exit.c:816 call_usermodehelper_exec_async+0x507/0x710 kernel/umh.c:125 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352 } ... key at: [] __key.53827+0x0/0x40 ... acquired at: __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+0xc1b/0x2ec0 fs/aio.c:1878 __do_sys_io_submit fs/aio.c:1937 [inline] __se_sys_io_submit fs/aio.c:1907 [inline] __x64_sys_io_submit+0x1bd/0x540 fs/aio.c:1907 do_syscall_64+0xf6/0x7d0 arch/x86/entry/common.c:295 entry_SYSCALL_64_after_hwframe+0x49/0xb3 -> (&ctx->ctx_lock){..-.}-{2:2} { IN-SOFTIRQ-W at: lock_acquire+0x1f2/0x8f0 kernel/locking/lockdep.c:4923 __raw_spin_lock_irq include/linux/spinlock_api_smp.h:128 [inline] _raw_spin_lock_irq+0x5b/0x80 kernel/locking/spinlock.c:167 spin_lock_irq include/linux/spinlock.h:378 [inline] free_ioctx_users+0x2b/0x450 fs/aio.c:618 percpu_ref_put_many include/linux/percpu-refcount.h:309 [inline] percpu_ref_put include/linux/percpu-refcount.h:325 [inline] percpu_ref_call_confirm_rcu lib/percpu-refcount.c:131 [inline] percpu_ref_switch_to_atomic_rcu+0x494/0x540 lib/percpu-refcount.c:166 rcu_do_batch kernel/rcu/tree.c:2206 [inline] rcu_core+0x59f/0x1370 kernel/rcu/tree.c:2433 __do_softirq+0x26c/0x9f7 kernel/softirq.c:292 invoke_softirq kernel/softirq.c:373 [inline] irq_exit+0x192/0x1d0 kernel/softirq.c:413 exiting_irq arch/x86/include/asm/apic.h:546 [inline] smp_apic_timer_interrupt+0x19e/0x600 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+0x49/0x350 arch/x86/kernel/process.c:697 cpuidle_idle_call kernel/sched/idle.c:154 [inline] do_idle+0x393/0x690 kernel/sched/idle.c:269 cpu_startup_entry+0x14/0x20 kernel/sched/idle.c:361 start_kernel+0x867/0x8a1 init/main.c:1004 secondary_startup_64+0xa4/0xb0 arch/x86/kernel/head_64.S:242 INITIAL USE at: lock_acquire+0x1f2/0x8f0 kernel/locking/lockdep.c:4923 __raw_spin_lock_irq include/linux/spinlock_api_smp.h:128 [inline] _raw_spin_lock_irq+0x5b/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+0xbd6/0x2ec0 fs/aio.c:1878 __do_sys_io_submit fs/aio.c:1937 [inline] __se_sys_io_submit fs/aio.c:1907 [inline] __x64_sys_io_submit+0x1bd/0x540 fs/aio.c:1907 do_syscall_64+0xf6/0x7d0 arch/x86/entry/common.c:295 entry_SYSCALL_64_after_hwframe+0x49/0xb3 } ... key at: [] __key.55303+0x0/0x40 ... acquired at: mark_lock_irq kernel/locking/lockdep.c:3585 [inline] mark_lock+0x624/0xf10 kernel/locking/lockdep.c:3935 mark_usage kernel/locking/lockdep.c:3834 [inline] __lock_acquire+0x1d28/0x4e00 kernel/locking/lockdep.c:4298 lock_acquire+0x1f2/0x8f0 kernel/locking/lockdep.c:4923 __raw_spin_lock_irq include/linux/spinlock_api_smp.h:128 [inline] _raw_spin_lock_irq+0x5b/0x80 kernel/locking/spinlock.c:167 spin_lock_irq include/linux/spinlock.h:378 [inline] free_ioctx_users+0x2b/0x450 fs/aio.c:618 percpu_ref_put_many include/linux/percpu-refcount.h:309 [inline] percpu_ref_put include/linux/percpu-refcount.h:325 [inline] percpu_ref_call_confirm_rcu lib/percpu-refcount.c:131 [inline] percpu_ref_switch_to_atomic_rcu+0x494/0x540 lib/percpu-refcount.c:166 rcu_do_batch kernel/rcu/tree.c:2206 [inline] rcu_core+0x59f/0x1370 kernel/rcu/tree.c:2433 __do_softirq+0x26c/0x9f7 kernel/softirq.c:292 invoke_softirq kernel/softirq.c:373 [inline] irq_exit+0x192/0x1d0 kernel/softirq.c:413 exiting_irq arch/x86/include/asm/apic.h:546 [inline] smp_apic_timer_interrupt+0x19e/0x600 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+0x49/0x350 arch/x86/kernel/process.c:697 cpuidle_idle_call kernel/sched/idle.c:154 [inline] do_idle+0x393/0x690 kernel/sched/idle.c:269 cpu_startup_entry+0x14/0x20 kernel/sched/idle.c:361 start_kernel+0x867/0x8a1 init/main.c:1004 secondary_startup_64+0xa4/0xb0 arch/x86/kernel/head_64.S:242 stack backtrace: CPU: 0 PID: 0 Comm: swapper/0 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+0x188/0x20d lib/dump_stack.c:118 print_irq_inversion_bug kernel/locking/lockdep.c:3448 [inline] check_usage_forwards.cold+0x20/0x29 kernel/locking/lockdep.c:3472 mark_lock_irq kernel/locking/lockdep.c:3585 [inline] mark_lock+0x624/0xf10 kernel/locking/lockdep.c:3935 mark_usage kernel/locking/lockdep.c:3834 [inline] __lock_acquire+0x1d28/0x4e00 kernel/locking/lockdep.c:4298 lock_acquire+0x1f2/0x8f0 kernel/locking/lockdep.c:4923 __raw_spin_lock_irq include/linux/spinlock_api_smp.h:128 [inline] _raw_spin_lock_irq+0x5b/0x80 kernel/locking/spinlock.c:167 spin_lock_irq include/linux/spinlock.h:378 [inline] free_ioctx_users+0x2b/0x450 fs/aio.c:618 percpu_ref_put_many include/linux/percpu-refcount.h:309 [inline] percpu_ref_put include/linux/percpu-refcount.h:325 [inline] percpu_ref_call_confirm_rcu lib/percpu-refcount.c:131 [inline] percpu_ref_switch_to_atomic_rcu+0x494/0x540 lib/percpu-refcount.c:166 rcu_do_batch kernel/rcu/tree.c:2206 [inline] rcu_core+0x59f/0x1370 kernel/rcu/tree.c:2433 __do_softirq+0x26c/0x9f7 kernel/softirq.c:292 invoke_softirq kernel/softirq.c:373 [inline] irq_exit+0x192/0x1d0 kernel/softirq.c:413 exiting_irq arch/x86/include/asm/apic.h:546 [inline] smp_apic_timer_interrupt+0x19e/0x600 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: cc cc cc cc cc cc cc cc cc cc cc cc e9 07 00 00 00 0f 00 2d d4 f2 59 00 f4 c3 66 90 e9 07 00 00 00 0f 00 2d c4 f2 59 00 fb f4 cc 41 56 41 55 41 54 55 53 e8 33 77 92 f9 e8 3e b3 ca fb 0f 1f RSP: 0018:ffffffff89807d98 EFLAGS: 00000286 ORIG_RAX: ffffffffffffff13 RAX: 1ffffffff132925f RBX: ffffffff898864c0 RCX: 0000000000000000 RDX: dffffc0000000000 RSI: 0000000000000006 RDI: ffffffff89886d84 RBP: dffffc0000000000 R08: ffffffff898864c0 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: fffffbfff1310c98 R13: 0000000000000000 R14: ffffffff8a88e980 R15: 0000000000000000 arch_safe_halt arch/x86/include/asm/paravirt.h:144 [inline] default_idle+0x49/0x350 arch/x86/kernel/process.c:697 cpuidle_idle_call kernel/sched/idle.c:154 [inline] do_idle+0x393/0x690 kernel/sched/idle.c:269 cpu_startup_entry+0x14/0x20 kernel/sched/idle.c:361 start_kernel+0x867/0x8a1 init/main.c:1004 secondary_startup_64+0xa4/0xb0 arch/x86/kernel/head_64.S:242