===================================================== WARNING: SOFTIRQ-safe -> SOFTIRQ-unsafe lock order detected 5.2.0+ #37 Not tainted ----------------------------------------------------- syz-executor.4/15074 [HC0[0]:SC0[0]:HE0:SE1] is trying to acquire: 00000000b1b9e0c3 (&fiq->waitq){+.+.}, at: spin_lock include/linux/spinlock.h:338 [inline] 00000000b1b9e0c3 (&fiq->waitq){+.+.}, at: aio_poll fs/aio.c:1751 [inline] 00000000b1b9e0c3 (&fiq->waitq){+.+.}, at: __io_submit_one fs/aio.c:1825 [inline] 00000000b1b9e0c3 (&fiq->waitq){+.+.}, at: io_submit_one+0x1153/0x1ad0 fs/aio.c:1862 and this task is already holding: 00000000d7eaad0c (&(&ctx->ctx_lock)->rlock){..-.}, at: spin_lock_irq include/linux/spinlock.h:363 [inline] 00000000d7eaad0c (&(&ctx->ctx_lock)->rlock){..-.}, at: aio_poll fs/aio.c:1749 [inline] 00000000d7eaad0c (&(&ctx->ctx_lock)->rlock){..-.}, at: __io_submit_one fs/aio.c:1825 [inline] 00000000d7eaad0c (&(&ctx->ctx_lock)->rlock){..-.}, at: io_submit_one+0x1127/0x1ad0 fs/aio.c:1862 which would create a new lock dependency: (&(&ctx->ctx_lock)->rlock){..-.} -> (&fiq->waitq){+.+.} but this new dependency connects a SOFTIRQ-irq-safe lock: (&(&ctx->ctx_lock)->rlock){..-.} ... which became SOFTIRQ-irq-safe at: __raw_spin_lock_irq include/linux/spinlock_api_smp.h:128 [inline] _raw_spin_lock_irq+0x68/0x80 kernel/locking/spinlock.c:167 spin_lock_irq include/linux/spinlock.h:363 [inline] free_ioctx_users+0x33/0x1d0 fs/aio.c:618 percpu_ref_put_many include/linux/percpu-refcount.h:293 [inline] percpu_ref_put+0x19d/0x1b0 include/linux/percpu-refcount.h:309 percpu_ref_call_confirm_rcu lib/percpu-refcount.c:130 [inline] percpu_ref_switch_to_atomic_rcu+0x344/0x420 lib/percpu-refcount.c:165 __rcu_reclaim kernel/rcu/rcu.h:222 [inline] rcu_do_batch kernel/rcu/tree.c:2114 [inline] rcu_core+0x7e2/0xf00 kernel/rcu/tree.c:2314 rcu_core_si+0x9/0x10 kernel/rcu/tree.c:2323 __do_softirq+0x307/0x774 arch/x86/include/asm/paravirt.h:778 invoke_softirq kernel/softirq.c:373 [inline] irq_exit+0x1e9/0x1f0 kernel/softirq.c:413 exiting_irq arch/x86/include/asm/apic.h:537 [inline] smp_apic_timer_interrupt+0xcc/0x220 arch/x86/kernel/apic/apic.c:1095 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:828 __read_once_size include/linux/compiler.h:199 [inline] compound_head include/linux/page-flags.h:172 [inline] get_page include/linux/mm.h:1005 [inline] copy_one_pte mm/memory.c:772 [inline] copy_pte_range mm/memory.c:823 [inline] copy_pmd_range mm/memory.c:874 [inline] copy_pud_range mm/memory.c:908 [inline] copy_p4d_range mm/memory.c:930 [inline] copy_page_range+0x14ff/0x28a0 mm/memory.c:992 dup_mmap+0xa77/0xea0 kernel/fork.c:592 dup_mm+0x9e/0x340 kernel/fork.c:1346 copy_mm kernel/fork.c:1402 [inline] copy_process+0x24d0/0x5a00 kernel/fork.c:2017 _do_fork+0x179/0x630 kernel/fork.c:2369 __do_sys_clone kernel/fork.c:2524 [inline] __se_sys_clone kernel/fork.c:2505 [inline] __x64_sys_clone+0x247/0x2b0 kernel/fork.c:2505 do_syscall_64+0xfe/0x140 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe to a SOFTIRQ-irq-unsafe lock: (&fiq->waitq){+.+.} ... which became SOFTIRQ-irq-unsafe at: ... __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline] _raw_spin_lock+0x2b/0x40 kernel/locking/spinlock.c:151 spin_lock include/linux/spinlock.h:338 [inline] flush_bg_queue fs/fuse/dev.c:415 [inline] fuse_request_queue_background+0x673/0xc60 fs/fuse/dev.c:676 fuse_request_send_background+0x56/0x100 fs/fuse/dev.c:687 cuse_send_init fs/fuse/cuse.c:459 [inline] cuse_channel_open+0x485/0x660 fs/fuse/cuse.c:519 misc_open+0x3ef/0x440 drivers/char/misc.c:141 chrdev_open+0x60a/0x670 fs/char_dev.c:414 do_dentry_open+0x7d1/0x1080 fs/open.c:778 vfs_open+0x73/0x80 fs/open.c:887 do_last fs/namei.c:3416 [inline] path_openat+0x136d/0x4440 fs/namei.c:3533 do_filp_open+0x1f7/0x430 fs/namei.c:3563 do_sys_open+0x343/0x620 fs/open.c:1070 __do_sys_openat fs/open.c:1097 [inline] __se_sys_openat fs/open.c:1091 [inline] __x64_sys_openat+0xa2/0xb0 fs/open.c:1091 do_syscall_64+0xfe/0x140 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe 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 *** 1 lock held by syz-executor.4/15074: #0: 00000000d7eaad0c (&(&ctx->ctx_lock)->rlock){..-.}, at: spin_lock_irq include/linux/spinlock.h:363 [inline] #0: 00000000d7eaad0c (&(&ctx->ctx_lock)->rlock){..-.}, at: aio_poll fs/aio.c:1749 [inline] #0: 00000000d7eaad0c (&(&ctx->ctx_lock)->rlock){..-.}, at: __io_submit_one fs/aio.c:1825 [inline] #0: 00000000d7eaad0c (&(&ctx->ctx_lock)->rlock){..-.}, at: io_submit_one+0x1127/0x1ad0 fs/aio.c:1862 the dependencies between SOFTIRQ-irq-safe lock and the holding lock: -> (&(&ctx->ctx_lock)->rlock){..-.} { IN-SOFTIRQ-W at: __raw_spin_lock_irq include/linux/spinlock_api_smp.h:128 [inline] _raw_spin_lock_irq+0x68/0x80 kernel/locking/spinlock.c:167 spin_lock_irq include/linux/spinlock.h:363 [inline] free_ioctx_users+0x33/0x1d0 fs/aio.c:618 percpu_ref_put_many include/linux/percpu-refcount.h:293 [inline] percpu_ref_put+0x19d/0x1b0 include/linux/percpu-refcount.h:309 percpu_ref_call_confirm_rcu lib/percpu-refcount.c:130 [inline] percpu_ref_switch_to_atomic_rcu+0x344/0x420 lib/percpu-refcount.c:165 __rcu_reclaim kernel/rcu/rcu.h:222 [inline] rcu_do_batch kernel/rcu/tree.c:2114 [inline] rcu_core+0x7e2/0xf00 kernel/rcu/tree.c:2314 rcu_core_si+0x9/0x10 kernel/rcu/tree.c:2323 __do_softirq+0x307/0x774 arch/x86/include/asm/paravirt.h:778 invoke_softirq kernel/softirq.c:373 [inline] irq_exit+0x1e9/0x1f0 kernel/softirq.c:413 exiting_irq arch/x86/include/asm/apic.h:537 [inline] smp_apic_timer_interrupt+0xcc/0x220 arch/x86/kernel/apic/apic.c:1095 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:828 __read_once_size include/linux/compiler.h:199 [inline] compound_head include/linux/page-flags.h:172 [inline] get_page include/linux/mm.h:1005 [inline] copy_one_pte mm/memory.c:772 [inline] copy_pte_range mm/memory.c:823 [inline] copy_pmd_range mm/memory.c:874 [inline] copy_pud_range mm/memory.c:908 [inline] copy_p4d_range mm/memory.c:930 [inline] copy_page_range+0x14ff/0x28a0 mm/memory.c:992 dup_mmap+0xa77/0xea0 kernel/fork.c:592 dup_mm+0x9e/0x340 kernel/fork.c:1346 copy_mm kernel/fork.c:1402 [inline] copy_process+0x24d0/0x5a00 kernel/fork.c:2017 _do_fork+0x179/0x630 kernel/fork.c:2369 __do_sys_clone kernel/fork.c:2524 [inline] __se_sys_clone kernel/fork.c:2505 [inline] __x64_sys_clone+0x247/0x2b0 kernel/fork.c:2505 do_syscall_64+0xfe/0x140 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe INITIAL USE at: __raw_spin_lock_irq include/linux/spinlock_api_smp.h:128 [inline] _raw_spin_lock_irq+0x68/0x80 kernel/locking/spinlock.c:167 spin_lock_irq include/linux/spinlock.h:363 [inline] __do_sys_io_cancel fs/aio.c:2003 [inline] __se_sys_io_cancel+0x9a/0x320 fs/aio.c:1985 __x64_sys_io_cancel+0x7b/0x90 fs/aio.c:1985 do_syscall_64+0xfe/0x140 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe } ... key at: [] ioctx_alloc.__key+0x0/0x10 ... acquired at: __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline] _raw_spin_lock+0x2b/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+0x1153/0x1ad0 fs/aio.c:1862 __do_sys_io_submit fs/aio.c:1921 [inline] __se_sys_io_submit+0x18f/0x2d0 fs/aio.c:1891 __x64_sys_io_submit+0x7b/0x90 fs/aio.c:1891 do_syscall_64+0xfe/0x140 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe the dependencies between the lock to be acquired and SOFTIRQ-irq-unsafe lock: -> (&fiq->waitq){+.+.} { HARDIRQ-ON-W at: __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline] _raw_spin_lock+0x2b/0x40 kernel/locking/spinlock.c:151 spin_lock include/linux/spinlock.h:338 [inline] flush_bg_queue fs/fuse/dev.c:415 [inline] fuse_request_queue_background+0x673/0xc60 fs/fuse/dev.c:676 fuse_request_send_background+0x56/0x100 fs/fuse/dev.c:687 cuse_send_init fs/fuse/cuse.c:459 [inline] cuse_channel_open+0x485/0x660 fs/fuse/cuse.c:519 misc_open+0x3ef/0x440 drivers/char/misc.c:141 chrdev_open+0x60a/0x670 fs/char_dev.c:414 do_dentry_open+0x7d1/0x1080 fs/open.c:778 vfs_open+0x73/0x80 fs/open.c:887 do_last fs/namei.c:3416 [inline] path_openat+0x136d/0x4440 fs/namei.c:3533 do_filp_open+0x1f7/0x430 fs/namei.c:3563 do_sys_open+0x343/0x620 fs/open.c:1070 __do_sys_openat fs/open.c:1097 [inline] __se_sys_openat fs/open.c:1091 [inline] __x64_sys_openat+0xa2/0xb0 fs/open.c:1091 do_syscall_64+0xfe/0x140 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe SOFTIRQ-ON-W at: __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline] _raw_spin_lock+0x2b/0x40 kernel/locking/spinlock.c:151 spin_lock include/linux/spinlock.h:338 [inline] flush_bg_queue fs/fuse/dev.c:415 [inline] fuse_request_queue_background+0x673/0xc60 fs/fuse/dev.c:676 fuse_request_send_background+0x56/0x100 fs/fuse/dev.c:687 cuse_send_init fs/fuse/cuse.c:459 [inline] cuse_channel_open+0x485/0x660 fs/fuse/cuse.c:519 misc_open+0x3ef/0x440 drivers/char/misc.c:141 chrdev_open+0x60a/0x670 fs/char_dev.c:414 do_dentry_open+0x7d1/0x1080 fs/open.c:778 vfs_open+0x73/0x80 fs/open.c:887 do_last fs/namei.c:3416 [inline] path_openat+0x136d/0x4440 fs/namei.c:3533 do_filp_open+0x1f7/0x430 fs/namei.c:3563 do_sys_open+0x343/0x620 fs/open.c:1070 __do_sys_openat fs/open.c:1097 [inline] __se_sys_openat fs/open.c:1091 [inline] __x64_sys_openat+0xa2/0xb0 fs/open.c:1091 do_syscall_64+0xfe/0x140 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe INITIAL USE at: __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline] _raw_spin_lock+0x2b/0x40 kernel/locking/spinlock.c:151 spin_lock include/linux/spinlock.h:338 [inline] flush_bg_queue fs/fuse/dev.c:415 [inline] fuse_request_queue_background+0x673/0xc60 fs/fuse/dev.c:676 fuse_request_send_background+0x56/0x100 fs/fuse/dev.c:687 cuse_send_init fs/fuse/cuse.c:459 [inline] cuse_channel_open+0x485/0x660 fs/fuse/cuse.c:519 misc_open+0x3ef/0x440 drivers/char/misc.c:141 chrdev_open+0x60a/0x670 fs/char_dev.c:414 do_dentry_open+0x7d1/0x1080 fs/open.c:778 vfs_open+0x73/0x80 fs/open.c:887 do_last fs/namei.c:3416 [inline] path_openat+0x136d/0x4440 fs/namei.c:3533 do_filp_open+0x1f7/0x430 fs/namei.c:3563 do_sys_open+0x343/0x620 fs/open.c:1070 __do_sys_openat fs/open.c:1097 [inline] __se_sys_openat fs/open.c:1091 [inline] __x64_sys_openat+0xa2/0xb0 fs/open.c:1091 do_syscall_64+0xfe/0x140 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe } ... key at: [] fuse_iqueue_init.__key+0x0/0x10 ... acquired at: __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline] _raw_spin_lock+0x2b/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+0x1153/0x1ad0 fs/aio.c:1862 __do_sys_io_submit fs/aio.c:1921 [inline] __se_sys_io_submit+0x18f/0x2d0 fs/aio.c:1891 __x64_sys_io_submit+0x7b/0x90 fs/aio.c:1891 do_syscall_64+0xfe/0x140 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe stack backtrace: CPU: 0 PID: 15074 Comm: syz-executor.4 Not tainted 5.2.0+ #37 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+0x1d8/0x2f8 lib/dump_stack.c:113 print_bad_irq_dependency kernel/locking/lockdep.c:469 [inline] check_irq_usage kernel/locking/lockdep.c:2223 [inline] check_prev_add kernel/locking/lockdep.c:2409 [inline] check_prevs_add+0x5752/0x5950 kernel/locking/lockdep.c:2507 validate_chain kernel/locking/lockdep.c:2897 [inline] __lock_acquire+0x2531/0x4750 kernel/locking/lockdep.c:3880 lock_acquire+0x158/0x250 kernel/locking/lockdep.c:4413 __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline] _raw_spin_lock+0x2b/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+0x1153/0x1ad0 fs/aio.c:1862 __do_sys_io_submit fs/aio.c:1921 [inline] __se_sys_io_submit+0x18f/0x2d0 fs/aio.c:1891 __x64_sys_io_submit+0x7b/0x90 fs/aio.c:1891 do_syscall_64+0xfe/0x140 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x459829 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:00007fb75951fc78 EFLAGS: 00000246 ORIG_RAX: 00000000000000d1 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000459829 RDX: 0000000020000040 RSI: 0000000000000001 RDI: 00007fb7594ff000 RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007fb7595206d4 R13: 00000000004c0c01 R14: 00000000004d39e8 R15: 00000000ffffffff