====================================================== WARNING: possible circular locking dependency detected 6.14.0-rc7-syzkaller-ga2392f333575 #0 Not tainted ------------------------------------------------------ syz.1.194/7499 is trying to acquire lock: ffff0000c5533f60 (&ocfs2_file_ip_alloc_sem_key){++++}-{4:4}, at: ocfs2_page_mkwrite+0x398/0xe08 fs/ocfs2/mmap.c:142 but task is already holding lock: ffff0000efaf0518 (sb_pagefaults#3){.+.+}-{0:0}, at: do_page_mkwrite+0x140/0x2dc mm/memory.c:3256 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (sb_pagefaults#3){.+.+}-{0:0}: percpu_down_read include/linux/percpu-rwsem.h:51 [inline] __sb_start_write include/linux/fs.h:1785 [inline] sb_start_pagefault include/linux/fs.h:1950 [inline] ocfs2_page_mkwrite+0x1e8/0xe08 fs/ocfs2/mmap.c:122 do_page_mkwrite+0x140/0x2dc mm/memory.c:3256 wp_page_shared mm/memory.c:3657 [inline] do_wp_page+0x1f50/0x38a0 mm/memory.c:3807 handle_pte_fault+0xe44/0x57b0 mm/memory.c:5904 __handle_mm_fault mm/memory.c:6031 [inline] handle_mm_fault+0xf0c/0x17b0 mm/memory.c:6200 do_page_fault+0x574/0x10ac arch/arm64/mm/fault.c:690 do_mem_abort+0x74/0x200 arch/arm64/mm/fault.c:919 el0_da+0x60/0x178 arch/arm64/kernel/entry-common.c:604 el0t_64_sync_handler+0xcc/0x108 arch/arm64/kernel/entry-common.c:765 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:600 -> #1 (&mm->mmap_lock){++++}-{4:4}: __might_fault+0xc4/0x124 mm/memory.c:6839 _inline_copy_to_user include/linux/uaccess.h:192 [inline] copy_to_user include/linux/uaccess.h:223 [inline] fiemap_fill_next_extent+0x1d0/0x45c fs/ioctl.c:145 ocfs2_fiemap+0x894/0xe04 fs/ocfs2/extent_map.c:806 ioctl_fiemap fs/ioctl.c:220 [inline] do_vfs_ioctl+0x1b28/0x2724 fs/ioctl.c:840 __do_sys_ioctl fs/ioctl.c:904 [inline] __se_sys_ioctl fs/ioctl.c:892 [inline] __arm64_sys_ioctl+0xe4/0x1cc fs/ioctl.c:892 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:49 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:132 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:151 el0_svc+0x54/0x168 arch/arm64/kernel/entry-common.c:744 el0t_64_sync_handler+0x84/0x108 arch/arm64/kernel/entry-common.c:762 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:600 -> #0 (&ocfs2_file_ip_alloc_sem_key){++++}-{4:4}: check_prev_add kernel/locking/lockdep.c:3163 [inline] check_prevs_add kernel/locking/lockdep.c:3282 [inline] validate_chain kernel/locking/lockdep.c:3906 [inline] __lock_acquire+0x34f0/0x7904 kernel/locking/lockdep.c:5228 lock_acquire+0x23c/0x724 kernel/locking/lockdep.c:5851 down_write+0x50/0xc0 kernel/locking/rwsem.c:1577 ocfs2_page_mkwrite+0x398/0xe08 fs/ocfs2/mmap.c:142 do_page_mkwrite+0x140/0x2dc mm/memory.c:3256 wp_page_shared mm/memory.c:3657 [inline] do_wp_page+0x1f50/0x38a0 mm/memory.c:3807 handle_pte_fault+0xe44/0x57b0 mm/memory.c:5904 __handle_mm_fault mm/memory.c:6031 [inline] handle_mm_fault+0xf0c/0x17b0 mm/memory.c:6200 do_page_fault+0x574/0x10ac arch/arm64/mm/fault.c:690 do_mem_abort+0x74/0x200 arch/arm64/mm/fault.c:919 el0_da+0x60/0x178 arch/arm64/kernel/entry-common.c:604 el0t_64_sync_handler+0xcc/0x108 arch/arm64/kernel/entry-common.c:765 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:600 other info that might help us debug this: Chain exists of: &ocfs2_file_ip_alloc_sem_key --> &mm->mmap_lock --> sb_pagefaults#3 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- rlock(sb_pagefaults#3); lock(&mm->mmap_lock); lock(sb_pagefaults#3); lock(&ocfs2_file_ip_alloc_sem_key); *** DEADLOCK *** 2 locks held by syz.1.194/7499: #0: ffff0000d98b01d0 (&mm->mmap_lock){++++}-{4:4}, at: mmap_read_trylock include/linux/mmap_lock.h:209 [inline] #0: ffff0000d98b01d0 (&mm->mmap_lock){++++}-{4:4}, at: get_mmap_lock_carefully mm/memory.c:6237 [inline] #0: ffff0000d98b01d0 (&mm->mmap_lock){++++}-{4:4}, at: lock_mm_and_find_vma+0x38/0x2d8 mm/memory.c:6297 #1: ffff0000efaf0518 (sb_pagefaults#3){.+.+}-{0:0}, at: do_page_mkwrite+0x140/0x2dc mm/memory.c:3256 stack backtrace: CPU: 1 UID: 0 PID: 7499 Comm: syz.1.194 Not tainted 6.14.0-rc7-syzkaller-ga2392f333575 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025 Call trace: show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:466 (C) __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0xe4/0x150 lib/dump_stack.c:120 dump_stack+0x1c/0x28 lib/dump_stack.c:129 print_circular_bug+0x154/0x1c0 kernel/locking/lockdep.c:2076 check_noncircular+0x310/0x404 kernel/locking/lockdep.c:2208 check_prev_add kernel/locking/lockdep.c:3163 [inline] check_prevs_add kernel/locking/lockdep.c:3282 [inline] validate_chain kernel/locking/lockdep.c:3906 [inline] __lock_acquire+0x34f0/0x7904 kernel/locking/lockdep.c:5228 lock_acquire+0x23c/0x724 kernel/locking/lockdep.c:5851 down_write+0x50/0xc0 kernel/locking/rwsem.c:1577 ocfs2_page_mkwrite+0x398/0xe08 fs/ocfs2/mmap.c:142 do_page_mkwrite+0x140/0x2dc mm/memory.c:3256 wp_page_shared mm/memory.c:3657 [inline] do_wp_page+0x1f50/0x38a0 mm/memory.c:3807 handle_pte_fault+0xe44/0x57b0 mm/memory.c:5904 __handle_mm_fault mm/memory.c:6031 [inline] handle_mm_fault+0xf0c/0x17b0 mm/memory.c:6200 do_page_fault+0x574/0x10ac arch/arm64/mm/fault.c:690 do_mem_abort+0x74/0x200 arch/arm64/mm/fault.c:919 el0_da+0x60/0x178 arch/arm64/kernel/entry-common.c:604 el0t_64_sync_handler+0xcc/0x108 arch/arm64/kernel/entry-common.c:765 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:600