loop4: detected capacity change from 0 to 4096 ntfs3: loop4: Different NTFS' sector size (2048) and media sector size (512) ====================================================== WARNING: possible circular locking dependency detected 6.1.27-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.4/20136 is trying to acquire lock: ffff88802abb3c00 (&ni->ni_lock){+.+.}-{3:3}, at: ntfs_set_state+0x217/0x6f0 fs/ntfs3/fsntfs.c:920 but task is already holding lock: ffff88803508cac0 (&ni->ni_lock/4){+.+.}-{3:3}, at: ni_lock fs/ntfs3/ntfs_fs.h:1108 [inline] ffff88803508cac0 (&ni->ni_lock/4){+.+.}-{3:3}, at: ntfs_rename+0x710/0xd10 fs/ntfs3/namei.c:305 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&ni->ni_lock/4){+.+.}-{3:3}: lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5669 __mutex_lock_common+0x1d4/0x2520 kernel/locking/mutex.c:603 __mutex_lock kernel/locking/mutex.c:747 [inline] mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:799 ni_lock fs/ntfs3/ntfs_fs.h:1108 [inline] mi_read+0x2f2/0x560 fs/ntfs3/record.c:148 ntfs_read_mft fs/ntfs3/inode.c:69 [inline] ntfs_iget5+0x453/0x3760 fs/ntfs3/inode.c:517 ni_update_parent+0x802/0xc80 fs/ntfs3/frecord.c:3196 ni_write_inode+0xe7a/0x1240 fs/ntfs3/frecord.c:3291 ntfs_truncate fs/ntfs3/file.c:508 [inline] ntfs3_setattr+0x7c2/0xb70 fs/ntfs3/file.c:792 notify_change+0xdcd/0x1080 fs/attr.c:482 do_truncate+0x21c/0x300 fs/open.c:65 handle_truncate fs/namei.c:3216 [inline] do_open fs/namei.c:3561 [inline] path_openat+0x27e2/0x2e60 fs/namei.c:3714 do_filp_open+0x230/0x480 fs/namei.c:3741 do_sys_openat2+0x13b/0x500 fs/open.c:1310 do_sys_open fs/open.c:1326 [inline] __do_sys_creat fs/open.c:1402 [inline] __se_sys_creat fs/open.c:1396 [inline] __x64_sys_creat+0x11f/0x160 fs/open.c:1396 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd -> #0 (&ni->ni_lock){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3098 [inline] check_prevs_add kernel/locking/lockdep.c:3217 [inline] validate_chain+0x1667/0x58e0 kernel/locking/lockdep.c:3832 __lock_acquire+0x125b/0x1f80 kernel/locking/lockdep.c:5056 lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5669 __mutex_lock_common+0x1d4/0x2520 kernel/locking/mutex.c:603 __mutex_lock kernel/locking/mutex.c:747 [inline] mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:799 ntfs_set_state+0x217/0x6f0 fs/ntfs3/fsntfs.c:920 ni_remove_name+0x2bc/0x9a0 fs/ntfs3/frecord.c:2921 ni_rename+0x13e/0x1e0 fs/ntfs3/frecord.c:3073 ntfs_rename+0x74a/0xd10 fs/ntfs3/namei.c:308 vfs_rename+0xd8f/0x1190 fs/namei.c:4779 do_renameat2+0xb97/0x13b0 fs/namei.c:4930 __do_sys_renameat2 fs/namei.c:4963 [inline] __se_sys_renameat2 fs/namei.c:4960 [inline] __x64_sys_renameat2+0xce/0xe0 fs/namei.c:4960 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&ni->ni_lock/4); lock(&ni->ni_lock); lock(&ni->ni_lock/4); lock(&ni->ni_lock); *** DEADLOCK *** 5 locks held by syz-executor.4/20136: #0: ffff88807ee0a460 (sb_writers#26){.+.+}-{0:0}, at: mnt_want_write+0x3b/0x80 fs/namespace.c:393 #1: ffff88802abb4d60 (&type->i_mutex_dir_key#13/1){+.+.}-{3:3}, at: lock_rename+0x182/0x1a0 #2: ffff88803508cd60 (&sb->s_type->i_mutex_key#33/4){+.+.}-{3:3}, at: vfs_rename+0x825/0x1190 fs/namei.c:4749 #3: ffff88802abb4ac0 (&ni->ni_lock/5){+.+.}-{3:3}, at: ni_lock_dir fs/ntfs3/ntfs_fs.h:1113 [inline] #3: ffff88802abb4ac0 (&ni->ni_lock/5){+.+.}-{3:3}, at: ntfs_rename+0x6fa/0xd10 fs/ntfs3/namei.c:304 #4: ffff88803508cac0 (&ni->ni_lock/4){+.+.}-{3:3}, at: ni_lock fs/ntfs3/ntfs_fs.h:1108 [inline] #4: ffff88803508cac0 (&ni->ni_lock/4){+.+.}-{3:3}, at: ntfs_rename+0x710/0xd10 fs/ntfs3/namei.c:305 stack backtrace: CPU: 1 PID: 20136 Comm: syz-executor.4 Not tainted 6.1.27-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/14/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106 check_noncircular+0x2fa/0x3b0 kernel/locking/lockdep.c:2178 check_prev_add kernel/locking/lockdep.c:3098 [inline] check_prevs_add kernel/locking/lockdep.c:3217 [inline] validate_chain+0x1667/0x58e0 kernel/locking/lockdep.c:3832 __lock_acquire+0x125b/0x1f80 kernel/locking/lockdep.c:5056 lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5669 __mutex_lock_common+0x1d4/0x2520 kernel/locking/mutex.c:603 __mutex_lock kernel/locking/mutex.c:747 [inline] mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:799 ntfs_set_state+0x217/0x6f0 fs/ntfs3/fsntfs.c:920 ni_remove_name+0x2bc/0x9a0 fs/ntfs3/frecord.c:2921 ni_rename+0x13e/0x1e0 fs/ntfs3/frecord.c:3073 ntfs_rename+0x74a/0xd10 fs/ntfs3/namei.c:308 vfs_rename+0xd8f/0x1190 fs/namei.c:4779 do_renameat2+0xb97/0x13b0 fs/namei.c:4930 __do_sys_renameat2 fs/namei.c:4963 [inline] __se_sys_renameat2 fs/namei.c:4960 [inline] __x64_sys_renameat2+0xce/0xe0 fs/namei.c:4960 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f80de68c169 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 00 00 90 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 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f80df396168 EFLAGS: 00000246 ORIG_RAX: 000000000000013c RAX: ffffffffffffffda RBX: 00007f80de7abf80 RCX: 00007f80de68c169 RDX: 0000000000000004 RSI: 0000000020000080 RDI: ffffffffffffff9c RBP: 00007f80de6e7ca1 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000020000180 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fff60ecb43f R14: 00007f80df396300 R15: 0000000000022000