====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ syz.6.17516/13895 is trying to acquire lock: ffff88807fc54270 (&wnd->rw_lock){++++}-{4:4}, at: ntfs_look_for_free_space+0xcc/0x720 fs/ntfs3/fsntfs.c:362 but task is already holding lock: ffff888054b07630 (&ni->file.run_lock#2){++++}-{4:4}, at: ntfs_set_size+0x119/0x220 fs/ntfs3/inode.c:859 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&ni->file.run_lock#2){++++}-{4:4}: down_read+0x9b/0x480 kernel/locking/rwsem.c:1537 run_unpack_ex+0x671/0x740 fs/ntfs3/run.c:1119 ntfs_read_mft fs/ntfs3/inode.c:401 [inline] ntfs_iget5+0xd97/0x3ab0 fs/ntfs3/inode.c:540 dir_search_u+0x163/0x3a0 fs/ntfs3/dir.c:264 ntfs_lookup+0x1c5/0x2a0 fs/ntfs3/namei.c:85 __lookup_slow+0x251/0x460 fs/namei.c:1816 lookup_slow fs/namei.c:1833 [inline] walk_component+0x353/0x5b0 fs/namei.c:2151 lookup_last fs/namei.c:2652 [inline] path_lookupat+0x142/0x6d0 fs/namei.c:2676 filename_lookup+0x224/0x5f0 fs/namei.c:2705 user_path_at+0x3a/0x60 fs/namei.c:3215 do_sys_truncate fs/open.c:139 [inline] __do_sys_truncate fs/open.c:153 [inline] __se_sys_truncate fs/open.c:151 [inline] __x64_sys_truncate+0xf6/0x1e0 fs/open.c:151 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0x4e0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #0 (&wnd->rw_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 down_write_nested+0x96/0x210 kernel/locking/rwsem.c:1706 ntfs_look_for_free_space+0xcc/0x720 fs/ntfs3/fsntfs.c:362 attr_allocate_clusters+0x3ff/0x6f0 fs/ntfs3/attrib.c:159 attr_set_size+0x15ae/0x2c50 fs/ntfs3/attrib.c:574 ntfs_set_size+0x13d/0x220 fs/ntfs3/inode.c:861 ntfs_extend+0x897/0xa20 fs/ntfs3/file.c:359 ntfs_file_write_iter+0x2ff/0x2120 fs/ntfs3/file.c:1220 new_sync_write fs/read_write.c:593 [inline] vfs_write+0x7d3/0x11d0 fs/read_write.c:686 ksys_pwrite64 fs/read_write.c:793 [inline] __do_sys_pwrite64 fs/read_write.c:801 [inline] __se_sys_pwrite64 fs/read_write.c:798 [inline] __x64_sys_pwrite64+0x1eb/0x250 fs/read_write.c:798 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0x4e0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&ni->file.run_lock#2); lock(&wnd->rw_lock); lock(&ni->file.run_lock#2); lock(&wnd->rw_lock); *** DEADLOCK *** 4 locks held by syz.6.17516/13895: #0: ffff8880523bc428 (sb_writers#17){.+.+}-{0:0}, at: ksys_pwrite64 fs/read_write.c:793 [inline] #0: ffff8880523bc428 (sb_writers#17){.+.+}-{0:0}, at: __do_sys_pwrite64 fs/read_write.c:801 [inline] #0: ffff8880523bc428 (sb_writers#17){.+.+}-{0:0}, at: __se_sys_pwrite64 fs/read_write.c:798 [inline] #0: ffff8880523bc428 (sb_writers#17){.+.+}-{0:0}, at: __x64_sys_pwrite64+0x1eb/0x250 fs/read_write.c:798 #1: ffff888054b07818 (&sb->s_type->i_mutex_key#29){+.+.}-{4:4}, at: inode_trylock include/linux/fs.h:1009 [inline] #1: ffff888054b07818 (&sb->s_type->i_mutex_key#29){+.+.}-{4:4}, at: ntfs_file_write_iter+0xdf/0x2120 fs/ntfs3/file.c:1188 #2: ffff888054b07580 (&ni->ni_lock#2/5){+.+.}-{4:4}, at: ni_lock fs/ntfs3/ntfs_fs.h:1113 [inline] #2: ffff888054b07580 (&ni->ni_lock#2/5){+.+.}-{4:4}, at: ntfs_set_size+0x111/0x220 fs/ntfs3/inode.c:858 #3: ffff888054b07630 (&ni->file.run_lock#2){++++}-{4:4}, at: ntfs_set_size+0x119/0x220 fs/ntfs3/inode.c:859 stack backtrace: CPU: 1 UID: 0 PID: 13895 Comm: syz.6.17516 Not tainted syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/18/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 down_write_nested+0x96/0x210 kernel/locking/rwsem.c:1706 ntfs_look_for_free_space+0xcc/0x720 fs/ntfs3/fsntfs.c:362 attr_allocate_clusters+0x3ff/0x6f0 fs/ntfs3/attrib.c:159 attr_set_size+0x15ae/0x2c50 fs/ntfs3/attrib.c:574 ntfs_set_size+0x13d/0x220 fs/ntfs3/inode.c:861 ntfs_extend+0x897/0xa20 fs/ntfs3/file.c:359 ntfs_file_write_iter+0x2ff/0x2120 fs/ntfs3/file.c:1220 new_sync_write fs/read_write.c:593 [inline] vfs_write+0x7d3/0x11d0 fs/read_write.c:686 ksys_pwrite64 fs/read_write.c:793 [inline] __do_sys_pwrite64 fs/read_write.c:801 [inline] __se_sys_pwrite64 fs/read_write.c:798 [inline] __x64_sys_pwrite64+0x1eb/0x250 fs/read_write.c:798 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0x4e0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fe8b038eec9 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:00007fe8b1158038 EFLAGS: 00000246 ORIG_RAX: 0000000000000012 RAX: ffffffffffffffda RBX: 00007fe8b05e5fa0 RCX: 00007fe8b038eec9 RDX: 0000000000000001 RSI: 0000200000000000 RDI: 0000000000000004 RBP: 00007fe8b0411f91 R08: 0000000000000000 R09: 0000000000000000 R10: 000000000008fecc R11: 0000000000000246 R12: 0000000000000000 R13: 00007fe8b05e6038 R14: 00007fe8b05e5fa0 R15: 00007ffe85937168 ntfs3(loop6): ino=0, "file0" failed to extend initialized size to 8fecc.