loop3: detected capacity change from 0 to 4096 ====================================================== WARNING: possible circular locking dependency detected 6.1.147-syzkaller #0 Not tainted ------------------------------------------------------ syz.3.338/5521 is trying to acquire lock: ffff888070331e80 (&ni->ni_lock/5){+.+.}-{3:3}, at: ni_lock fs/ntfs3/ntfs_fs.h:1102 [inline] ffff888070331e80 (&ni->ni_lock/5){+.+.}-{3:3}, at: attr_data_get_block+0x33b/0x1b70 fs/ntfs3/attrib.c:951 but task is already holding lock: ffff8880703322c0 (mapping.invalidate_lock#5){.+.+}-{3:3}, at: filemap_invalidate_lock_shared include/linux/fs.h:813 [inline] ffff8880703322c0 (mapping.invalidate_lock#5){.+.+}-{3:3}, at: filemap_fault+0x53c/0x1670 mm/filemap.c:3220 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (mapping.invalidate_lock#5){.+.+}-{3:3}: down_read+0x42/0x2d0 kernel/locking/rwsem.c:1520 filemap_invalidate_lock_shared include/linux/fs.h:813 [inline] filemap_fault+0x53c/0x1670 mm/filemap.c:3220 __do_fault+0x13b/0x4e0 mm/memory.c:4280 do_read_fault mm/memory.c:4631 [inline] do_fault mm/memory.c:4760 [inline] handle_pte_fault mm/memory.c:5031 [inline] __handle_mm_fault mm/memory.c:5173 [inline] handle_mm_fault+0x28ca/0x3e70 mm/memory.c:5294 do_user_addr_fault+0x51f/0xb10 arch/x86/mm/fault.c:1340 handle_page_fault arch/x86/mm/fault.c:1431 [inline] exc_page_fault+0x60/0x100 arch/x86/mm/fault.c:1487 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:608 fault_in_readable+0x13e/0x1f0 mm/gup.c:1914 fault_in_iov_iter_readable+0xbb/0x2e0 lib/iov_iter.c:356 generic_perform_write+0x1d2/0x560 mm/filemap.c:3836 __generic_file_write_iter+0x172/0x430 mm/filemap.c:3974 ntfs_file_write_iter+0x618/0x6f0 fs/ntfs3/file.c:1081 call_write_iter include/linux/fs.h:2265 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x44c/0x960 fs/read_write.c:584 ksys_pwrite64 fs/read_write.c:699 [inline] __do_sys_pwrite64 fs/read_write.c:709 [inline] __se_sys_pwrite64 fs/read_write.c:706 [inline] __x64_sys_pwrite64+0x191/0x220 fs/read_write.c:706 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 -> #1 (&mm->mmap_lock){++++}-{3:3}: __might_fault+0xc2/0x120 mm/memory.c:5852 _copy_to_user+0x27/0x130 lib/usercopy.c:36 copy_to_user include/linux/uaccess.h:169 [inline] ni_fiemap+0x4ec/0x1300 fs/ntfs3/frecord.c:2140 ntfs_fiemap+0xd7/0x130 fs/ntfs3/file.c:1170 ioctl_fiemap fs/ioctl.c:219 [inline] do_vfs_ioctl+0x1425/0x1d10 fs/ioctl.c:810 __do_sys_ioctl fs/ioctl.c:868 [inline] __se_sys_ioctl+0x83/0x170 fs/ioctl.c:856 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 -> #0 (&ni->ni_lock/5){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3090 [inline] check_prevs_add kernel/locking/lockdep.c:3209 [inline] validate_chain kernel/locking/lockdep.c:3825 [inline] __lock_acquire+0x2cf8/0x7c50 kernel/locking/lockdep.c:5049 lock_acquire+0x1b4/0x490 kernel/locking/lockdep.c:5662 __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x120/0xaf0 kernel/locking/mutex.c:747 ni_lock fs/ntfs3/ntfs_fs.h:1102 [inline] attr_data_get_block+0x33b/0x1b70 fs/ntfs3/attrib.c:951 ntfs_get_block_vbo+0x3e4/0xca0 fs/ntfs3/inode.c:595 block_read_full_folio+0x3c9/0xed0 fs/buffer.c:2271 do_mpage_readpage+0x1c32/0x1ea0 fs/mpage.c:304 mpage_read_folio+0xae/0x150 fs/mpage.c:379 filemap_read_folio+0x160/0x760 mm/filemap.c:2490 filemap_fault+0xdcb/0x1670 mm/filemap.c:3313 __do_fault+0x13b/0x4e0 mm/memory.c:4280 do_read_fault mm/memory.c:4631 [inline] do_fault mm/memory.c:4760 [inline] handle_pte_fault mm/memory.c:5031 [inline] __handle_mm_fault mm/memory.c:5173 [inline] handle_mm_fault+0x28ca/0x3e70 mm/memory.c:5294 do_user_addr_fault+0x51f/0xb10 arch/x86/mm/fault.c:1340 handle_page_fault arch/x86/mm/fault.c:1431 [inline] exc_page_fault+0x60/0x100 arch/x86/mm/fault.c:1487 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:608 fault_in_readable+0x13e/0x1f0 mm/gup.c:1914 fault_in_iov_iter_readable+0xbb/0x2e0 lib/iov_iter.c:356 generic_perform_write+0x1d2/0x560 mm/filemap.c:3836 __generic_file_write_iter+0x172/0x430 mm/filemap.c:3974 ntfs_file_write_iter+0x618/0x6f0 fs/ntfs3/file.c:1081 call_write_iter include/linux/fs.h:2265 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x44c/0x960 fs/read_write.c:584 ksys_pwrite64 fs/read_write.c:699 [inline] __do_sys_pwrite64 fs/read_write.c:709 [inline] __se_sys_pwrite64 fs/read_write.c:706 [inline] __x64_sys_pwrite64+0x191/0x220 fs/read_write.c:706 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 other info that might help us debug this: Chain exists of: &ni->ni_lock/5 --> &mm->mmap_lock --> mapping.invalidate_lock#5 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(mapping.invalidate_lock#5); lock(&mm->mmap_lock); lock(mapping.invalidate_lock#5); lock(&ni->ni_lock/5); *** DEADLOCK *** 3 locks held by syz.3.338/5521: #0: ffff88802783c460 (sb_writers#19){.+.+}-{0:0}, at: vfs_write+0x256/0x960 fs/read_write.c:580 #1: ffff888070332120 (&sb->s_type->i_mutex_key#29){+.+.}-{3:3}, at: inode_trylock include/linux/fs.h:778 [inline] #1: ffff888070332120 (&sb->s_type->i_mutex_key#29){+.+.}-{3:3}, at: ntfs_file_write_iter+0x1f6/0x6f0 fs/ntfs3/file.c:1060 #2: ffff8880703322c0 (mapping.invalidate_lock#5){.+.+}-{3:3}, at: filemap_invalidate_lock_shared include/linux/fs.h:813 [inline] #2: ffff8880703322c0 (mapping.invalidate_lock#5){.+.+}-{3:3}, at: filemap_fault+0x53c/0x1670 mm/filemap.c:3220 stack backtrace: CPU: 0 PID: 5521 Comm: syz.3.338 Not tainted 6.1.147-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 Call Trace: dump_stack_lvl+0x168/0x22e lib/dump_stack.c:106 check_noncircular+0x274/0x310 kernel/locking/lockdep.c:2170 check_prev_add kernel/locking/lockdep.c:3090 [inline] check_prevs_add kernel/locking/lockdep.c:3209 [inline] validate_chain kernel/locking/lockdep.c:3825 [inline] __lock_acquire+0x2cf8/0x7c50 kernel/locking/lockdep.c:5049 lock_acquire+0x1b4/0x490 kernel/locking/lockdep.c:5662 __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x120/0xaf0 kernel/locking/mutex.c:747 ni_lock fs/ntfs3/ntfs_fs.h:1102 [inline] attr_data_get_block+0x33b/0x1b70 fs/ntfs3/attrib.c:951 ntfs_get_block_vbo+0x3e4/0xca0 fs/ntfs3/inode.c:595 block_read_full_folio+0x3c9/0xed0 fs/buffer.c:2271 do_mpage_readpage+0x1c32/0x1ea0 fs/mpage.c:304 mpage_read_folio+0xae/0x150 fs/mpage.c:379 filemap_read_folio+0x160/0x760 mm/filemap.c:2490 filemap_fault+0xdcb/0x1670 mm/filemap.c:3313 __do_fault+0x13b/0x4e0 mm/memory.c:4280 do_read_fault mm/memory.c:4631 [inline] do_fault mm/memory.c:4760 [inline] handle_pte_fault mm/memory.c:5031 [inline] __handle_mm_fault mm/memory.c:5173 [inline] handle_mm_fault+0x28ca/0x3e70 mm/memory.c:5294 do_user_addr_fault+0x51f/0xb10 arch/x86/mm/fault.c:1340 handle_page_fault arch/x86/mm/fault.c:1431 [inline] exc_page_fault+0x60/0x100 arch/x86/mm/fault.c:1487 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:608 RIP: 0010:fault_in_readable+0x13e/0x1f0 mm/gup.c:1915 Code: 78 eb c4 ff 4d 89 f4 49 81 cc ff 0f 00 00 4d 89 f7 49 01 dc 49 81 e4 00 f0 ff ff 4d 39 e6 77 44 e8 57 eb c4 ff 4d 39 e7 74 47 <41> 8a 07 88 44 24 07 49 81 c7 00 10 00 00 4d 39 e7 74 07 e8 3a eb RSP: 0018:ffffc90003c47a50 EFLAGS: 00050287 RAX: ffffffff81bbdb89 RBX: 0000000000001000 RCX: 0000000000080000 RDX: ffffc9000e152000 RSI: 0000000000005167 RDI: 0000000000005168 RBP: 0000000000000000 R08: ffff88807a4a1dc0 R09: 0000000000000002 R10: 0000000000000006 R11: 0000000000000002 R12: 0000200000002000 R13: dffffc0000000000 R14: 00002000000002c4 R15: 0000200000001000 fault_in_iov_iter_readable+0xbb/0x2e0 lib/iov_iter.c:356 generic_perform_write+0x1d2/0x560 mm/filemap.c:3836 __generic_file_write_iter+0x172/0x430 mm/filemap.c:3974 ntfs_file_write_iter+0x618/0x6f0 fs/ntfs3/file.c:1081 call_write_iter include/linux/fs.h:2265 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x44c/0x960 fs/read_write.c:584 ksys_pwrite64 fs/read_write.c:699 [inline] __do_sys_pwrite64 fs/read_write.c:709 [inline] __se_sys_pwrite64 fs/read_write.c:706 [inline] __x64_sys_pwrite64+0x191/0x220 fs/read_write.c:706 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7f4d11b8e9a9 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:00007f4d129cc038 EFLAGS: 00000246 ORIG_RAX: 0000000000000012 RAX: ffffffffffffffda RBX: 00007f4d11db5fa0 RCX: 00007f4d11b8e9a9 RDX: 000000000000fdef RSI: 0000200000000140 RDI: 0000000000000005 RBP: 00007f4d11c10d69 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000e7c R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f4d11db5fa0 R15: 00007ffe70c19eb8 ---------------- Code disassembly (best guess), 1 bytes skipped: 0: eb c4 jmp 0xffffffc6 2: ff 4d 89 decl -0x77(%rbp) 5: f4 hlt 6: 49 81 cc ff 0f 00 00 or $0xfff,%r12 d: 4d 89 f7 mov %r14,%r15 10: 49 01 dc add %rbx,%r12 13: 49 81 e4 00 f0 ff ff and $0xfffffffffffff000,%r12 1a: 4d 39 e6 cmp %r12,%r14 1d: 77 44 ja 0x63 1f: e8 57 eb c4 ff call 0xffc4eb7b 24: 4d 39 e7 cmp %r12,%r15 27: 74 47 je 0x70 * 29: 41 8a 07 mov (%r15),%al <-- trapping instruction 2c: 88 44 24 07 mov %al,0x7(%rsp) 30: 49 81 c7 00 10 00 00 add $0x1000,%r15 37: 4d 39 e7 cmp %r12,%r15 3a: 74 07 je 0x43 3c: e8 .byte 0xe8 3d: 3a eb cmp %bl,%ch