====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ syz.5.477/9058 is trying to acquire lock: ffff8880638b87d0 (&ocfs2_file_ip_alloc_sem_key){++++}-{4:4}, at: ocfs2_page_mkwrite+0x301/0xc50 fs/ocfs2/mmap.c:142 but task is already holding lock: ffff88805c962600 (sb_pagefaults#2){.+.+}-{0:0}, at: do_page_mkwrite+0x14d/0x310 mm/memory.c:3361 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (sb_pagefaults#2){.+.+}-{0:0}: lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5868 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+0x1dc/0xc50 fs/ocfs2/mmap.c:122 do_page_mkwrite+0x14d/0x310 mm/memory.c:3361 do_shared_fault mm/memory.c:5649 [inline] do_fault mm/memory.c:5711 [inline] do_pte_missing mm/memory.c:4234 [inline] handle_pte_fault mm/memory.c:6052 [inline] __handle_mm_fault mm/memory.c:6195 [inline] handle_mm_fault+0x124b/0x3400 mm/memory.c:6364 do_user_addr_fault+0x764/0x1390 arch/x86/mm/fault.c:1387 handle_page_fault arch/x86/mm/fault.c:1476 [inline] exc_page_fault+0x76/0xf0 arch/x86/mm/fault.c:1532 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 rep_movs_alternative+0x4a/0x90 arch/x86/lib/copy_user_64.S:68 copy_user_generic arch/x86/include/asm/uaccess_64.h:126 [inline] raw_copy_to_user arch/x86/include/asm/uaccess_64.h:147 [inline] _inline_copy_to_user include/linux/uaccess.h:197 [inline] _copy_to_user+0x8a/0xb0 lib/usercopy.c:26 copy_to_user include/linux/uaccess.h:225 [inline] rng_dev_read+0x3ef/0x770 drivers/char/hw_random/core.c:258 do_loop_readv_writev fs/read_write.c:847 [inline] vfs_readv+0x5b3/0x850 fs/read_write.c:1020 do_preadv fs/read_write.c:1132 [inline] __do_sys_preadv fs/read_write.c:1179 [inline] __se_sys_preadv fs/read_write.c:1174 [inline] __x64_sys_preadv+0x19a/0x2a0 fs/read_write.c:1174 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #1 (&mm->mmap_lock){++++}-{4:4}: lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5868 __might_fault+0xcc/0x130 mm/memory.c:6958 _inline_copy_to_user include/linux/uaccess.h:192 [inline] _copy_to_user+0x2c/0xb0 lib/usercopy.c:26 copy_to_user include/linux/uaccess.h:225 [inline] fiemap_fill_next_extent+0x1c0/0x390 fs/ioctl.c:145 ocfs2_fiemap_inline fs/ocfs2/extent_map.c:735 [inline] ocfs2_fiemap+0x9dc/0xc90 fs/ocfs2/extent_map.c:772 ioctl_fiemap fs/ioctl.c:220 [inline] do_vfs_ioctl+0x1188/0x1440 fs/ioctl.c:532 __do_sys_ioctl fs/ioctl.c:596 [inline] __se_sys_ioctl+0x82/0x170 fs/ioctl.c:584 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #0 (&ocfs2_file_ip_alloc_sem_key){++++}-{4:4}: check_prev_add kernel/locking/lockdep.c:3165 [inline] check_prevs_add kernel/locking/lockdep.c:3284 [inline] validate_chain+0xb9b/0x2140 kernel/locking/lockdep.c:3908 __lock_acquire+0xab9/0xd20 kernel/locking/lockdep.c:5237 lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5868 down_write+0x3a/0x50 kernel/locking/rwsem.c:1590 ocfs2_page_mkwrite+0x301/0xc50 fs/ocfs2/mmap.c:142 do_page_mkwrite+0x14d/0x310 mm/memory.c:3361 do_shared_fault mm/memory.c:5649 [inline] do_fault mm/memory.c:5711 [inline] do_pte_missing mm/memory.c:4234 [inline] handle_pte_fault mm/memory.c:6052 [inline] __handle_mm_fault mm/memory.c:6195 [inline] handle_mm_fault+0x124b/0x3400 mm/memory.c:6364 do_user_addr_fault+0x764/0x1390 arch/x86/mm/fault.c:1387 handle_page_fault arch/x86/mm/fault.c:1476 [inline] exc_page_fault+0x76/0xf0 arch/x86/mm/fault.c:1532 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 rep_movs_alternative+0x4a/0x90 arch/x86/lib/copy_user_64.S:68 copy_user_generic arch/x86/include/asm/uaccess_64.h:126 [inline] raw_copy_to_user arch/x86/include/asm/uaccess_64.h:147 [inline] _inline_copy_to_user include/linux/uaccess.h:197 [inline] _copy_to_user+0x8a/0xb0 lib/usercopy.c:26 copy_to_user include/linux/uaccess.h:225 [inline] rng_dev_read+0x3ef/0x770 drivers/char/hw_random/core.c:258 do_loop_readv_writev fs/read_write.c:847 [inline] vfs_readv+0x5b3/0x850 fs/read_write.c:1020 do_preadv fs/read_write.c:1132 [inline] __do_sys_preadv fs/read_write.c:1179 [inline] __se_sys_preadv fs/read_write.c:1174 [inline] __x64_sys_preadv+0x19a/0x2a0 fs/read_write.c:1174 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 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: &ocfs2_file_ip_alloc_sem_key --> &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(&ocfs2_file_ip_alloc_sem_key); *** DEADLOCK *** 2 locks held by syz.5.477/9058: #0: ffff8880320a0250 (&mm->mmap_lock){++++}-{4:4}, at: mmap_read_trylock include/linux/mmap_lock.h:472 [inline] #0: ffff8880320a0250 (&mm->mmap_lock){++++}-{4:4}, at: get_mmap_lock_carefully mm/mmap_lock.c:277 [inline] #0: ffff8880320a0250 (&mm->mmap_lock){++++}-{4:4}, at: lock_mm_and_find_vma+0x32/0x300 mm/mmap_lock.c:337 #1: ffff88805c962600 (sb_pagefaults#2){.+.+}-{0:0}, at: do_page_mkwrite+0x14d/0x310 mm/memory.c:3361 stack backtrace: CPU: 0 UID: 0 PID: 9058 Comm: syz.5.477 Not tainted syzkaller #0 PREEMPT_{RT,(full)} Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025 Call Trace: dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120 print_circular_bug+0x2ee/0x310 kernel/locking/lockdep.c:2043 check_noncircular+0x134/0x160 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+0xb9b/0x2140 kernel/locking/lockdep.c:3908 __lock_acquire+0xab9/0xd20 kernel/locking/lockdep.c:5237 lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5868 down_write+0x3a/0x50 kernel/locking/rwsem.c:1590 ocfs2_page_mkwrite+0x301/0xc50 fs/ocfs2/mmap.c:142 do_page_mkwrite+0x14d/0x310 mm/memory.c:3361 do_shared_fault mm/memory.c:5649 [inline] do_fault mm/memory.c:5711 [inline] do_pte_missing mm/memory.c:4234 [inline] handle_pte_fault mm/memory.c:6052 [inline] __handle_mm_fault mm/memory.c:6195 [inline] handle_mm_fault+0x124b/0x3400 mm/memory.c:6364 do_user_addr_fault+0x764/0x1390 arch/x86/mm/fault.c:1387 handle_page_fault arch/x86/mm/fault.c:1476 [inline] exc_page_fault+0x76/0xf0 arch/x86/mm/fault.c:1532 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 RIP: 0010:rep_movs_alternative+0x4a/0x90 arch/x86/lib/copy_user_64.S:74 Code: d4 04 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 00 48 8b 06 48 89 07 48 83 c6 08 48 83 c7 08 83 e9 08 74 db 83 f9 08 73 e8 eb c5 a4 e9 8f d4 04 00 48 8b 06 48 89 07 48 8d 47 08 48 83 e0 f8 48 RSP: 0018:ffffc90005057ae8 EFLAGS: 00050246 RAX: ffffffff84b78e01 RBX: 0000000000000040 RCX: 0000000000000040 RDX: 0000000000000000 RSI: ffffc90005057b80 RDI: 0000200000037a00 RBP: ffffc90005057c30 R08: ffffc90005057bbf R09: 1ffff92000a0af77 R10: dffffc0000000000 R11: fffff52000a0af78 R12: 0000200000037a40 R13: 00007ffffffff000 R14: ffffc90005057b80 R15: 0000200000037a00 copy_user_generic arch/x86/include/asm/uaccess_64.h:126 [inline] raw_copy_to_user arch/x86/include/asm/uaccess_64.h:147 [inline] _inline_copy_to_user include/linux/uaccess.h:197 [inline] _copy_to_user+0x8a/0xb0 lib/usercopy.c:26 copy_to_user include/linux/uaccess.h:225 [inline] rng_dev_read+0x3ef/0x770 drivers/char/hw_random/core.c:258 do_loop_readv_writev fs/read_write.c:847 [inline] vfs_readv+0x5b3/0x850 fs/read_write.c:1020 do_preadv fs/read_write.c:1132 [inline] __do_sys_preadv fs/read_write.c:1179 [inline] __se_sys_preadv fs/read_write.c:1174 [inline] __x64_sys_preadv+0x19a/0x2a0 fs/read_write.c:1174 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f1f0d27ebe9 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:00007f1f0b4e6038 EFLAGS: 00000246 ORIG_RAX: 0000000000000127 RAX: ffffffffffffffda RBX: 00007f1f0d4a5fa0 RCX: 00007f1f0d27ebe9 RDX: 0000000000000001 RSI: 0000200000000240 RDI: 0000000000000005 RBP: 00007f1f0d301e19 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f1f0d4a6038 R14: 00007f1f0d4a5fa0 R15: 00007ffeb5d2c478 ---------------- Code disassembly (best guess), 1 bytes skipped: 0: 04 00 add $0x0,%al 2: 66 2e 0f 1f 84 00 00 cs nopw 0x0(%rax,%rax,1) 9: 00 00 00 c: 0f 1f 00 nopl (%rax) f: 48 8b 06 mov (%rsi),%rax 12: 48 89 07 mov %rax,(%rdi) 15: 48 83 c6 08 add $0x8,%rsi 19: 48 83 c7 08 add $0x8,%rdi 1d: 83 e9 08 sub $0x8,%ecx 20: 74 db je 0xfffffffd 22: 83 f9 08 cmp $0x8,%ecx 25: 73 e8 jae 0xf 27: eb c5 jmp 0xffffffee * 29: f3 a4 rep movsb %ds:(%rsi),%es:(%rdi) <-- trapping instruction 2b: e9 8f d4 04 00 jmp 0x4d4bf 30: 48 8b 06 mov (%rsi),%rax 33: 48 89 07 mov %rax,(%rdi) 36: 48 8d 47 08 lea 0x8(%rdi),%rax 3a: 48 83 e0 f8 and $0xfffffffffffffff8,%rax 3e: 48 rex.W