====================================================== WARNING: possible circular locking dependency detected 6.6.98-syzkaller #0 Not tainted ------------------------------------------------------ syz.0.87/6133 is trying to acquire lock: ffff88805e4fdbe0 (&oi->ip_alloc_sem){++++}-{3:3}, at: ocfs2_page_mkwrite+0x2d0/0xd10 fs/ocfs2/mmap.c:142 but task is already holding lock: ffff88802f514510 (sb_pagefaults#2){.+.+}-{0:0}, at: do_page_mkwrite+0x153/0x3e0 mm/memory.c:2950 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (sb_pagefaults#2){.+.+}-{0:0}: percpu_down_read include/linux/percpu-rwsem.h:51 [inline] __sb_start_write include/linux/fs.h:1633 [inline] sb_start_pagefault include/linux/fs.h:1737 [inline] ocfs2_page_mkwrite+0x18b/0xd10 fs/ocfs2/mmap.c:122 do_page_mkwrite+0x153/0x3e0 mm/memory.c:2950 do_shared_fault mm/memory.c:4695 [inline] do_fault mm/memory.c:4757 [inline] do_pte_missing mm/memory.c:3688 [inline] handle_pte_fault mm/memory.c:5025 [inline] __handle_mm_fault mm/memory.c:5166 [inline] handle_mm_fault+0x19b8/0x4920 mm/memory.c:5331 do_user_addr_fault+0x738/0x12e0 arch/x86/mm/fault.c:1373 handle_page_fault arch/x86/mm/fault.c:1465 [inline] exc_page_fault+0x67/0x110 arch/x86/mm/fault.c:1521 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:608 -> #1 (&mm->mmap_lock){++++}-{3:3}: __might_fault+0xc6/0x120 mm/memory.c:5946 _copy_to_user+0x2a/0xa0 lib/usercopy.c:36 copy_to_user include/linux/uaccess.h:191 [inline] fiemap_fill_next_extent+0x1c1/0x390 fs/ioctl.c:145 ocfs2_fiemap_inline fs/ocfs2/extent_map.c:725 [inline] ocfs2_fiemap+0x9d6/0xc80 fs/ocfs2/extent_map.c:762 ioctl_fiemap fs/ioctl.c:220 [inline] do_vfs_ioctl+0x140c/0x1bb0 fs/ioctl.c:811 __do_sys_ioctl fs/ioctl.c:869 [inline] __se_sys_ioctl+0x83/0x170 fs/ioctl.c:857 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 -> #0 (&oi->ip_alloc_sem){++++}-{3:3}: check_prev_add kernel/locking/lockdep.c:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain kernel/locking/lockdep.c:3869 [inline] __lock_acquire+0x2ddb/0x7c80 kernel/locking/lockdep.c:5137 lock_acquire+0x197/0x410 kernel/locking/lockdep.c:5754 down_write+0x97/0x1f0 kernel/locking/rwsem.c:1573 ocfs2_page_mkwrite+0x2d0/0xd10 fs/ocfs2/mmap.c:142 do_page_mkwrite+0x153/0x3e0 mm/memory.c:2950 do_shared_fault mm/memory.c:4695 [inline] do_fault mm/memory.c:4757 [inline] do_pte_missing mm/memory.c:3688 [inline] handle_pte_fault mm/memory.c:5025 [inline] __handle_mm_fault mm/memory.c:5166 [inline] handle_mm_fault+0x19b8/0x4920 mm/memory.c:5331 do_user_addr_fault+0x738/0x12e0 arch/x86/mm/fault.c:1373 handle_page_fault arch/x86/mm/fault.c:1465 [inline] exc_page_fault+0x67/0x110 arch/x86/mm/fault.c:1521 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:608 other info that might help us debug this: Chain exists of: &oi->ip_alloc_sem --> &mm->mmap_lock --> sb_pagefaults#2 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- rlock(sb_pagefaults#2); lock(&mm->mmap_lock); lock(sb_pagefaults#2); lock(&oi->ip_alloc_sem); *** DEADLOCK *** 2 locks held by syz.0.87/6133: #0: ffff8880246c3120 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:165 [inline] #0: ffff8880246c3120 (&mm->mmap_lock){++++}-{3:3}, at: get_mmap_lock_carefully mm/memory.c:5358 [inline] #0: ffff8880246c3120 (&mm->mmap_lock){++++}-{3:3}, at: lock_mm_and_find_vma+0x32/0x300 mm/memory.c:5418 #1: ffff88802f514510 (sb_pagefaults#2){.+.+}-{0:0}, at: do_page_mkwrite+0x153/0x3e0 mm/memory.c:2950 stack backtrace: CPU: 0 PID: 6133 Comm: syz.0.87 Not tainted 6.6.98-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 Call Trace: dump_stack_lvl+0x16c/0x230 lib/dump_stack.c:106 check_noncircular+0x2bd/0x3c0 kernel/locking/lockdep.c:2187 check_prev_add kernel/locking/lockdep.c:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain kernel/locking/lockdep.c:3869 [inline] __lock_acquire+0x2ddb/0x7c80 kernel/locking/lockdep.c:5137 lock_acquire+0x197/0x410 kernel/locking/lockdep.c:5754 down_write+0x97/0x1f0 kernel/locking/rwsem.c:1573 ocfs2_page_mkwrite+0x2d0/0xd10 fs/ocfs2/mmap.c:142 do_page_mkwrite+0x153/0x3e0 mm/memory.c:2950 do_shared_fault mm/memory.c:4695 [inline] do_fault mm/memory.c:4757 [inline] do_pte_missing mm/memory.c:3688 [inline] handle_pte_fault mm/memory.c:5025 [inline] __handle_mm_fault mm/memory.c:5166 [inline] handle_mm_fault+0x19b8/0x4920 mm/memory.c:5331 do_user_addr_fault+0x738/0x12e0 arch/x86/mm/fault.c:1373 handle_page_fault arch/x86/mm/fault.c:1465 [inline] exc_page_fault+0x67/0x110 arch/x86/mm/fault.c:1521 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:608 RIP: 0033:0x7f9774956698 Code: fc 89 37 c3 c5 fa 6f 06 c5 fa 6f 4c 16 f0 c5 fa 7f 07 c5 fa 7f 4c 17 f0 c3 66 0f 1f 84 00 00 00 00 00 48 8b 4c 16 f8 48 8b 36 <48> 89 37 48 89 4c 17 f8 c3 c5 fe 6f 54 16 e0 c5 fe 6f 5c 16 c0 c5 RSP: 002b:00007ffd2d7c36b8 EFLAGS: 00010246 RAX: 0000200000000040 RBX: 0000000000000004 RCX: 0030656c69662f2e RDX: 0000000000000008 RSI: 0030656c69662f2e RDI: 0000200000000040 RBP: 00007f9774bb7ba0 R08: 00007f9774600000 R09: 0000000000000001 R10: 0000000000000001 R11: 0000000000000009 R12: 00007f9774bb5fac R13: 00007f9774bb5fa0 R14: fffffffffffffffe R15: 00007ffd2d7c37d0 ocfs2: Unmounting device (7,0) on (node local)