BUG: sleeping function called from invalid context at include/linux/sched/mm.h:209 in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 4842, name: syz-executor.2 1 lock held by syz-executor.2/4842: #0: ffff0000d4226198 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:363 [inline] #0: ffff0000d4226198 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: zap_pte_range mm/memory.c:1331 [inline] #0: ffff0000d4226198 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: zap_pmd_range mm/memory.c:1494 [inline] #0: ffff0000d4226198 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: zap_pud_range mm/memory.c:1523 [inline] #0: ffff0000d4226198 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: zap_p4d_range mm/memory.c:1544 [inline] #0: ffff0000d4226198 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: unmap_page_range+0x708/0x19d4 mm/memory.c:1565 Preemption disabled at: [] spin_lock include/linux/spinlock.h:363 [inline] [] zap_pte_range mm/memory.c:1331 [inline] [] zap_pmd_range mm/memory.c:1494 [inline] [] zap_pud_range mm/memory.c:1523 [inline] [] zap_p4d_range mm/memory.c:1544 [inline] [] unmap_page_range+0x708/0x19d4 mm/memory.c:1565 CPU: 0 PID: 4842 Comm: syz-executor.2 Not tainted 5.15.141-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/10/2023 Call trace: dump_backtrace+0x0/0x530 arch/arm64/kernel/stacktrace.c:152 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:216 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106 dump_stack+0x1c/0x58 lib/dump_stack.c:113 ___might_sleep+0x380/0x4dc kernel/sched/core.c:9626 __might_sleep+0x98/0xf0 kernel/sched/core.c:9580 might_alloc include/linux/sched/mm.h:209 [inline] slab_pre_alloc_hook+0x58/0xe8 mm/slab.h:492 slab_alloc_node mm/slub.c:3134 [inline] slab_alloc mm/slub.c:3228 [inline] kmem_cache_alloc+0x98/0x45c mm/slub.c:3233 f2fs_kmem_cache_alloc_nofail fs/f2fs/f2fs.h:2627 [inline] f2fs_kmem_cache_alloc fs/f2fs/f2fs.h:2637 [inline] f2fs_register_inmem_page+0x1d8/0x8b4 fs/f2fs/segment.c:192 f2fs_set_data_page_dirty+0x588/0x8e0 fs/f2fs/data.c:3787 set_page_dirty+0x23c/0x544 mm/page-writeback.c:2609 zap_pte_range mm/memory.c:1366 [inline] zap_pmd_range mm/memory.c:1494 [inline] zap_pud_range mm/memory.c:1523 [inline] zap_p4d_range mm/memory.c:1544 [inline] unmap_page_range+0xbe4/0x19d4 mm/memory.c:1565 unmap_single_vma+0x13c/0x1e4 mm/memory.c:1610 unmap_vmas+0x1ac/0x320 mm/memory.c:1642 exit_mmap+0x2c8/0x558 mm/mmap.c:3186 __mmput+0xec/0x3b8 kernel/fork.c:1126 mmput+0x80/0xc8 kernel/fork.c:1147 exit_mm+0x5f0/0x70c kernel/exit.c:548 do_exit+0x4d4/0x20bc kernel/exit.c:859 do_group_exit+0x110/0x268 kernel/exit.c:994 get_signal+0x634/0x1550 kernel/signal.c:2889 do_signal arch/arm64/kernel/signal.c:890 [inline] do_notify_resume+0x3d0/0x32b8 arch/arm64/kernel/signal.c:943 prepare_exit_to_user_mode arch/arm64/kernel/entry-common.c:133 [inline] exit_to_user_mode arch/arm64/kernel/entry-common.c:138 [inline] el0_svc+0xfc/0x1f0 arch/arm64/kernel/entry-common.c:609 el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:626 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584 ============================= [ BUG: Invalid wait context ] 5.15.141-syzkaller #0 Tainted: G W ----------------------------- syz-executor.2/4842 is trying to lock: ffff00011d5e8698 (&fi->inmem_lock){+.+.}-{3:3}, at: f2fs_register_inmem_page+0x2f0/0x8b4 fs/f2fs/segment.c:201 other info that might help us debug this: context-{4:4} 1 lock held by syz-executor.2/4842: #0: ffff0000d4226198 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:363 [inline] #0: ffff0000d4226198 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: zap_pte_range mm/memory.c:1331 [inline] #0: ffff0000d4226198 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: zap_pmd_range mm/memory.c:1494 [inline] #0: ffff0000d4226198 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: zap_pud_range mm/memory.c:1523 [inline] #0: ffff0000d4226198 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: zap_p4d_range mm/memory.c:1544 [inline] #0: ffff0000d4226198 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: unmap_page_range+0x708/0x19d4 mm/memory.c:1565 stack backtrace: CPU: 0 PID: 4842 Comm: syz-executor.2 Tainted: G W 5.15.141-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/10/2023 Call trace: dump_backtrace+0x0/0x530 arch/arm64/kernel/stacktrace.c:152 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:216 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106 dump_stack+0x1c/0x58 lib/dump_stack.c:113 print_lock_invalid_wait_context kernel/locking/lockdep.c:4664 [inline] check_wait_context kernel/locking/lockdep.c:4725 [inline] __lock_acquire+0x1af0/0x7638 kernel/locking/lockdep.c:4962 lock_acquire+0x240/0x77c kernel/locking/lockdep.c:5623 __mutex_lock_common+0x194/0x2154 kernel/locking/mutex.c:596 __mutex_lock kernel/locking/mutex.c:729 [inline] mutex_lock_nested+0xa4/0xf8 kernel/locking/mutex.c:743 f2fs_register_inmem_page+0x2f0/0x8b4 fs/f2fs/segment.c:201 f2fs_set_data_page_dirty+0x588/0x8e0 fs/f2fs/data.c:3787 set_page_dirty+0x23c/0x544 mm/page-writeback.c:2609 zap_pte_range mm/memory.c:1366 [inline] zap_pmd_range mm/memory.c:1494 [inline] zap_pud_range mm/memory.c:1523 [inline] zap_p4d_range mm/memory.c:1544 [inline] unmap_page_range+0xbe4/0x19d4 mm/memory.c:1565 unmap_single_vma+0x13c/0x1e4 mm/memory.c:1610 unmap_vmas+0x1ac/0x320 mm/memory.c:1642 exit_mmap+0x2c8/0x558 mm/mmap.c:3186 __mmput+0xec/0x3b8 kernel/fork.c:1126 mmput+0x80/0xc8 kernel/fork.c:1147 exit_mm+0x5f0/0x70c kernel/exit.c:548 do_exit+0x4d4/0x20bc kernel/exit.c:859 do_group_exit+0x110/0x268 kernel/exit.c:994 get_signal+0x634/0x1550 kernel/signal.c:2889 do_signal arch/arm64/kernel/signal.c:890 [inline] do_notify_resume+0x3d0/0x32b8 arch/arm64/kernel/signal.c:943 prepare_exit_to_user_mode arch/arm64/kernel/entry-common.c:133 [inline] exit_to_user_mode arch/arm64/kernel/entry-common.c:138 [inline] el0_svc+0xfc/0x1f0 arch/arm64/kernel/entry-common.c:609 el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:626 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584