======================================================== WARNING: possible irq lock inversion dependency detected 5.3.0+ #0 Not tainted -------------------------------------------------------- syz-executor.3/8900 just changed the state of lock: ffff888059195b58 (&(&ctx->ctx_lock)->rlock){..-.}, at: spin_lock_irq include/linux/spinlock.h:363 [inline] ffff888059195b58 (&(&ctx->ctx_lock)->rlock){..-.}, at: free_ioctx_users+0x2d/0x490 fs/aio.c:618 but this lock took another, SOFTIRQ-unsafe lock in the past: (&fiq->waitq){+.+.} 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(&fiq->waitq); local_irq_disable(); lock(&(&ctx->ctx_lock)->rlock); lock(&fiq->waitq); lock(&(&ctx->ctx_lock)->rlock); *** DEADLOCK *** 3 locks held by syz-executor.3/8900: #0: ffff8880870127d0 (&mm->mmap_sem#2){++++}, at: process_vm_rw_single_vec mm/process_vm_access.c:108 [inline] #0: ffff8880870127d0 (&mm->mmap_sem#2){++++}, at: process_vm_rw_core.isra.0+0x420/0xb10 mm/process_vm_access.c:216 #1: ffffffff88fab240 (rcu_callback){....}, at: __rcu_reclaim kernel/rcu/rcu.h:210 [inline] #1: ffffffff88fab240 (rcu_callback){....}, at: rcu_do_batch kernel/rcu/tree.c:2157 [inline] #1: ffffffff88fab240 (rcu_callback){....}, at: rcu_core+0x60e/0x1560 kernel/rcu/tree.c:2377 #2: ffffffff88fab280 (rcu_read_lock_sched){....}, at: percpu_ref_call_confirm_rcu lib/percpu-refcount.c:126 [inline] #2: ffffffff88fab280 (rcu_read_lock_sched){....}, at: percpu_ref_switch_to_atomic_rcu+0x20e/0x570 lib/percpu-refcount.c:165 the shortest dependencies between 2nd lock and 1st lock: -> (&fiq->waitq){+.+.} { HARDIRQ-ON-W at: lock_acquire+0x190/0x410 kernel/locking/lockdep.c:4487 __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline] _raw_spin_lock+0x2f/0x40 kernel/locking/spinlock.c:151 spin_lock include/linux/spinlock.h:338 [inline] flush_bg_queue+0x1f3/0x3c0 fs/fuse/dev.c:415 fuse_request_queue_background+0x2f8/0x5a0 fs/fuse/dev.c:676 fuse_request_send_background+0x58/0x110 fs/fuse/dev.c:687 cuse_send_init fs/fuse/cuse.c:459 [inline] cuse_channel_open+0x5ba/0x830 fs/fuse/cuse.c:519 misc_open+0x395/0x4c0 drivers/char/misc.c:141 chrdev_open+0x245/0x6b0 fs/char_dev.c:414 do_dentry_open+0x4df/0x1250 fs/open.c:797 vfs_open+0xa0/0xd0 fs/open.c:906 do_last fs/namei.c:3408 [inline] path_openat+0x10e9/0x4630 fs/namei.c:3525 do_filp_open+0x1a1/0x280 fs/namei.c:3555 do_sys_open+0x3fe/0x5d0 fs/open.c:1089 __do_sys_openat fs/open.c:1116 [inline] __se_sys_openat fs/open.c:1110 [inline] __x64_sys_openat+0x9d/0x100 fs/open.c:1110 do_syscall_64+0xfa/0x760 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe SOFTIRQ-ON-W at: lock_acquire+0x190/0x410 kernel/locking/lockdep.c:4487 __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline] _raw_spin_lock+0x2f/0x40 kernel/locking/spinlock.c:151 spin_lock include/linux/spinlock.h:338 [inline] flush_bg_queue+0x1f3/0x3c0 fs/fuse/dev.c:415 fuse_request_queue_background+0x2f8/0x5a0 fs/fuse/dev.c:676 fuse_request_send_background+0x58/0x110 fs/fuse/dev.c:687 cuse_send_init fs/fuse/cuse.c:459 [inline] cuse_channel_open+0x5ba/0x830 fs/fuse/cuse.c:519 misc_open+0x395/0x4c0 drivers/char/misc.c:141 chrdev_open+0x245/0x6b0 fs/char_dev.c:414 do_dentry_open+0x4df/0x1250 fs/open.c:797 vfs_open+0xa0/0xd0 fs/open.c:906 do_last fs/namei.c:3408 [inline] path_openat+0x10e9/0x4630 fs/namei.c:3525 do_filp_open+0x1a1/0x280 fs/namei.c:3555 do_sys_open+0x3fe/0x5d0 fs/open.c:1089 __do_sys_openat fs/open.c:1116 [inline] __se_sys_openat fs/open.c:1110 [inline] __x64_sys_openat+0x9d/0x100 fs/open.c:1110 do_syscall_64+0xfa/0x760 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe INITIAL USE at: lock_acquire+0x190/0x410 kernel/locking/lockdep.c:4487 __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline] _raw_spin_lock+0x2f/0x40 kernel/locking/spinlock.c:151 spin_lock include/linux/spinlock.h:338 [inline] flush_bg_queue+0x1f3/0x3c0 fs/fuse/dev.c:415 fuse_request_queue_background+0x2f8/0x5a0 fs/fuse/dev.c:676 fuse_request_send_background+0x58/0x110 fs/fuse/dev.c:687 cuse_send_init fs/fuse/cuse.c:459 [inline] cuse_channel_open+0x5ba/0x830 fs/fuse/cuse.c:519 misc_open+0x395/0x4c0 drivers/char/misc.c:141 chrdev_open+0x245/0x6b0 fs/char_dev.c:414 do_dentry_open+0x4df/0x1250 fs/open.c:797 vfs_open+0xa0/0xd0 fs/open.c:906 do_last fs/namei.c:3408 [inline] path_openat+0x10e9/0x4630 fs/namei.c:3525 do_filp_open+0x1a1/0x280 fs/namei.c:3555 do_sys_open+0x3fe/0x5d0 fs/open.c:1089 __do_sys_openat fs/open.c:1116 [inline] __se_sys_openat fs/open.c:1110 [inline] __x64_sys_openat+0x9d/0x100 fs/open.c:1110 do_syscall_64+0xfa/0x760 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe } ... key at: [] __key.44671+0x0/0x40 ... acquired at: __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline] _raw_spin_lock+0x2f/0x40 kernel/locking/spinlock.c:151 spin_lock include/linux/spinlock.h:338 [inline] aio_poll fs/aio.c:1751 [inline] __io_submit_one fs/aio.c:1825 [inline] io_submit_one+0xefa/0x2ef0 fs/aio.c:1862 __do_sys_io_submit fs/aio.c:1921 [inline] __se_sys_io_submit fs/aio.c:1891 [inline] __x64_sys_io_submit+0x1bd/0x570 fs/aio.c:1891 do_syscall_64+0xfa/0x760 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe -> (&(&ctx->ctx_lock)->rlock){..-.} { IN-SOFTIRQ-W at: lock_acquire+0x190/0x410 kernel/locking/lockdep.c:4487 __raw_spin_lock_irq include/linux/spinlock_api_smp.h:128 [inline] _raw_spin_lock_irq+0x60/0x80 kernel/locking/spinlock.c:167 spin_lock_irq include/linux/spinlock.h:363 [inline] free_ioctx_users+0x2d/0x490 fs/aio.c:618 percpu_ref_put_many include/linux/percpu-refcount.h:293 [inline] percpu_ref_put include/linux/percpu-refcount.h:309 [inline] percpu_ref_call_confirm_rcu lib/percpu-refcount.c:130 [inline] percpu_ref_switch_to_atomic_rcu+0x4c0/0x570 lib/percpu-refcount.c:165 __rcu_reclaim kernel/rcu/rcu.h:222 [inline] rcu_do_batch kernel/rcu/tree.c:2157 [inline] rcu_core+0x581/0x1560 kernel/rcu/tree.c:2377 rcu_core_si+0x9/0x10 kernel/rcu/tree.c:2386 __do_softirq+0x262/0x98c kernel/softirq.c:292 invoke_softirq kernel/softirq.c:373 [inline] irq_exit+0x19b/0x1e0 kernel/softirq.c:413 exiting_irq arch/x86/include/asm/apic.h:536 [inline] smp_apic_timer_interrupt+0x1a3/0x610 arch/x86/kernel/apic/apic.c:1137 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:830 __preempt_count_add arch/x86/include/asm/preempt.h:79 [inline] preempt_count_add+0x44/0x160 kernel/sched/core.c:3781 rcu_lockdep_current_cpu_online kernel/rcu/tree.c:948 [inline] rcu_lockdep_current_cpu_online+0x34/0x130 kernel/rcu/tree.c:940 rcu_read_lock_held_common kernel/rcu/update.c:109 [inline] rcu_read_lock_held_common+0xbd/0x130 kernel/rcu/update.c:99 rcu_read_lock_sched_held+0x5b/0xd0 kernel/rcu/update.c:120 trace_mm_page_alloc include/trace/events/kmem.h:192 [inline] __alloc_pages_nodemask+0x649/0x8f0 mm/page_alloc.c:4743 alloc_pages_vma+0x1bc/0x3f0 mm/mempolicy.c:2115 do_huge_pmd_wp_page_fallback+0x1f0/0x1740 mm/huge_memory.c:1213 do_huge_pmd_wp_page+0x13b4/0x2430 mm/huge_memory.c:1374 wp_huge_pmd mm/memory.c:3745 [inline] __handle_mm_fault+0x1cea/0x4040 mm/memory.c:3958 handle_mm_fault+0x3b7/0xa80 mm/memory.c:4005 faultin_page mm/gup.c:651 [inline] __get_user_pages+0x7d4/0x1b30 mm/gup.c:854 __get_user_pages_locked mm/gup.c:1030 [inline] get_user_pages_remote+0x234/0x4b0 mm/gup.c:1170 process_vm_rw_single_vec mm/process_vm_access.c:109 [inline] process_vm_rw_core.isra.0+0x464/0xb10 mm/process_vm_access.c:216 process_vm_rw+0x21f/0x240 mm/process_vm_access.c:284 __do_sys_process_vm_writev mm/process_vm_access.c:306 [inline] __se_sys_process_vm_writev mm/process_vm_access.c:301 [inline] __x64_sys_process_vm_writev+0xe3/0x1a0 mm/process_vm_access.c:301 do_syscall_64+0xfa/0x760 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe INITIAL USE at: lock_acquire+0x190/0x410 kernel/locking/lockdep.c:4487 __raw_spin_lock_irq include/linux/spinlock_api_smp.h:128 [inline] _raw_spin_lock_irq+0x60/0x80 kernel/locking/spinlock.c:167 spin_lock_irq include/linux/spinlock.h:363 [inline] aio_poll fs/aio.c:1749 [inline] __io_submit_one fs/aio.c:1825 [inline] io_submit_one+0xeb5/0x2ef0 fs/aio.c:1862 __do_sys_io_submit fs/aio.c:1921 [inline] __se_sys_io_submit fs/aio.c:1891 [inline] __x64_sys_io_submit+0x1bd/0x570 fs/aio.c:1891 do_syscall_64+0xfa/0x760 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe } ... key at: [] __key.54288+0x0/0x40 ... acquired at: mark_lock_irq kernel/locking/lockdep.c:3317 [inline] mark_lock+0x517/0x1220 kernel/locking/lockdep.c:3666 mark_usage kernel/locking/lockdep.c:3566 [inline] __lock_acquire+0x1eaf/0x4e70 kernel/locking/lockdep.c:3909 lock_acquire+0x190/0x410 kernel/locking/lockdep.c:4487 __raw_spin_lock_irq include/linux/spinlock_api_smp.h:128 [inline] _raw_spin_lock_irq+0x60/0x80 kernel/locking/spinlock.c:167 spin_lock_irq include/linux/spinlock.h:363 [inline] free_ioctx_users+0x2d/0x490 fs/aio.c:618 percpu_ref_put_many include/linux/percpu-refcount.h:293 [inline] percpu_ref_put include/linux/percpu-refcount.h:309 [inline] percpu_ref_call_confirm_rcu lib/percpu-refcount.c:130 [inline] percpu_ref_switch_to_atomic_rcu+0x4c0/0x570 lib/percpu-refcount.c:165 __rcu_reclaim kernel/rcu/rcu.h:222 [inline] rcu_do_batch kernel/rcu/tree.c:2157 [inline] rcu_core+0x581/0x1560 kernel/rcu/tree.c:2377 rcu_core_si+0x9/0x10 kernel/rcu/tree.c:2386 __do_softirq+0x262/0x98c kernel/softirq.c:292 invoke_softirq kernel/softirq.c:373 [inline] irq_exit+0x19b/0x1e0 kernel/softirq.c:413 exiting_irq arch/x86/include/asm/apic.h:536 [inline] smp_apic_timer_interrupt+0x1a3/0x610 arch/x86/kernel/apic/apic.c:1137 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:830 __preempt_count_add arch/x86/include/asm/preempt.h:79 [inline] preempt_count_add+0x44/0x160 kernel/sched/core.c:3781 rcu_lockdep_current_cpu_online kernel/rcu/tree.c:948 [inline] rcu_lockdep_current_cpu_online+0x34/0x130 kernel/rcu/tree.c:940 rcu_read_lock_held_common kernel/rcu/update.c:109 [inline] rcu_read_lock_held_common+0xbd/0x130 kernel/rcu/update.c:99 rcu_read_lock_sched_held+0x5b/0xd0 kernel/rcu/update.c:120 trace_mm_page_alloc include/trace/events/kmem.h:192 [inline] __alloc_pages_nodemask+0x649/0x8f0 mm/page_alloc.c:4743 alloc_pages_vma+0x1bc/0x3f0 mm/mempolicy.c:2115 do_huge_pmd_wp_page_fallback+0x1f0/0x1740 mm/huge_memory.c:1213 do_huge_pmd_wp_page+0x13b4/0x2430 mm/huge_memory.c:1374 wp_huge_pmd mm/memory.c:3745 [inline] __handle_mm_fault+0x1cea/0x4040 mm/memory.c:3958 handle_mm_fault+0x3b7/0xa80 mm/memory.c:4005 faultin_page mm/gup.c:651 [inline] __get_user_pages+0x7d4/0x1b30 mm/gup.c:854 __get_user_pages_locked mm/gup.c:1030 [inline] get_user_pages_remote+0x234/0x4b0 mm/gup.c:1170 process_vm_rw_single_vec mm/process_vm_access.c:109 [inline] process_vm_rw_core.isra.0+0x464/0xb10 mm/process_vm_access.c:216 process_vm_rw+0x21f/0x240 mm/process_vm_access.c:284 __do_sys_process_vm_writev mm/process_vm_access.c:306 [inline] __se_sys_process_vm_writev mm/process_vm_access.c:301 [inline] __x64_sys_process_vm_writev+0xe3/0x1a0 mm/process_vm_access.c:301 do_syscall_64+0xfa/0x760 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe stack backtrace: CPU: 0 PID: 8900 Comm: syz-executor.3 Not tainted 5.3.0+ #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+0x172/0x1f0 lib/dump_stack.c:113 print_irq_inversion_bug.part.0+0x2e4/0x2f1 kernel/locking/lockdep.c:3179 print_irq_inversion_bug kernel/locking/lockdep.c:3180 [inline] check_usage_forwards.cold+0x20/0x29 kernel/locking/lockdep.c:3204 mark_lock_irq kernel/locking/lockdep.c:3317 [inline] mark_lock+0x517/0x1220 kernel/locking/lockdep.c:3666 mark_usage kernel/locking/lockdep.c:3566 [inline] __lock_acquire+0x1eaf/0x4e70 kernel/locking/lockdep.c:3909 lock_acquire+0x190/0x410 kernel/locking/lockdep.c:4487 __raw_spin_lock_irq include/linux/spinlock_api_smp.h:128 [inline] _raw_spin_lock_irq+0x60/0x80 kernel/locking/spinlock.c:167 spin_lock_irq include/linux/spinlock.h:363 [inline] free_ioctx_users+0x2d/0x490 fs/aio.c:618 percpu_ref_put_many include/linux/percpu-refcount.h:293 [inline] percpu_ref_put include/linux/percpu-refcount.h:309 [inline] percpu_ref_call_confirm_rcu lib/percpu-refcount.c:130 [inline] percpu_ref_switch_to_atomic_rcu+0x4c0/0x570 lib/percpu-refcount.c:165 __rcu_reclaim kernel/rcu/rcu.h:222 [inline] rcu_do_batch kernel/rcu/tree.c:2157 [inline] rcu_core+0x581/0x1560 kernel/rcu/tree.c:2377 rcu_core_si+0x9/0x10 kernel/rcu/tree.c:2386 __do_softirq+0x262/0x98c kernel/softirq.c:292 invoke_softirq kernel/softirq.c:373 [inline] irq_exit+0x19b/0x1e0 kernel/softirq.c:413 exiting_irq arch/x86/include/asm/apic.h:536 [inline] smp_apic_timer_interrupt+0x1a3/0x610 arch/x86/kernel/apic/apic.c:1137 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:830 RIP: 0010:preempt_count_add+0x44/0x160 kernel/sched/core.c:3786 Code: 83 e0 07 48 c1 e9 03 53 83 c0 03 89 fb 0f b6 14 11 38 d0 7c 08 84 d2 0f 85 00 01 00 00 8b 15 33 b1 5f 09 65 01 1d 54 fe b2 7e <85> d2 75 11 65 8b 05 49 fe b2 7e 0f b6 c0 3d f4 00 00 00 7f 7f 65 RSP: 0018:ffff88805a0971c0 EFLAGS: 00000282 ORIG_RAX: ffffffffffffff13 RAX: 0000000000000003 RBX: 0000000000000001 RCX: 1ffffffff155d61c RDX: 0000000000000000 RSI: 0000000000000004 RDI: 0000000000000001 RBP: ffff88805a0971d0 R08: 1ffff11015d06ad4 R09: ffffed1015d06ad5 R10: ffffed1015d06ad4 R11: ffff8880ae8356a3 R12: 0000000000000000 R13: ffffea0001f15c80 R14: 0000000000100cca R15: ffff88805a097368 rcu_lockdep_current_cpu_online kernel/rcu/tree.c:948 [inline] rcu_lockdep_current_cpu_online+0x34/0x130 kernel/rcu/tree.c:940 rcu_read_lock_held_common kernel/rcu/update.c:109 [inline] rcu_read_lock_held_common+0xbd/0x130 kernel/rcu/update.c:99 rcu_read_lock_sched_held+0x5b/0xd0 kernel/rcu/update.c:120 trace_mm_page_alloc include/trace/events/kmem.h:192 [inline] __alloc_pages_nodemask+0x649/0x8f0 mm/page_alloc.c:4743 alloc_pages_vma+0x1bc/0x3f0 mm/mempolicy.c:2115 do_huge_pmd_wp_page_fallback+0x1f0/0x1740 mm/huge_memory.c:1213 do_huge_pmd_wp_page+0x13b4/0x2430 mm/huge_memory.c:1374 wp_huge_pmd mm/memory.c:3745 [inline] __handle_mm_fault+0x1cea/0x4040 mm/memory.c:3958 handle_mm_fault+0x3b7/0xa80 mm/memory.c:4005 faultin_page mm/gup.c:651 [inline] __get_user_pages+0x7d4/0x1b30 mm/gup.c:854 __get_user_pages_locked mm/gup.c:1030 [inline] get_user_pages_remote+0x234/0x4b0 mm/gup.c:1170 process_vm_rw_single_vec mm/process_vm_access.c:109 [inline] process_vm_rw_core.isra.0+0x464/0xb10 mm/process_vm_access.c:216 process_vm_rw+0x21f/0x240 mm/process_vm_access.c:284 __do_sys_process_vm_writev mm/process_vm_access.c:306 [inline] __se_sys_process_vm_writev mm/process_vm_access.c:301 [inline] __x64_sys_process_vm_writev+0xe3/0x1a0 mm/process_vm_access.c:301 do_syscall_64+0xfa/0x760 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x459a09 Code: fd b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 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 0f 83 cb b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f2abfa91c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000137 RAX: ffffffffffffffda RBX: 0000000000000006 RCX: 0000000000459a09 RDX: 0000000000000001 RSI: 0000000020000000 RDI: 000000000000000d RBP: 000000000075bf20 R08: 000000000000023a R09: 0000000000000000 R10: 0000000020121000 R11: 0000000000000246 R12: 00007f2abfa926d4 R13: 00000000004c6d2b R14: 00000000004dc0e0 R15: 00000000ffffffff