====================================================== WARNING: possible circular locking dependency detected 6.6.0-rc3-syzkaller-00044-g633b47cb009d #0 Not tainted ------------------------------------------------------ syz-executor.0/13683 is trying to acquire lock: ffff888081680860 (&ni->ni_lock){+.+.}-{3:3}, at: ntfs_set_state+0x212/0x730 fs/ntfs3/fsntfs.c:946 but task is already holding lock: ffff8880815c25e0 (&ni->ni_lock/4){+.+.}-{3:3}, at: ni_lock fs/ntfs3/ntfs_fs.h:1124 [inline] ffff8880815c25e0 (&ni->ni_lock/4){+.+.}-{3:3}, at: ntfs_rename+0x6ff/0xc90 fs/ntfs3/namei.c:317 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&ni->ni_lock/4){+.+.}-{3:3}: __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x136/0xd60 kernel/locking/mutex.c:747 ni_lock fs/ntfs3/ntfs_fs.h:1124 [inline] mi_read+0x2e1/0x5a0 fs/ntfs3/record.c:148 ntfs_read_mft fs/ntfs3/inode.c:70 [inline] ntfs_iget5+0x47d/0x38e0 fs/ntfs3/inode.c:532 ni_update_parent+0x806/0xc80 fs/ntfs3/frecord.c:3212 ni_write_inode+0xe41/0x1070 fs/ntfs3/frecord.c:3312 write_inode fs/fs-writeback.c:1456 [inline] __writeback_single_inode+0x69b/0xfa0 fs/fs-writeback.c:1673 writeback_single_inode+0x21b/0x790 fs/fs-writeback.c:1729 write_inode_now+0x1d3/0x260 fs/fs-writeback.c:2771 ntfs_extend+0x388/0x480 fs/ntfs3/file.c:355 ntfs_file_write_iter+0x308/0x6d0 fs/ntfs3/file.c:1076 call_write_iter include/linux/fs.h:1956 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x782/0xaf0 fs/read_write.c:584 ksys_write+0x1a0/0x2c0 fs/read_write.c:637 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 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:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain kernel/locking/lockdep.c:3868 [inline] __lock_acquire+0x39ff/0x7f70 kernel/locking/lockdep.c:5136 lock_acquire+0x1e3/0x520 kernel/locking/lockdep.c:5753 __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x136/0xd60 kernel/locking/mutex.c:747 ntfs_set_state+0x212/0x730 fs/ntfs3/fsntfs.c:946 ni_remove_name+0x2c0/0x9b0 fs/ntfs3/frecord.c:2926 ni_rename+0x142/0x1e0 fs/ntfs3/frecord.c:3089 ntfs_rename+0x778/0xc90 fs/ntfs3/namei.c:322 vfs_rename+0xaba/0xde0 fs/namei.c:4860 do_renameat2+0xd78/0x1660 fs/namei.c:5012 __do_sys_renameat2 fs/namei.c:5045 [inline] __se_sys_renameat2 fs/namei.c:5042 [inline] __x64_sys_renameat2+0xd2/0xe0 fs/namei.c:5042 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 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.0/13683: #0: ffff888037676410 (sb_writers#16){.+.+}-{0:0}, at: mnt_want_write+0x3f/0x90 fs/namespace.c:403 #1: ffff8880815c0b00 (&type->i_mutex_dir_key#10/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:837 [inline] #1: ffff8880815c0b00 (&type->i_mutex_dir_key#10/1){+.+.}-{3:3}, at: lock_rename fs/namei.c:3045 [inline] #1: ffff8880815c0b00 (&type->i_mutex_dir_key#10/1){+.+.}-{3:3}, at: do_renameat2+0x615/0x1660 fs/namei.c:4951 #2: ffff8880815c2880 (&sb->s_type->i_mutex_key#23){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:837 [inline] #2: ffff8880815c2880 (&sb->s_type->i_mutex_key#23){+.+.}-{3:3}, at: lock_two_inodes+0x100/0x180 fs/inode.c:1127 #3: ffff8880815c0860 (&ni->ni_lock/5){+.+.}-{3:3}, at: ni_lock_dir fs/ntfs3/ntfs_fs.h:1129 [inline] #3: ffff8880815c0860 (&ni->ni_lock/5){+.+.}-{3:3}, at: ntfs_rename+0x6e4/0xc90 fs/ntfs3/namei.c:316 #4: ffff8880815c25e0 (&ni->ni_lock/4){+.+.}-{3:3}, at: ni_lock fs/ntfs3/ntfs_fs.h:1124 [inline] #4: ffff8880815c25e0 (&ni->ni_lock/4){+.+.}-{3:3}, at: ntfs_rename+0x6ff/0xc90 fs/ntfs3/namei.c:317 stack backtrace: CPU: 0 PID: 13683 Comm: syz-executor.0 Not tainted 6.6.0-rc3-syzkaller-00044-g633b47cb009d #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/06/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106 check_noncircular+0x375/0x4a0 kernel/locking/lockdep.c:2187 check_prev_add kernel/locking/lockdep.c:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain kernel/locking/lockdep.c:3868 [inline] __lock_acquire+0x39ff/0x7f70 kernel/locking/lockdep.c:5136 lock_acquire+0x1e3/0x520 kernel/locking/lockdep.c:5753 __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x136/0xd60 kernel/locking/mutex.c:747 ntfs_set_state+0x212/0x730 fs/ntfs3/fsntfs.c:946 ni_remove_name+0x2c0/0x9b0 fs/ntfs3/frecord.c:2926 ni_rename+0x142/0x1e0 fs/ntfs3/frecord.c:3089 ntfs_rename+0x778/0xc90 fs/ntfs3/namei.c:322 vfs_rename+0xaba/0xde0 fs/namei.c:4860 do_renameat2+0xd78/0x1660 fs/namei.c:5012 __do_sys_renameat2 fs/namei.c:5045 [inline] __se_sys_renameat2 fs/namei.c:5042 [inline] __x64_sys_renameat2+0xd2/0xe0 fs/namei.c:5042 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f66bdc7cae9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 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 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f66be9550c8 EFLAGS: 00000246 ORIG_RAX: 000000000000013c RAX: ffffffffffffffda RBX: 00007f66bdd9bf80 RCX: 00007f66bdc7cae9 RDX: 0000000000000006 RSI: 00000000200001c0 RDI: 0000000000000006 RBP: 00007f66bdcc847a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000020000200 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f66bdd9bf80 R15: 00007ffd1bd94cb8 ntfs3: loop0: ino=1d, "file1" failed to open parent directory r=8700001b to update