======================================================
WARNING: possible circular locking dependency detected
5.14.0-rc1-syzkaller #0 Not tainted
------------------------------------------------------
syz-executor.1/10754 is trying to acquire lock:
ffffffff8ba9afc0 (fs_reclaim){+.+.}-{0:0}, at: fs_reclaim_acquire+0xf7/0x160 mm/page_alloc.c:4574

but task is already holding lock:
ffff8880b9d4d580 (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]
       free_unref_page_list+0x325/0x1050 mm/page_alloc.c:3471
       release_pages+0x824/0x20b0 mm/swap.c:972
       tlb_batch_pages_flush mm/mmu_gather.c:49 [inline]
       tlb_flush_mmu_free mm/mmu_gather.c:242 [inline]
       tlb_flush_mmu mm/mmu_gather.c:249 [inline]
       tlb_finish_mmu+0x165/0x8c0 mm/mmu_gather.c:340
       zap_page_range_single+0x329/0x430 mm/memory.c:1682
       unmap_mapping_range_vma mm/memory.c:3320 [inline]
       unmap_mapping_range_tree mm/memory.c:3341 [inline]
       unmap_mapping_pages+0x222/0x2a0 mm/memory.c:3403
       collapse_file+0x1635/0x3e40 mm/khugepaged.c:1824
       khugepaged_scan_file mm/khugepaged.c:2051 [inline]
       khugepaged_scan_mm_slot mm/khugepaged.c:2146 [inline]
       khugepaged_do_scan mm/khugepaged.c:2230 [inline]
       khugepaged+0x2cc5/0x5590 mm/khugepaged.c:2275
       kthread+0x3e5/0x4d0 kernel/kthread.c:319
       ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295

-> #1 (&mapping->i_mmap_rwsem){++++}-{3:3}:
       down_write+0x92/0x150 kernel/locking/rwsem.c:1406
       i_mmap_lock_write include/linux/fs.h:494 [inline]
       dma_resv_lockdep+0x341/0x536 drivers/dma-buf/dma-resv.c:689
       do_one_initcall+0x103/0x650 init/main.c:1282
       do_initcall_level init/main.c:1355 [inline]
       do_initcalls init/main.c:1371 [inline]
       do_basic_setup init/main.c:1391 [inline]
       kernel_init_freeable+0x6b8/0x741 init/main.c:1593
       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
       __bpf_map_area_alloc+0xd5/0x150 kernel/bpf/syscall.c:311
       stack_map_alloc+0x2e9/0x720 kernel/bpf/stackmap.c:122
       find_and_alloc_map kernel/bpf/syscall.c:127 [inline]
       map_create kernel/bpf/syscall.c:844 [inline]
       __sys_bpf+0xbc3/0x5410 kernel/bpf/syscall.c:4484
       __do_sys_bpf kernel/bpf/syscall.c:4606 [inline]
       __se_sys_bpf kernel/bpf/syscall.c:4604 [inline]
       __x64_sys_bpf+0x75/0xb0 kernel/bpf/syscall.c:4604
       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 --> &mapping->i_mmap_rwsem --> lock#2

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(lock#2);
                               lock(&mapping->i_mmap_rwsem);
                               lock(lock#2);
  lock(fs_reclaim);

 *** DEADLOCK ***

1 lock held by syz-executor.1/10754:
 #0: ffff8880b9d4d580 (lock#2){-.-.}-{2:2}, at: __alloc_pages_bulk+0x4ad/0x1870 mm/page_alloc.c:5279

stack backtrace:
CPU: 1 PID: 10754 Comm: syz-executor.1 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
 __bpf_map_area_alloc+0xd5/0x150 kernel/bpf/syscall.c:311
 stack_map_alloc+0x2e9/0x720 kernel/bpf/stackmap.c:122
 find_and_alloc_map kernel/bpf/syscall.c:127 [inline]
 map_create kernel/bpf/syscall.c:844 [inline]
 __sys_bpf+0xbc3/0x5410 kernel/bpf/syscall.c:4484
 __do_sys_bpf kernel/bpf/syscall.c:4606 [inline]
 __se_sys_bpf kernel/bpf/syscall.c:4604 [inline]
 __x64_sys_bpf+0x75/0xb0 kernel/bpf/syscall.c:4604
 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:0x4665e9
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f82ec073188 EFLAGS: 00000246 ORIG_RAX: 0000000000000141
RAX: ffffffffffffffda RBX: 000000000056bf80 RCX: 00000000004665e9
RDX: 000000000000002c RSI: 0000000020000500 RDI: 0000000000000000
RBP: 00000000004bfcc4 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 000000000056bf80
R13: 00007ffc8cf7d1df R14: 00007f82ec073300 R15: 0000000000022000
BUG: sleeping function called from invalid context at mm/page_alloc.c:5167
in_atomic(): 0, irqs_disabled(): 1, non_block: 0, pid: 10754, name: syz-executor.1
INFO: lockdep is turned off.
irq event stamp: 1578
hardirqs last  enabled at (1577): [<ffffffff892cce90>] __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:160 [inline]
hardirqs last  enabled at (1577): [<ffffffff892cce90>] _raw_spin_unlock_irqrestore+0x50/0x70 kernel/locking/spinlock.c:191
hardirqs last disabled at (1578): [<ffffffff81b2ce97>] __alloc_pages_bulk+0x1017/0x1870 mm/page_alloc.c:5279
softirqs last  enabled at (1420): [<ffffffff81462aae>] invoke_softirq kernel/softirq.c:432 [inline]
softirqs last  enabled at (1420): [<ffffffff81462aae>] __irq_exit_rcu+0x16e/0x1c0 kernel/softirq.c:636
softirqs last disabled at (1413): [<ffffffff81462aae>] invoke_softirq kernel/softirq.c:432 [inline]
softirqs last disabled at (1413): [<ffffffff81462aae>] __irq_exit_rcu+0x16e/0x1c0 kernel/softirq.c:636
CPU: 1 PID: 10754 Comm: syz-executor.1 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
 __bpf_map_area_alloc+0xd5/0x150 kernel/bpf/syscall.c:311
 stack_map_alloc+0x2e9/0x720 kernel/bpf/stackmap.c:122
 find_and_alloc_map kernel/bpf/syscall.c:127 [inline]
 map_create kernel/bpf/syscall.c:844 [inline]
 __sys_bpf+0xbc3/0x5410 kernel/bpf/syscall.c:4484
 __do_sys_bpf kernel/bpf/syscall.c:4606 [inline]
 __se_sys_bpf kernel/bpf/syscall.c:4604 [inline]
 __x64_sys_bpf+0x75/0xb0 kernel/bpf/syscall.c:4604
 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:0x4665e9
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f82ec073188 EFLAGS: 00000246 ORIG_RAX: 0000000000000141
RAX: ffffffffffffffda RBX: 000000000056bf80 RCX: 00000000004665e9
RDX: 000000000000002c RSI: 0000000020000500 RDI: 0000000000000000
RBP: 00000000004bfcc4 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 000000000056bf80
R13: 00007ffc8cf7d1df R14: 00007f82ec073300 R15: 0000000000022000