loop2: detected capacity change from 0 to 4096 ====================================================== WARNING: possible circular locking dependency detected 6.10.0-rc5-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.2/17821 is trying to acquire lock: ffff888076268100 (&ni->ni_lock#3){+.+.}-{3:3}, at: ntfs_set_state+0x1d2/0x6a0 fs/ntfs3/fsntfs.c:947 but task is already holding lock: ffff88804fd28860 (&ni->ni_lock/4){+.+.}-{3:3}, at: ni_lock fs/ntfs3/ntfs_fs.h:1123 [inline] ffff88804fd28860 (&ni->ni_lock/4){+.+.}-{3:3}, at: ntfs_unlink_inode+0x2d3/0x750 fs/ntfs3/inode.c:1794 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:608 [inline] __mutex_lock+0x175/0x9c0 kernel/locking/mutex.c:752 ni_lock fs/ntfs3/ntfs_fs.h:1123 [inline] mi_read+0x466/0x660 fs/ntfs3/record.c:148 ntfs_read_mft fs/ntfs3/inode.c:70 [inline] ntfs_iget5+0x4c4/0x3970 fs/ntfs3/inode.c:539 ni_update_parent fs/ntfs3/frecord.c:3218 [inline] ni_write_inode+0x1603/0x2920 fs/ntfs3/frecord.c:3324 write_inode fs/fs-writeback.c:1497 [inline] __writeback_single_inode+0xb36/0xf90 fs/fs-writeback.c:1716 writeback_single_inode+0x2b5/0x5a0 fs/fs-writeback.c:1772 write_inode_now+0x174/0x1f0 fs/fs-writeback.c:2822 ntfs_extend+0x2ec/0x570 fs/ntfs3/file.c:358 ntfs_file_write_iter+0x433/0x2050 fs/ntfs3/file.c:1124 iter_file_splice_write+0x906/0x10b0 fs/splice.c:743 do_splice_from fs/splice.c:941 [inline] direct_splice_actor+0x19b/0x6d0 fs/splice.c:1164 splice_direct_to_actor+0x346/0xa40 fs/splice.c:1108 do_splice_direct_actor fs/splice.c:1207 [inline] do_splice_direct+0x17e/0x250 fs/splice.c:1233 do_sendfile+0xb1e/0xe50 fs/read_write.c:1295 __do_sys_sendfile64 fs/read_write.c:1362 [inline] __se_sys_sendfile64 fs/read_write.c:1348 [inline] __x64_sys_sendfile64+0x1da/0x220 fs/read_write.c:1348 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #0 (&ni->ni_lock#3){+.+.}-{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:3869 [inline] __lock_acquire+0x2478/0x3b30 kernel/locking/lockdep.c:5137 lock_acquire kernel/locking/lockdep.c:5754 [inline] lock_acquire+0x1b1/0x560 kernel/locking/lockdep.c:5719 __mutex_lock_common kernel/locking/mutex.c:608 [inline] __mutex_lock+0x175/0x9c0 kernel/locking/mutex.c:752 ntfs_set_state+0x1d2/0x6a0 fs/ntfs3/fsntfs.c:947 ni_remove_name+0x2f8/0x690 fs/ntfs3/frecord.c:2926 ntfs_unlink_inode+0x37a/0x750 fs/ntfs3/inode.c:1806 ntfs_unlink+0xc7/0x120 fs/ntfs3/namei.c:181 vfs_unlink+0x2fb/0x9b0 fs/namei.c:4343 do_unlinkat+0x5c0/0x750 fs/namei.c:4407 __do_sys_unlink fs/namei.c:4455 [inline] __se_sys_unlink fs/namei.c:4453 [inline] __x64_sys_unlink+0xc7/0x110 fs/namei.c:4453 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&ni->ni_lock/4); lock(&ni->ni_lock#3); lock(&ni->ni_lock/4); lock(&ni->ni_lock#3); *** DEADLOCK *** 5 locks held by syz-executor.2/17821: #0: ffff88805082a420 (sb_writers#17){.+.+}-{0:0}, at: do_unlinkat+0x1d3/0x750 fs/namei.c:4390 #1: ffff88804fd299c0 (&type->i_mutex_dir_key#11/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:826 [inline] #1: ffff88804fd299c0 (&type->i_mutex_dir_key#11/1){+.+.}-{3:3}, at: do_unlinkat+0x288/0x750 fs/namei.c:4394 #2: ffff88804fd28b00 (&sb->s_type->i_mutex_key#29){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:791 [inline] #2: ffff88804fd28b00 (&sb->s_type->i_mutex_key#29){+.+.}-{3:3}, at: vfs_unlink+0xd3/0x9b0 fs/namei.c:4332 #3: ffff88804fd29720 (&ni->ni_lock#2/5){+.+.}-{3:3}, at: ni_lock_dir fs/ntfs3/ntfs_fs.h:1128 [inline] #3: ffff88804fd29720 (&ni->ni_lock#2/5){+.+.}-{3:3}, at: ntfs_unlink+0xbc/0x120 fs/ntfs3/namei.c:179 #4: ffff88804fd28860 (&ni->ni_lock/4){+.+.}-{3:3}, at: ni_lock fs/ntfs3/ntfs_fs.h:1123 [inline] #4: ffff88804fd28860 (&ni->ni_lock/4){+.+.}-{3:3}, at: ntfs_unlink_inode+0x2d3/0x750 fs/ntfs3/inode.c:1794 stack backtrace: CPU: 0 PID: 17821 Comm: syz-executor.2 Not tainted 6.10.0-rc5-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:114 check_noncircular+0x31a/0x400 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:3869 [inline] __lock_acquire+0x2478/0x3b30 kernel/locking/lockdep.c:5137 lock_acquire kernel/locking/lockdep.c:5754 [inline] lock_acquire+0x1b1/0x560 kernel/locking/lockdep.c:5719 __mutex_lock_common kernel/locking/mutex.c:608 [inline] __mutex_lock+0x175/0x9c0 kernel/locking/mutex.c:752 ntfs_set_state+0x1d2/0x6a0 fs/ntfs3/fsntfs.c:947 ni_remove_name+0x2f8/0x690 fs/ntfs3/frecord.c:2926 ntfs_unlink_inode+0x37a/0x750 fs/ntfs3/inode.c:1806 ntfs_unlink+0xc7/0x120 fs/ntfs3/namei.c:181 vfs_unlink+0x2fb/0x9b0 fs/namei.c:4343 do_unlinkat+0x5c0/0x750 fs/namei.c:4407 __do_sys_unlink fs/namei.c:4455 [inline] __se_sys_unlink fs/namei.c:4453 [inline] __x64_sys_unlink+0xc7/0x110 fs/namei.c:4453 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fed3687d0a9 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:00007fed376b20c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000057 RAX: ffffffffffffffda RBX: 00007fed369b3f80 RCX: 00007fed3687d0a9 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000020000000 RBP: 00007fed368ec074 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007fed369b3f80 R15: 00007ffcf71bf408