======================================================== WARNING: possible irq lock inversion dependency detected 5.3.0-rc6-next-20190830 #75 Not tainted -------------------------------------------------------- syz-executor.1/8799 just changed the state of lock: ffff8880991cdb58 (&(&ctx->ctx_lock)->rlock){..-.}, at: spin_lock_irq include/linux/spinlock.h:363 [inline] ffff8880991cdb58 (&(&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.1/8799: #0: ffff88809d16c960 (&(ptlock_ptr(page))->rlock#2){+.+.}, at: spin_lock include/linux/spinlock.h:338 [inline] #0: ffff88809d16c960 (&(ptlock_ptr(page))->rlock#2){+.+.}, at: zap_pte_range mm/memory.c:1021 [inline] #0: ffff88809d16c960 (&(ptlock_ptr(page))->rlock#2){+.+.}, at: zap_pmd_range mm/memory.c:1172 [inline] #0: ffff88809d16c960 (&(ptlock_ptr(page))->rlock#2){+.+.}, at: zap_pud_range mm/memory.c:1201 [inline] #0: ffff88809d16c960 (&(ptlock_ptr(page))->rlock#2){+.+.}, at: zap_p4d_range mm/memory.c:1222 [inline] #0: ffff88809d16c960 (&(ptlock_ptr(page))->rlock#2){+.+.}, at: unmap_page_range+0x81a/0x2380 mm/memory.c:1243 #1: ffffffff88fa7e40 (rcu_callback){....}, at: __rcu_reclaim kernel/rcu/rcu.h:210 [inline] #1: ffffffff88fa7e40 (rcu_callback){....}, at: rcu_do_batch kernel/rcu/tree.c:2157 [inline] #1: ffffffff88fa7e40 (rcu_callback){....}, at: rcu_core+0x60e/0x1560 kernel/rcu/tree.c:2377 #2: ffffffff88fa7e80 (rcu_read_lock_sched){....}, at: percpu_ref_call_confirm_rcu lib/percpu-refcount.c:126 [inline] #2: ffffffff88fa7e80 (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+0x1f1/0x3b0 fs/fuse/dev.c:437 fuse_request_queue_background+0x2f8/0x5b0 fs/fuse/dev.c:697 fuse_request_send_background+0x58/0x110 fs/fuse/dev.c:708 cuse_send_init fs/fuse/cuse.c:458 [inline] cuse_channel_open+0x5c3/0x839 fs/fuse/cuse.c:518 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:914 do_last fs/namei.c:3416 [inline] path_openat+0x10e9/0x46d0 fs/namei.c:3533 do_filp_open+0x1a1/0x280 fs/namei.c:3563 do_sys_open+0x3fe/0x5d0 fs/open.c:1097 __do_sys_openat fs/open.c:1124 [inline] __se_sys_openat fs/open.c:1118 [inline] __x64_sys_openat+0x9d/0x100 fs/open.c:1118 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+0x1f1/0x3b0 fs/fuse/dev.c:437 fuse_request_queue_background+0x2f8/0x5b0 fs/fuse/dev.c:697 fuse_request_send_background+0x58/0x110 fs/fuse/dev.c:708 cuse_send_init fs/fuse/cuse.c:458 [inline] cuse_channel_open+0x5c3/0x839 fs/fuse/cuse.c:518 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:914 do_last fs/namei.c:3416 [inline] path_openat+0x10e9/0x46d0 fs/namei.c:3533 do_filp_open+0x1a1/0x280 fs/namei.c:3563 do_sys_open+0x3fe/0x5d0 fs/open.c:1097 __do_sys_openat fs/open.c:1124 [inline] __se_sys_openat fs/open.c:1118 [inline] __x64_sys_openat+0x9d/0x100 fs/open.c:1118 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+0x1f1/0x3b0 fs/fuse/dev.c:437 fuse_request_queue_background+0x2f8/0x5b0 fs/fuse/dev.c:697 fuse_request_send_background+0x58/0x110 fs/fuse/dev.c:708 cuse_send_init fs/fuse/cuse.c:458 [inline] cuse_channel_open+0x5c3/0x839 fs/fuse/cuse.c:518 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:914 do_last fs/namei.c:3416 [inline] path_openat+0x10e9/0x46d0 fs/namei.c:3533 do_filp_open+0x1a1/0x280 fs/namei.c:3563 do_sys_open+0x3fe/0x5d0 fs/open.c:1097 __do_sys_openat fs/open.c:1124 [inline] __se_sys_openat fs/open.c:1118 [inline] __x64_sys_openat+0x9d/0x100 fs/open.c:1118 do_syscall_64+0xfa/0x760 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe } ... key at: [] __key.44810+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:1748 [inline] __io_submit_one fs/aio.c:1822 [inline] io_submit_one+0xefa/0x2ef0 fs/aio.c:1859 __do_sys_io_submit fs/aio.c:1918 [inline] __se_sys_io_submit fs/aio.c:1888 [inline] __x64_sys_io_submit+0x1bd/0x570 fs/aio.c:1888 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:1133 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:830 __read_once_size include/linux/compiler.h:176 [inline] compound_head include/linux/page-flags.h:174 [inline] PageAnon include/linux/page-flags.h:463 [inline] zap_pte_range mm/memory.c:1058 [inline] zap_pmd_range mm/memory.c:1172 [inline] zap_pud_range mm/memory.c:1201 [inline] zap_p4d_range mm/memory.c:1222 [inline] unmap_page_range+0xa39/0x2380 mm/memory.c:1243 unmap_single_vma+0x19d/0x300 mm/memory.c:1288 unmap_vmas+0x189/0x300 mm/memory.c:1320 exit_mmap+0x2ba/0x530 mm/mmap.c:3176 __mmput kernel/fork.c:1082 [inline] mmput+0x179/0x4d0 kernel/fork.c:1103 exit_mm kernel/exit.c:547 [inline] do_exit+0x823/0x2e60 kernel/exit.c:866 do_group_exit+0x135/0x360 kernel/exit.c:983 get_signal+0x47c/0x2500 kernel/signal.c:2734 do_signal+0x87/0x1700 arch/x86/kernel/signal.c:815 exit_to_usermode_loop+0x286/0x380 arch/x86/entry/common.c:159 prepare_exit_to_usermode arch/x86/entry/common.c:194 [inline] syscall_return_slowpath arch/x86/entry/common.c:274 [inline] do_syscall_64+0x65f/0x760 arch/x86/entry/common.c:300 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:1746 [inline] __io_submit_one fs/aio.c:1822 [inline] io_submit_one+0xeb5/0x2ef0 fs/aio.c:1859 __do_sys_io_submit fs/aio.c:1918 [inline] __se_sys_io_submit fs/aio.c:1888 [inline] __x64_sys_io_submit+0x1bd/0x570 fs/aio.c:1888 do_syscall_64+0xfa/0x760 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe } ... key at: [] __key.54358+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+0x1e8e/0x4a00 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:1133 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:830 __read_once_size include/linux/compiler.h:176 [inline] compound_head include/linux/page-flags.h:174 [inline] PageAnon include/linux/page-flags.h:463 [inline] zap_pte_range mm/memory.c:1058 [inline] zap_pmd_range mm/memory.c:1172 [inline] zap_pud_range mm/memory.c:1201 [inline] zap_p4d_range mm/memory.c:1222 [inline] unmap_page_range+0xa39/0x2380 mm/memory.c:1243 unmap_single_vma+0x19d/0x300 mm/memory.c:1288 unmap_vmas+0x189/0x300 mm/memory.c:1320 exit_mmap+0x2ba/0x530 mm/mmap.c:3176 __mmput kernel/fork.c:1082 [inline] mmput+0x179/0x4d0 kernel/fork.c:1103 exit_mm kernel/exit.c:547 [inline] do_exit+0x823/0x2e60 kernel/exit.c:866 do_group_exit+0x135/0x360 kernel/exit.c:983 get_signal+0x47c/0x2500 kernel/signal.c:2734 do_signal+0x87/0x1700 arch/x86/kernel/signal.c:815 exit_to_usermode_loop+0x286/0x380 arch/x86/entry/common.c:159 prepare_exit_to_usermode arch/x86/entry/common.c:194 [inline] syscall_return_slowpath arch/x86/entry/common.c:274 [inline] do_syscall_64+0x65f/0x760 arch/x86/entry/common.c:300 entry_SYSCALL_64_after_hwframe+0x49/0xbe stack backtrace: CPU: 1 PID: 8799 Comm: syz-executor.1 Not tainted 5.3.0-rc6-next-20190830 #75 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+0x1e8e/0x4a00 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:1133 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:830 RIP: 0010:compound_head include/linux/page-flags.h:176 [inline] RIP: 0010:PageAnon include/linux/page-flags.h:463 [inline] RIP: 0010:zap_pte_range mm/memory.c:1058 [inline] RIP: 0010:zap_pmd_range mm/memory.c:1172 [inline] RIP: 0010:zap_pud_range mm/memory.c:1201 [inline] RIP: 0010:zap_p4d_range mm/memory.c:1222 [inline] RIP: 0010:unmap_page_range+0xa39/0x2380 mm/memory.c:1243 Code: 84 c6 04 00 00 e8 d7 bf d4 ff 49 8d 44 24 08 48 89 85 30 ff ff ff 48 c1 e8 03 42 80 3c 38 00 0f 85 0c 16 00 00 49 8b 44 24 08 <31> ff 4d 89 e5 48 89 c6 48 89 85 b0 fe ff ff 83 e6 01 48 89 b5 d8 RSP: 0018:ffff888095b47738 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff13 RAX: dead000000000100 RBX: 00007fa7d18ab000 RCX: ffff888095b47a00 RDX: 0000000000000000 RSI: ffffffff819d9639 RDI: ffff888095b47a18 RBP: ffff888095b47890 R08: ffff888096292080 R09: fffff9400039723f R10: fffff9400039723e R11: ffffea0001cb91f3 R12: ffffea0001cb9200 R13: ffff888095b47a20 R14: ffff8880970b6550 R15: dffffc0000000000 unmap_single_vma+0x19d/0x300 mm/memory.c:1288 unmap_vmas+0x189/0x300 mm/memory.c:1320 exit_mmap+0x2ba/0x530 mm/mmap.c:3176 __mmput kernel/fork.c:1082 [inline] mmput+0x179/0x4d0 kernel/fork.c:1103 exit_mm kernel/exit.c:547 [inline] do_exit+0x823/0x2e60 kernel/exit.c:866 do_group_exit+0x135/0x360 kernel/exit.c:983 get_signal+0x47c/0x2500 kernel/signal.c:2734 do_signal+0x87/0x1700 arch/x86/kernel/signal.c:815 exit_to_usermode_loop+0x286/0x380 arch/x86/entry/common.c:159 prepare_exit_to_usermode arch/x86/entry/common.c:194 [inline] syscall_return_slowpath arch/x86/entry/common.c:274 [inline] do_syscall_64+0x65f/0x760 arch/x86/entry/common.c:300 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x459879 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:00007fa7d0e38cf8 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca RAX: 0000000000000001 RBX: 000000000075bf28 RCX: 0000000000459879 RDX: 00000000004c8cc6 RSI: 0000000000000081 RDI: 000000000075bf2c RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000003 R11: 0000000000000246 R12: 000000000075bf2c R13: 00007ffea1f651df R14: 00007fa7d0e399c0 R15: 000000000075bf2c