loop9: detected capacity change from 0 to 32768 ocfs2: Mounting device (7,9) on (node local, slot 0) with ordered data mode. ====================================================== WARNING: possible circular locking dependency detected 6.17.0-rc1-syzkaller #0 Not tainted ------------------------------------------------------ syz.9.794/9487 is trying to acquire lock: ffff8880699eace0 (&mm->mmap_lock){++++}-{4:4}, at: __might_fault mm/memory.c:6958 [inline] ffff8880699eace0 (&mm->mmap_lock){++++}-{4:4}, at: __might_fault+0xe3/0x190 mm/memory.c:6952 but task is already holding lock: ffff88805391ea20 (&ocfs2_file_ip_alloc_sem_key){++++}-{4:4}, at: ocfs2_fiemap+0x2c7/0xd00 fs/ocfs2/extent_map.c:765 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&ocfs2_file_ip_alloc_sem_key){++++}-{4:4}: down_write+0x92/0x200 kernel/locking/rwsem.c:1590 ocfs2_page_mkwrite+0x309/0xd80 fs/ocfs2/mmap.c:142 do_page_mkwrite+0x174/0x380 mm/memory.c:3361 wp_page_shared mm/memory.c:3762 [inline] do_wp_page+0xb10/0x4f00 mm/memory.c:3981 handle_pte_fault mm/memory.c:6068 [inline] __handle_mm_fault+0x1b2d/0x2a50 mm/memory.c:6195 handle_mm_fault+0x589/0xd10 mm/memory.c:6364 do_user_addr_fault+0x7a6/0x1370 arch/x86/mm/fault.c:1387 handle_page_fault arch/x86/mm/fault.c:1476 [inline] exc_page_fault+0x5c/0xb0 arch/x86/mm/fault.c:1532 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 -> #1 (sb_pagefaults#2){.+.+}-{0:0}: percpu_down_read_internal include/linux/percpu-rwsem.h:53 [inline] percpu_down_read_freezable include/linux/percpu-rwsem.h:83 [inline] __sb_start_write include/linux/fs.h:1798 [inline] sb_start_pagefault include/linux/fs.h:1963 [inline] ocfs2_page_mkwrite+0x1cf/0xd80 fs/ocfs2/mmap.c:122 do_page_mkwrite+0x174/0x380 mm/memory.c:3361 wp_page_shared mm/memory.c:3762 [inline] do_wp_page+0xb10/0x4f00 mm/memory.c:3981 handle_pte_fault mm/memory.c:6068 [inline] __handle_mm_fault+0x1b2d/0x2a50 mm/memory.c:6195 handle_mm_fault+0x589/0xd10 mm/memory.c:6364 do_user_addr_fault+0x7a6/0x1370 arch/x86/mm/fault.c:1387 handle_page_fault arch/x86/mm/fault.c:1476 [inline] exc_page_fault+0x5c/0xb0 arch/x86/mm/fault.c:1532 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 -> #0 (&mm->mmap_lock){++++}-{4:4}: check_prev_add kernel/locking/lockdep.c:3165 [inline] check_prevs_add kernel/locking/lockdep.c:3284 [inline] validate_chain kernel/locking/lockdep.c:3908 [inline] __lock_acquire+0x12a6/0x1ce0 kernel/locking/lockdep.c:5237 lock_acquire kernel/locking/lockdep.c:5868 [inline] lock_acquire+0x179/0x350 kernel/locking/lockdep.c:5825 __might_fault mm/memory.c:6958 [inline] __might_fault+0x113/0x190 mm/memory.c:6952 _inline_copy_to_user include/linux/uaccess.h:192 [inline] _copy_to_user+0x2d/0xd0 lib/usercopy.c:26 copy_to_user include/linux/uaccess.h:225 [inline] fiemap_fill_next_extent+0x239/0x390 fs/ioctl.c:145 ocfs2_fiemap+0x67a/0xd00 fs/ocfs2/extent_map.c:806 ioctl_fiemap fs/ioctl.c:220 [inline] do_vfs_ioctl+0x447/0x14f0 fs/ioctl.c:532 __do_sys_ioctl fs/ioctl.c:596 [inline] __se_sys_ioctl fs/ioctl.c:584 [inline] __x64_sys_ioctl+0x114/0x210 fs/ioctl.c:584 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0x4c0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f other info that might help us debug this: Chain exists of: &mm->mmap_lock --> sb_pagefaults#2 --> &ocfs2_file_ip_alloc_sem_key Possible unsafe locking scenario: CPU0 CPU1 ---- ---- rlock(&ocfs2_file_ip_alloc_sem_key); lock(sb_pagefaults#2); lock(&ocfs2_file_ip_alloc_sem_key); rlock(&mm->mmap_lock); *** DEADLOCK *** 1 lock held by syz.9.794/9487: #0: ffff88805391ea20 (&ocfs2_file_ip_alloc_sem_key){++++}-{4:4}, at: ocfs2_fiemap+0x2c7/0xd00 fs/ocfs2/extent_map.c:765 stack backtrace: CPU: 1 UID: 0 PID: 9487 Comm: syz.9.794 Not tainted 6.17.0-rc1-syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_circular_bug+0x275/0x350 kernel/locking/lockdep.c:2043 check_noncircular+0x14c/0x170 kernel/locking/lockdep.c:2175 check_prev_add kernel/locking/lockdep.c:3165 [inline] check_prevs_add kernel/locking/lockdep.c:3284 [inline] validate_chain kernel/locking/lockdep.c:3908 [inline] __lock_acquire+0x12a6/0x1ce0 kernel/locking/lockdep.c:5237 lock_acquire kernel/locking/lockdep.c:5868 [inline] lock_acquire+0x179/0x350 kernel/locking/lockdep.c:5825 __might_fault mm/memory.c:6958 [inline] __might_fault+0x113/0x190 mm/memory.c:6952 _inline_copy_to_user include/linux/uaccess.h:192 [inline] _copy_to_user+0x2d/0xd0 lib/usercopy.c:26 copy_to_user include/linux/uaccess.h:225 [inline] fiemap_fill_next_extent+0x239/0x390 fs/ioctl.c:145 ocfs2_fiemap+0x67a/0xd00 fs/ocfs2/extent_map.c:806 ioctl_fiemap fs/ioctl.c:220 [inline] do_vfs_ioctl+0x447/0x14f0 fs/ioctl.c:532 __do_sys_ioctl fs/ioctl.c:596 [inline] __se_sys_ioctl fs/ioctl.c:584 [inline] __x64_sys_ioctl+0x114/0x210 fs/ioctl.c:584 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0x4c0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f5f5ff8ebe9 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f5f60d4d038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f5f601b5fa0 RCX: 00007f5f5ff8ebe9 RDX: 0000200000000340 RSI: 00000000c020660b RDI: 0000000000000005 RBP: 00007f5f60011e19 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f5f601b6038 R14: 00007f5f601b5fa0 R15: 00007ffe76922098