====================================================== WARNING: possible circular locking dependency detected 5.14.0-rc1-syzkaller #0 Not tainted ------------------------------------------------------ syz-execprog/8479 is trying to acquire lock: ffffffff8ba9c3a0 (fs_reclaim){+.+.}-{0:0}, at: fs_reclaim_acquire+0xf7/0x160 mm/page_alloc.c:4574 but task is already holding lock: ffff8880b9c4d660 (lock#2){-.-.}-{2:2}, at: __alloc_pages_bulk+0x4ad/0x1870 mm/page_alloc.c:5279 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (lock#2){-.-.}-{2:2}: local_lock_acquire include/linux/local_lock_internal.h:42 [inline] rmqueue_pcplist mm/page_alloc.c:3663 [inline] rmqueue mm/page_alloc.c:3701 [inline] get_page_from_freelist+0x4aa/0x2f80 mm/page_alloc.c:4163 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5374 alloc_pages+0x18c/0x2a0 mm/mempolicy.c:2244 stack_depot_save+0x39d/0x4e0 lib/stackdepot.c:303 kasan_save_stack+0x32/0x40 mm/kasan/common.c:40 kasan_record_aux_stack+0xe5/0x110 mm/kasan/generic.c:348 __call_rcu kernel/rcu/tree.c:3029 [inline] call_rcu+0xb1/0x750 kernel/rcu/tree.c:3109 put_task_struct_rcu_user+0x7f/0xb0 kernel/exit.c:179 context_switch kernel/sched/core.c:4686 [inline] __schedule+0x942/0x26f0 kernel/sched/core.c:5940 preempt_schedule_notrace+0x5b/0xd0 kernel/sched/core.c:6179 preempt_schedule_notrace_thunk+0x16/0x18 arch/x86/entry/thunk_64.S:36 rcu_read_unlock_sched_notrace include/linux/rcupdate.h:809 [inline] trace_lock_release include/trace/events/lock.h:58 [inline] lock_release+0x538/0x720 kernel/locking/lockdep.c:5636 prepare_alloc_pages+0x15c/0x580 mm/page_alloc.c:5164 __alloc_pages+0x12f/0x500 mm/page_alloc.c:5363 alloc_pages_vma+0xd9/0x710 mm/mempolicy.c:2208 do_anonymous_page mm/memory.c:3767 [inline] handle_pte_fault mm/memory.c:4547 [inline] __handle_mm_fault+0x1f67/0x5320 mm/memory.c:4684 handle_mm_fault+0x1c8/0x790 mm/memory.c:4782 faultin_page mm/gup.c:951 [inline] __get_user_pages+0x806/0x1430 mm/gup.c:1173 __get_user_pages_locked mm/gup.c:1359 [inline] __get_user_pages_remote+0x18f/0x840 mm/gup.c:1865 get_user_pages_remote+0x63/0x90 mm/gup.c:1938 get_arg_page+0xba/0x200 fs/exec.c:220 copy_string_kernel+0x1b4/0x520 fs/exec.c:631 kernel_execve+0x25c/0x460 fs/exec.c:1961 call_usermodehelper_exec_async+0x2e3/0x580 kernel/umh.c:112 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 -> #1 (mmu_notifier_invalidate_range_start){+.+.}-{0:0}: fs_reclaim_acquire mm/page_alloc.c:4569 [inline] fs_reclaim_acquire+0xd2/0x160 mm/page_alloc.c:4560 might_alloc include/linux/sched/mm.h:198 [inline] slab_pre_alloc_hook mm/slab.h:485 [inline] slab_alloc_node mm/slub.c:2902 [inline] slab_alloc mm/slub.c:2989 [inline] kmem_cache_alloc_trace+0x3b/0x3c0 mm/slub.c:3006 kmalloc include/linux/slab.h:591 [inline] kzalloc include/linux/slab.h:721 [inline] alloc_workqueue_attrs+0x38/0x80 kernel/workqueue.c:3365 wq_numa_init kernel/workqueue.c:5899 [inline] workqueue_init+0x94/0x979 kernel/workqueue.c:6031 kernel_init_freeable+0x3fb/0x741 init/main.c:1577 kernel_init+0x1a/0x1d0 init/main.c:1485 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 -> #0 (fs_reclaim){+.+.}-{0:0}: check_prev_add kernel/locking/lockdep.c:3051 [inline] check_prevs_add kernel/locking/lockdep.c:3174 [inline] validate_chain kernel/locking/lockdep.c:3789 [inline] __lock_acquire+0x2a07/0x54a0 kernel/locking/lockdep.c:5015 lock_acquire kernel/locking/lockdep.c:5625 [inline] lock_acquire+0x1ab/0x510 kernel/locking/lockdep.c:5590 __fs_reclaim_acquire mm/page_alloc.c:4552 [inline] fs_reclaim_acquire+0x117/0x160 mm/page_alloc.c:4566 prepare_alloc_pages+0x15c/0x580 mm/page_alloc.c:5164 __alloc_pages+0x12f/0x500 mm/page_alloc.c:5363 alloc_pages+0x18c/0x2a0 mm/mempolicy.c:2244 stack_depot_save+0x39d/0x4e0 lib/stackdepot.c:303 save_stack+0x15e/0x1e0 mm/page_owner.c:120 __set_page_owner+0x50/0x290 mm/page_owner.c:181 prep_new_page mm/page_alloc.c:2433 [inline] __alloc_pages_bulk+0x8b9/0x1870 mm/page_alloc.c:5301 alloc_pages_bulk_array_node include/linux/gfp.h:557 [inline] vm_area_alloc_pages mm/vmalloc.c:2793 [inline] __vmalloc_area_node mm/vmalloc.c:2863 [inline] __vmalloc_node_range+0x39d/0x960 mm/vmalloc.c:2966 vmalloc_user+0x67/0x80 mm/vmalloc.c:3101 kcov_mmap+0x2b/0x140 kernel/kcov.c:465 call_mmap include/linux/fs.h:2119 [inline] mmap_region+0xcde/0x1760 mm/mmap.c:1808 do_mmap+0x86e/0x1180 mm/mmap.c:1584 vm_mmap_pgoff+0x1b7/0x290 mm/util.c:519 ksys_mmap_pgoff+0x4a8/0x620 mm/mmap.c:1635 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae other info that might help us debug this: Chain exists of: fs_reclaim --> mmu_notifier_invalidate_range_start --> lock#2 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(lock#2); lock(mmu_notifier_invalidate_range_start); lock(lock#2); lock(fs_reclaim); *** DEADLOCK *** 2 locks held by syz-execprog/8479: #0: ffff88802dd6a428 (&mm->mmap_lock#2){++++}-{3:3}, at: mmap_write_lock_killable include/linux/mmap_lock.h:87 [inline] #0: ffff88802dd6a428 (&mm->mmap_lock#2){++++}-{3:3}, at: vm_mmap_pgoff+0x15c/0x290 mm/util.c:517 #1: ffff8880b9c4d660 (lock#2){-.-.}-{2:2}, at: __alloc_pages_bulk+0x4ad/0x1870 mm/page_alloc.c:5279 stack backtrace: CPU: 0 PID: 8479 Comm: syz-execprog Not tainted 5.14.0-rc1-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:105 check_noncircular+0x25f/0x2e0 kernel/locking/lockdep.c:2131 check_prev_add kernel/locking/lockdep.c:3051 [inline] check_prevs_add kernel/locking/lockdep.c:3174 [inline] validate_chain kernel/locking/lockdep.c:3789 [inline] __lock_acquire+0x2a07/0x54a0 kernel/locking/lockdep.c:5015 lock_acquire kernel/locking/lockdep.c:5625 [inline] lock_acquire+0x1ab/0x510 kernel/locking/lockdep.c:5590 __fs_reclaim_acquire mm/page_alloc.c:4552 [inline] fs_reclaim_acquire+0x117/0x160 mm/page_alloc.c:4566 prepare_alloc_pages+0x15c/0x580 mm/page_alloc.c:5164 __alloc_pages+0x12f/0x500 mm/page_alloc.c:5363 alloc_pages+0x18c/0x2a0 mm/mempolicy.c:2244 stack_depot_save+0x39d/0x4e0 lib/stackdepot.c:303 save_stack+0x15e/0x1e0 mm/page_owner.c:120 __set_page_owner+0x50/0x290 mm/page_owner.c:181 prep_new_page mm/page_alloc.c:2433 [inline] __alloc_pages_bulk+0x8b9/0x1870 mm/page_alloc.c:5301 alloc_pages_bulk_array_node include/linux/gfp.h:557 [inline] vm_area_alloc_pages mm/vmalloc.c:2793 [inline] __vmalloc_area_node mm/vmalloc.c:2863 [inline] __vmalloc_node_range+0x39d/0x960 mm/vmalloc.c:2966 vmalloc_user+0x67/0x80 mm/vmalloc.c:3101 kcov_mmap+0x2b/0x140 kernel/kcov.c:465 call_mmap include/linux/fs.h:2119 [inline] mmap_region+0xcde/0x1760 mm/mmap.c:1808 do_mmap+0x86e/0x1180 mm/mmap.c:1584 vm_mmap_pgoff+0x1b7/0x290 mm/util.c:519 ksys_mmap_pgoff+0x4a8/0x620 mm/mmap.c:1635 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x4b132a Code: e8 db 57 fb ff 48 8b 7c 24 10 48 8b 74 24 18 48 8b 54 24 20 4c 8b 54 24 28 4c 8b 44 24 30 4c 8b 4c 24 38 48 8b 44 24 08 0f 05 <48> 3d 01 f0 ff ff 76 20 48 c7 44 24 40 ff ff ff ff 48 c7 44 24 48 RSP: 002b:000000c00019ba10 EFLAGS: 00000202 ORIG_RAX: 0000000000000009 RAX: ffffffffffffffda RBX: 000000c000020800 RCX: 00000000004b132a RDX: 0000000000000003 RSI: 0000000000080000 RDI: 0000000000000000 RBP: 000000c00019ba70 R08: 0000000000000006 R09: 0000000000000000 R10: 0000000000000001 R11: 0000000000000202 R12: 0000000000727f1a R13: 00000000000000b8 R14: 0000000000000200 R15: 0000000000000100 BUG: sleeping function called from invalid context at mm/page_alloc.c:5167 in_atomic(): 0, irqs_disabled(): 1, non_block: 0, pid: 8479, name: syz-execprog INFO: lockdep is turned off. irq event stamp: 14634 hardirqs last enabled at (14633): [] __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:160 [inline] hardirqs last enabled at (14633): [] _raw_spin_unlock_irqrestore+0x50/0x70 kernel/locking/spinlock.c:191 hardirqs last disabled at (14634): [] __alloc_pages_bulk+0x1017/0x1870 mm/page_alloc.c:5279 softirqs last enabled at (14220): [] invoke_softirq kernel/softirq.c:432 [inline] softirqs last enabled at (14220): [] __irq_exit_rcu+0x16e/0x1c0 kernel/softirq.c:636 softirqs last disabled at (14209): [] invoke_softirq kernel/softirq.c:432 [inline] softirqs last disabled at (14209): [] __irq_exit_rcu+0x16e/0x1c0 kernel/softirq.c:636 CPU: 0 PID: 8479 Comm: syz-execprog Not tainted 5.14.0-rc1-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:105 ___might_sleep.cold+0x1f1/0x237 kernel/sched/core.c:9154 prepare_alloc_pages+0x3da/0x580 mm/page_alloc.c:5167 __alloc_pages+0x12f/0x500 mm/page_alloc.c:5363 alloc_pages+0x18c/0x2a0 mm/mempolicy.c:2244 stack_depot_save+0x39d/0x4e0 lib/stackdepot.c:303 save_stack+0x15e/0x1e0 mm/page_owner.c:120 __set_page_owner+0x50/0x290 mm/page_owner.c:181 prep_new_page mm/page_alloc.c:2433 [inline] __alloc_pages_bulk+0x8b9/0x1870 mm/page_alloc.c:5301 alloc_pages_bulk_array_node include/linux/gfp.h:557 [inline] vm_area_alloc_pages mm/vmalloc.c:2793 [inline] __vmalloc_area_node mm/vmalloc.c:2863 [inline] __vmalloc_node_range+0x39d/0x960 mm/vmalloc.c:2966 vmalloc_user+0x67/0x80 mm/vmalloc.c:3101 kcov_mmap+0x2b/0x140 kernel/kcov.c:465 call_mmap include/linux/fs.h:2119 [inline] mmap_region+0xcde/0x1760 mm/mmap.c:1808 do_mmap+0x86e/0x1180 mm/mmap.c:1584 vm_mmap_pgoff+0x1b7/0x290 mm/util.c:519 ksys_mmap_pgoff+0x4a8/0x620 mm/mmap.c:1635 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x4b132a Code: e8 db 57 fb ff 48 8b 7c 24 10 48 8b 74 24 18 48 8b 54 24 20 4c 8b 54 24 28 4c 8b 44 24 30 4c 8b 4c 24 38 48 8b 44 24 08 0f 05 <48> 3d 01 f0 ff ff 76 20 48 c7 44 24 40 ff ff ff ff 48 c7 44 24 48 RSP: 002b:000000c00019ba10 EFLAGS: 00000202 ORIG_RAX: 0000000000000009 RAX: ffffffffffffffda RBX: 000000c000020800 RCX: 00000000004b132a RDX: 0000000000000003 RSI: 0000000000080000 RDI: 0000000000000000 RBP: 000000c00019ba70 R08: 0000000000000006 R09: 0000000000000000 R10: 0000000000000001 R11: 0000000000000202 R12: 0000000000727f1a R13: 00000000000000b8 R14: 0000000000000200 R15: 0000000000000100