loop0: detected capacity change from 32768 to 0 ocfs2: Mounting device (7,0) on (node local, slot 0) with ordered data mode. ====================================================== WARNING: possible circular locking dependency detected 5.11.0-syzkaller #0 Not tainted ------------------------------------------------------ syz.0.15/4173 is trying to acquire lock: ffff888019f78858 (&mm->mmap_lock#2){++++}-{3:3}, at: __might_fault+0x8a/0x160 mm/memory.c:5018 but task is already holding lock: ffff88802ed0d8e0 (&oi->ip_alloc_sem){++++}-{3:3}, at: ocfs2_fiemap+0x1e9/0xa60 fs/ocfs2/extent_map.c:757 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&oi->ip_alloc_sem){++++}-{3:3}: lock_acquire kernel/locking/lockdep.c:5442 [inline] lock_acquire+0x1a8/0x730 kernel/locking/lockdep.c:5407 down_write+0x8d/0x150 kernel/locking/rwsem.c:1406 ocfs2_page_mkwrite+0x250/0xa00 fs/ocfs2/mmap.c:144 do_page_mkwrite+0x18b/0x400 mm/memory.c:2714 do_shared_fault mm/memory.c:4083 [inline] do_fault mm/memory.c:4151 [inline] handle_pte_fault mm/memory.c:4387 [inline] __handle_mm_fault mm/memory.c:4522 [inline] handle_mm_fault+0x230a/0x3ba0 mm/memory.c:4620 do_user_addr_fault+0x2d3/0x930 arch/x86/mm/fault.c:1393 handle_page_fault arch/x86/mm/fault.c:1450 [inline] exc_page_fault+0x61/0xc0 arch/x86/mm/fault.c:1506 asm_exc_page_fault+0x1e/0x30 arch/x86/include/asm/idtentry.h:580 -> #1 (sb_pagefaults#2){.+.+}-{0:0}: lock_acquire kernel/locking/lockdep.c:5442 [inline] lock_acquire+0x1a8/0x730 kernel/locking/lockdep.c:5407 percpu_down_read include/linux/percpu-rwsem.h:51 [inline] __sb_start_write include/linux/fs.h:1592 [inline] sb_start_pagefault include/linux/fs.h:1691 [inline] ocfs2_page_mkwrite+0x170/0xa00 fs/ocfs2/mmap.c:124 do_page_mkwrite+0x18b/0x400 mm/memory.c:2714 do_shared_fault mm/memory.c:4083 [inline] do_fault mm/memory.c:4151 [inline] handle_pte_fault mm/memory.c:4387 [inline] __handle_mm_fault mm/memory.c:4522 [inline] handle_mm_fault+0x230a/0x3ba0 mm/memory.c:4620 do_user_addr_fault+0x2d3/0x930 arch/x86/mm/fault.c:1393 handle_page_fault arch/x86/mm/fault.c:1450 [inline] exc_page_fault+0x61/0xc0 arch/x86/mm/fault.c:1506 asm_exc_page_fault+0x1e/0x30 arch/x86/include/asm/idtentry.h:580 -> #0 (&mm->mmap_lock#2){++++}-{3:3}: check_prev_add+0x163/0x20f0 kernel/locking/lockdep.c:2868 check_prevs_add kernel/locking/lockdep.c:2993 [inline] validate_chain kernel/locking/lockdep.c:3608 [inline] __lock_acquire+0x2872/0x35d0 kernel/locking/lockdep.c:4832 lock_acquire kernel/locking/lockdep.c:5442 [inline] lock_acquire+0x1a8/0x730 kernel/locking/lockdep.c:5407 __might_fault mm/memory.c:5019 [inline] __might_fault+0xe8/0x160 mm/memory.c:5004 _copy_to_user+0x20/0xd0 lib/usercopy.c:28 copy_to_user include/linux/uaccess.h:200 [inline] fiemap_fill_next_extent+0x18d/0x320 fs/ioctl.c:141 ocfs2_fiemap+0x4cc/0xa60 fs/ocfs2/extent_map.c:798 ioctl_fiemap fs/ioctl.c:216 [inline] do_vfs_ioctl+0x1fd/0xe10 fs/ioctl.c:705 __do_sys_ioctl fs/ioctl.c:751 [inline] __se_sys_ioctl fs/ioctl.c:739 [inline] __x64_sys_ioctl+0xc5/0x190 fs/ioctl.c:739 do_syscall_64+0x34/0x50 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 other info that might help us debug this: Chain exists of: &mm->mmap_lock#2 --> sb_pagefaults#2 --> &oi->ip_alloc_sem Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&oi->ip_alloc_sem); lock(sb_pagefaults#2); lock(&oi->ip_alloc_sem); lock(&mm->mmap_lock#2); *** DEADLOCK *** 1 lock held by syz.0.15/4173: #0: ffff88802ed0d8e0 (&oi->ip_alloc_sem){++++}-{3:3}, at: ocfs2_fiemap+0x1e9/0xa60 fs/ocfs2/extent_map.c:757 stack backtrace: CPU: 1 PID: 4173 Comm: syz.0.15 Not tainted 5.11.0-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call Trace: __dump_stack lib/dump_stack.c:79 [inline] dump_stack+0x9a/0xcc lib/dump_stack.c:120 check_noncircular+0x263/0x2e0 kernel/locking/lockdep.c:2117 check_prev_add+0x163/0x20f0 kernel/locking/lockdep.c:2868 check_prevs_add kernel/locking/lockdep.c:2993 [inline] validate_chain kernel/locking/lockdep.c:3608 [inline] __lock_acquire+0x2872/0x35d0 kernel/locking/lockdep.c:4832 lock_acquire kernel/locking/lockdep.c:5442 [inline] lock_acquire+0x1a8/0x730 kernel/locking/lockdep.c:5407 __might_fault mm/memory.c:5019 [inline] __might_fault+0xe8/0x160 mm/memory.c:5004 _copy_to_user+0x20/0xd0 lib/usercopy.c:28 copy_to_user include/linux/uaccess.h:200 [inline] fiemap_fill_next_extent+0x18d/0x320 fs/ioctl.c:141 ocfs2_fiemap+0x4cc/0xa60 fs/ocfs2/extent_map.c:798 ioctl_fiemap fs/ioctl.c:216 [inline] do_vfs_ioctl+0x1fd/0xe10 fs/ioctl.c:705 __do_sys_ioctl fs/ioctl.c:751 [inline] __se_sys_ioctl fs/ioctl.c:739 [inline] __x64_sys_ioctl+0xc5/0x190 fs/ioctl.c:739 do_syscall_64+0x34/0x50 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x7fd31af1fff9 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:00007fd31a9a1038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007fd31b0d7f80 RCX: 00007fd31af1fff9 RDX: 00000000200001c0 RSI: 00000000c020660b RDI: 0000000000000005 RBP: 00007fd31af92296 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fd31b0d7f80 R15: 00007ffdc5fda738