============================================ WARNING: possible recursive locking detected 5.15.176-syzkaller #0 Not tainted -------------------------------------------- syz.6.1530/10086 is trying to acquire lock: ffff88805ce2b4a0 (&ni->ni_lock/5){+.+.}-{3:3}, at: ni_lock fs/ntfs3/ntfs_fs.h:1100 [inline] ffff88805ce2b4a0 (&ni->ni_lock/5){+.+.}-{3:3}, at: mi_read+0x2dd/0x5a0 fs/ntfs3/record.c:148 but task is already holding lock: ffff88805cfe8100 (&ni->ni_lock/5){+.+.}-{3:3}, at: ni_lock fs/ntfs3/ntfs_fs.h:1100 [inline] (&ni->ni_lock/5){+.+.}-{3:3}, at: ntfs_rename+0x710/0xd40 fs/ntfs3/namei.c:315 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&ni->ni_lock/5); lock(&ni->ni_lock/5); *** DEADLOCK *** May be due to missing lock nesting notation 6 locks held by syz.6.1530/10086: #0: ffff88807c33e460 (sb_writers#17){.+.+}-{0:0} , at: mnt_want_write+0x3b/0x80 fs/namespace.c:377 #1: ffff88805cfef9a0 (&type->i_mutex_dir_key#11 /1){+.+.}-{3:3}, at: do_renameat2+0x67e/0x1700 fs/namei.c:4924 #2: ffff88805cfe83a0 (&sb->s_type->i_mutex_key#22/4){+.+.}-{3:3} , at: vfs_rename+0x7e4/0x10f0 fs/namei.c:4803 #3: ffff88805cfef700 (&ni->ni_lock/6){+.+.}-{3:3}, at: ni_lock_dir fs/ntfs3/ntfs_fs.h:1105 [inline] #3: ffff88805cfef700 (&ni->ni_lock/6){+.+.}-{3:3}, at: ntfs_rename+0x6fa/0xd40 fs/ntfs3/namei.c:314 #4: ffff88805cfe8100 (&ni->ni_lock/5){+.+.}-{3:3}, at: ni_lock fs/ntfs3/ntfs_fs.h:1100 [inline] #4: ffff88805cfe8100 (&ni->ni_lock/5){+.+.}-{3:3}, at: ntfs_rename+0x710/0xd40 fs/ntfs3/namei.c:315 #5: ffff88807cdfa120 (&wnd->rw_lock/1){+.+.}-{3:3}, at: ntfs_look_free_mft+0x1e7/0xff0 fs/ntfs3/fsntfs.c:542 stack backtrace: CPU: 1 PID: 10086 Comm: syz.6.1530 Not tainted 5.15.176-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106 print_deadlock_bug kernel/locking/lockdep.c:2946 [inline] check_deadlock kernel/locking/lockdep.c:2989 [inline] validate_chain+0x46d2/0x5930 kernel/locking/lockdep.c:3775 __lock_acquire+0x1295/0x1ff0 kernel/locking/lockdep.c:5012 lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623 __mutex_lock_common+0x1da/0x25a0 kernel/locking/mutex.c:596 __mutex_lock kernel/locking/mutex.c:729 [inline] mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743 ni_lock fs/ntfs3/ntfs_fs.h:1100 [inline] mi_read+0x2dd/0x5a0 fs/ntfs3/record.c:148 mi_format_new+0x1a7/0x5c0 fs/ntfs3/record.c:374 ni_add_subrecord+0xde/0x430 fs/ntfs3/frecord.c:372 ntfs_look_free_mft+0x7f1/0xff0 fs/ntfs3/fsntfs.c:686 ni_create_attr_list+0x9b6/0x1470 fs/ntfs3/frecord.c:850 ni_ins_attr_ext+0x364/0xb30 fs/ntfs3/frecord.c:951 ni_insert_attr fs/ntfs3/frecord.c:1105 [inline] ni_insert_resident fs/ntfs3/frecord.c:1479 [inline] ni_add_name+0x689/0x9d0 fs/ntfs3/frecord.c:2985 ni_rename+0xbe/0x1e0 fs/ntfs3/frecord.c:3025 ntfs_rename+0x74a/0xd40 fs/ntfs3/namei.c:318 vfs_rename+0xd32/0x10f0 fs/namei.c:4832 do_renameat2+0xe0f/0x1700 fs/namei.c:4985 __do_sys_rename fs/namei.c:5031 [inline] __se_sys_rename fs/namei.c:5029 [inline] __x64_sys_rename+0x82/0x90 fs/namei.c:5029 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7fd5d4f44d29 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:00007fd5d2db5038 EFLAGS: 00000246 ORIG_RAX: 0000000000000052 RAX: ffffffffffffffda RBX: 00007fd5d5134fa0 RCX: 00007fd5d4f44d29 RDX: 0000000000000000 RSI: 0000000020000480 RDI: 0000000020000340 RBP: 00007fd5d4fc0b08 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fd5d5134fa0 R15: 00007ffda90c6438