attempt to access beyond end of device loop3: rw=2049, want=79560, limit=40427 BUG: sleeping function called from invalid context at include/linux/sched/mm.h:209 in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 4912, name: syz-executor.3 1 lock held by syz-executor.3/4912: #0: ffff888017466eb8 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:363 [inline] #0: ffff888017466eb8 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: zap_pte_range mm/memory.c:1342 [inline] #0: ffff888017466eb8 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: zap_pmd_range mm/memory.c:1505 [inline] #0: ffff888017466eb8 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: zap_pud_range mm/memory.c:1534 [inline] #0: ffff888017466eb8 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: zap_p4d_range mm/memory.c:1555 [inline] #0: ffff888017466eb8 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: unmap_page_range+0x9c3/0x2630 mm/memory.c:1576 Preemption disabled at: [<0000000000000000>] 0x0 CPU: 0 PID: 4912 Comm: syz-executor.3 Not tainted 5.15.174-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/25/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106 ___might_sleep+0x547/0x6a0 kernel/sched/core.c:9636 might_alloc include/linux/sched/mm.h:209 [inline] slab_pre_alloc_hook+0x44/0xc0 mm/slab.h:492 slab_alloc_node mm/slub.c:3134 [inline] slab_alloc mm/slub.c:3228 [inline] kmem_cache_alloc+0x3f/0x280 mm/slub.c:3233 f2fs_kmem_cache_alloc_nofail fs/f2fs/f2fs.h:2625 [inline] f2fs_kmem_cache_alloc fs/f2fs/f2fs.h:2635 [inline] f2fs_register_inmem_page+0x1d0/0x6f0 fs/f2fs/segment.c:192 f2fs_set_data_page_dirty+0x7bb/0xa90 fs/f2fs/data.c:3845 zap_pte_range mm/memory.c:1377 [inline] zap_pmd_range mm/memory.c:1505 [inline] zap_pud_range mm/memory.c:1534 [inline] zap_p4d_range mm/memory.c:1555 [inline] unmap_page_range+0xdcd/0x2630 mm/memory.c:1576 unmap_vmas+0x1f8/0x390 mm/memory.c:1653 exit_mmap+0x3b6/0x620 mm/mmap.c:3204 __mmput+0x112/0x3b0 kernel/fork.c:1127 exit_mm+0x688/0x7f0 kernel/exit.c:550 do_exit+0x626/0x2480 kernel/exit.c:861 do_group_exit+0x144/0x310 kernel/exit.c:996 get_signal+0xc66/0x14e0 kernel/signal.c:2900 arch_do_signal_or_restart+0xc3/0x1890 arch/x86/kernel/signal.c:867 handle_signal_work kernel/entry/common.c:154 [inline] exit_to_user_mode_loop+0x97/0x130 kernel/entry/common.c:178 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:214 __syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline] syscall_exit_to_user_mode+0x5d/0x240 kernel/entry/common.c:307 do_syscall_64+0x47/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7fdeca4f4ae9 Code: Unable to access opcode bytes at RIP 0x7fdeca4f4abf. RSP: 002b:00007fdec98550c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: 0000000000000000 RBX: 00007fdeca614050 RCX: 00007fdeca4f4ae9 RDX: 0000000000000000 RSI: 000000000000f501 RDI: 0000000000000005 RBP: 00007fdeca54047a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000006e R14: 00007fdeca614050 R15: 00007ffdac1f3398 ============================= [ BUG: Invalid wait context ] 5.15.174-syzkaller #0 Tainted: G W ----------------------------- syz-executor.3/4912 is trying to lock: ffff888067bc6598 (&fi->inmem_lock){+.+.}-{3:3}, at: f2fs_register_inmem_page+0x31b/0x6f0 fs/f2fs/segment.c:201 other info that might help us debug this: context-{4:4} 1 lock held by syz-executor.3/4912: #0: ffff888017466eb8 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:363 [inline] #0: ffff888017466eb8 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: zap_pte_range mm/memory.c:1342 [inline] #0: ffff888017466eb8 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: zap_pmd_range mm/memory.c:1505 [inline] #0: ffff888017466eb8 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: zap_pud_range mm/memory.c:1534 [inline] #0: ffff888017466eb8 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: zap_p4d_range mm/memory.c:1555 [inline] #0: ffff888017466eb8 (ptlock_ptr(page)#2){+.+.}-{2:2}, at: unmap_page_range+0x9c3/0x2630 mm/memory.c:1576 stack backtrace: CPU: 0 PID: 4912 Comm: syz-executor.3 Tainted: G W 5.15.174-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/25/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106 print_lock_invalid_wait_context kernel/locking/lockdep.c:4664 [inline] check_wait_context kernel/locking/lockdep.c:4725 [inline] __lock_acquire+0x14f5/0x1ff0 kernel/locking/lockdep.c:4962 lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623 __mutex_lock_common+0x1da/0x25a0 kernel/locking/mutex.c:596 __mutex_lock kernel/locking/mutex.c:729 [inline] mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743 f2fs_register_inmem_page+0x31b/0x6f0 fs/f2fs/segment.c:201 f2fs_set_data_page_dirty+0x7bb/0xa90 fs/f2fs/data.c:3845 zap_pte_range mm/memory.c:1377 [inline] zap_pmd_range mm/memory.c:1505 [inline] zap_pud_range mm/memory.c:1534 [inline] zap_p4d_range mm/memory.c:1555 [inline] unmap_page_range+0xdcd/0x2630 mm/memory.c:1576 unmap_vmas+0x1f8/0x390 mm/memory.c:1653 exit_mmap+0x3b6/0x620 mm/mmap.c:3204 __mmput+0x112/0x3b0 kernel/fork.c:1127 exit_mm+0x688/0x7f0 kernel/exit.c:550 do_exit+0x626/0x2480 kernel/exit.c:861 do_group_exit+0x144/0x310 kernel/exit.c:996 get_signal+0xc66/0x14e0 kernel/signal.c:2900 arch_do_signal_or_restart+0xc3/0x1890 arch/x86/kernel/signal.c:867 handle_signal_work kernel/entry/common.c:154 [inline] exit_to_user_mode_loop+0x97/0x130 kernel/entry/common.c:178 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:214 __syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline] syscall_exit_to_user_mode+0x5d/0x240 kernel/entry/common.c:307 do_syscall_64+0x47/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7fdeca4f4ae9 Code: Unable to access opcode bytes at RIP 0x7fdeca4f4abf. RSP: 002b:00007fdec98550c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: 0000000000000000 RBX: 00007fdeca614050 RCX: 00007fdeca4f4ae9 RDX: 0000000000000000 RSI: 000000000000f501 RDI: 0000000000000005 RBP: 00007fdeca54047a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000006e R14: 00007fdeca614050 R15: 00007ffdac1f3398