loop5: detected capacity change from 0 to 32768 ocfs2: Mounting device (7,5) on (node local, slot 0) with ordered data mode. ====================================================== WARNING: possible circular locking dependency detected 6.6.100-syzkaller #0 Not tainted ------------------------------------------------------ syz.5.4897/18980 is trying to acquire lock: ffff888051935be0 (&ocfs2_file_ip_alloc_sem_key){++++}-{3:3}, at: ocfs2_page_mkwrite+0x2d0/0xd10 fs/ocfs2/mmap.c:142 but task is already holding lock: ffff888025b4e510 (sb_pagefaults#7){.+.+}-{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#7){.+.+}-{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 wp_page_shared mm/memory.c:3310 [inline] do_wp_page+0xe5e/0x3630 mm/memory.c:3395 handle_pte_fault mm/memory.c:5041 [inline] __handle_mm_fault mm/memory.c:5166 [inline] handle_mm_fault+0x12d4/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 do_sys_poll+0xf07/0x1150 fs/select.c:1023 __do_sys_poll fs/select.c:1077 [inline] __se_sys_poll+0x129/0x320 fs/select.c:1065 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 -> #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 (&ocfs2_file_ip_alloc_sem_key){++++}-{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 wp_page_shared mm/memory.c:3310 [inline] do_wp_page+0xe5e/0x3630 mm/memory.c:3395 handle_pte_fault mm/memory.c:5041 [inline] __handle_mm_fault mm/memory.c:5166 [inline] handle_mm_fault+0x12d4/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 do_sys_poll+0xf07/0x1150 fs/select.c:1023 __do_sys_poll fs/select.c:1077 [inline] __se_sys_poll+0x129/0x320 fs/select.c:1065 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 other info that might help us debug this: Chain exists of: &ocfs2_file_ip_alloc_sem_key --> &mm->mmap_lock --> sb_pagefaults#7 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- rlock(sb_pagefaults#7); lock(&mm->mmap_lock); lock(sb_pagefaults#7); lock(&ocfs2_file_ip_alloc_sem_key); *** DEADLOCK *** 2 locks held by syz.5.4897/18980: #0: ffff88807ece01a0 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:165 [inline] #0: ffff88807ece01a0 (&mm->mmap_lock){++++}-{3:3}, at: get_mmap_lock_carefully mm/memory.c:5358 [inline] #0: ffff88807ece01a0 (&mm->mmap_lock){++++}-{3:3}, at: lock_mm_and_find_vma+0x32/0x300 mm/memory.c:5418 #1: ffff888025b4e510 (sb_pagefaults#7){.+.+}-{0:0}, at: do_page_mkwrite+0x153/0x3e0 mm/memory.c:2950 stack backtrace: CPU: 0 PID: 18980 Comm: syz.5.4897 Not tainted 6.6.100-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 wp_page_shared mm/memory.c:3310 [inline] do_wp_page+0xe5e/0x3630 mm/memory.c:3395 handle_pte_fault mm/memory.c:5041 [inline] __handle_mm_fault mm/memory.c:5166 [inline] handle_mm_fault+0x12d4/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: 0010:do_sys_poll+0xf07/0x1150 fs/select.c:1023 Code: 24 68 48 83 c2 06 ff cb 48 8b 74 24 38 4c 8d 76 12 45 31 ff 4c 89 f0 48 c1 e8 03 42 0f b6 04 20 84 c0 75 2b 42 0f b7 44 fe 12 <66> 89 02 49 89 d5 44 39 fb 74 3b e8 09 24 94 ff 4c 89 ea 48 83 c2 RSP: 0018:ffffc90004f2f880 EFLAGS: 00050246 RAX: 0000000000000000 RBX: 000000000000001d RCX: 0000000000000002 RDX: 0000200000005f06 RSI: ffffc90004f2fcb0 RDI: 0000000000000000 RBP: ffffc90004f2fe50 R08: ffff8880b8e42303 R09: 1ffff110171c8460 R10: dffffc0000000000 R11: ffffed10171c8461 R12: dffffc0000000000 R13: 0000000000000000 R14: ffffc90004f2fcc2 R15: 0000000000000000 __do_sys_poll fs/select.c:1077 [inline] __se_sys_poll+0x129/0x320 fs/select.c:1065 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 RIP: 0033:0x7f784b98e9a9 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:00007f784c8d9038 EFLAGS: 00000246 ORIG_RAX: 0000000000000007 RAX: ffffffffffffffda RBX: 00007f784bbb5fa0 RCX: 00007f784b98e9a9 RDX: 0000000000000002 RSI: 0000000000000044 RDI: 0000200000005f00 RBP: 00007f784ba10d69 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f784bbb5fa0 R15: 00007ffd8ec04338 ---------------- Code disassembly (best guess): 0: 24 68 and $0x68,%al 2: 48 83 c2 06 add $0x6,%rdx 6: ff cb dec %ebx 8: 48 8b 74 24 38 mov 0x38(%rsp),%rsi d: 4c 8d 76 12 lea 0x12(%rsi),%r14 11: 45 31 ff xor %r15d,%r15d 14: 4c 89 f0 mov %r14,%rax 17: 48 c1 e8 03 shr $0x3,%rax 1b: 42 0f b6 04 20 movzbl (%rax,%r12,1),%eax 20: 84 c0 test %al,%al 22: 75 2b jne 0x4f 24: 42 0f b7 44 fe 12 movzwl 0x12(%rsi,%r15,8),%eax * 2a: 66 89 02 mov %ax,(%rdx) <-- trapping instruction 2d: 49 89 d5 mov %rdx,%r13 30: 44 39 fb cmp %r15d,%ebx 33: 74 3b je 0x70 35: e8 09 24 94 ff call 0xff942443 3a: 4c 89 ea mov %r13,%rdx 3d: 48 rex.W 3e: 83 .byte 0x83 3f: c2 .byte 0xc2