ntfs3: loop3: ino=1b, "file0" attr_set_size ====================================================== WARNING: possible circular locking dependency detected 6.10.0-rc4-syzkaller-00330-g7c16f0a4ed1c #0 Not tainted ------------------------------------------------------ syz-executor.3/18456 is trying to acquire lock: ffff8880608ecac0 (&ni->ni_lock#2){+.+.}-{3:3}, at: ntfs_set_state+0x1ff/0x6c0 fs/ntfs3/fsntfs.c:947 but task is already holding lock: ffff8880608ed220 (&ni->ni_lock/4){+.+.}-{3:3}, at: ni_lock fs/ntfs3/ntfs_fs.h:1123 [inline] ffff8880608ed220 (&ni->ni_lock/4){+.+.}-{3:3}, at: ntfs_save_wsl_perm+0x8f/0x500 fs/ntfs3/xattr.c:958 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+0x1ed/0x550 kernel/locking/lockdep.c:5754 __mutex_lock_common kernel/locking/mutex.c:608 [inline] __mutex_lock+0x136/0xd70 kernel/locking/mutex.c:752 ni_lock fs/ntfs3/ntfs_fs.h:1123 [inline] mi_read+0x2e1/0x5a0 fs/ntfs3/record.c:148 ntfs_read_mft fs/ntfs3/inode.c:70 [inline] ntfs_iget5+0x49a/0x3b10 fs/ntfs3/inode.c:539 ni_update_parent+0x943/0xdd0 fs/ntfs3/frecord.c:3218 ni_write_inode+0xde9/0x1010 fs/ntfs3/frecord.c:3324 write_inode fs/fs-writeback.c:1497 [inline] __writeback_single_inode+0x6b9/0x10b0 fs/fs-writeback.c:1716 writeback_single_inode+0x21b/0x7a0 fs/fs-writeback.c:1772 write_inode_now+0x1d1/0x260 fs/fs-writeback.c:2822 ntfs_extend+0x39d/0x4a0 fs/ntfs3/file.c:358 ntfs_file_write_iter+0x3ea/0x770 fs/ntfs3/file.c:1124 iter_file_splice_write+0xbd7/0x14e0 fs/splice.c:743 do_splice_from fs/splice.c:941 [inline] direct_splice_actor+0x11e/0x220 fs/splice.c:1164 splice_direct_to_actor+0x58e/0xc90 fs/splice.c:1108 do_splice_direct_actor fs/splice.c:1207 [inline] do_splice_direct+0x28c/0x3e0 fs/splice.c:1233 do_sendfile+0x56d/0xe10 fs/read_write.c:1295 __do_sys_sendfile64 fs/read_write.c:1362 [inline] __se_sys_sendfile64+0x17c/0x1e0 fs/read_write.c:1348 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #0 (&ni->ni_lock#2){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain+0x18e0/0x5900 kernel/locking/lockdep.c:3869 __lock_acquire+0x1346/0x1fd0 kernel/locking/lockdep.c:5137 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754 __mutex_lock_common kernel/locking/mutex.c:608 [inline] __mutex_lock+0x136/0xd70 kernel/locking/mutex.c:752 ntfs_set_state+0x1ff/0x6c0 fs/ntfs3/fsntfs.c:947 attr_set_size+0x3311/0x4290 fs/ntfs3/attrib.c:866 ntfs_set_ea+0x982/0x16d0 fs/ntfs3/xattr.c:461 ntfs_save_wsl_perm+0x14f/0x500 fs/ntfs3/xattr.c:960 ntfs3_setattr+0x4fd/0xb40 fs/ntfs3/file.c:738 notify_change+0xb9d/0xe70 fs/attr.c:497 chmod_common+0x2ab/0x4c0 fs/open.c:650 vfs_fchmod fs/open.c:666 [inline] __do_sys_fchmod fs/open.c:675 [inline] __se_sys_fchmod fs/open.c:669 [inline] __x64_sys_fchmod+0xf8/0x160 fs/open.c:669 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 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#2); lock(&ni->ni_lock/4); lock(&ni->ni_lock#2); *** DEADLOCK *** 3 locks held by syz-executor.3/18456: #0: ffff888025a76420 (sb_writers#19){.+.+}-{0:0}, at: mnt_want_write+0x3f/0x90 fs/namespace.c:409 #1: ffff8880608ed4c0 (&type->i_mutex_dir_key#12){++++}-{3:3}, at: inode_lock include/linux/fs.h:791 [inline] #1: ffff8880608ed4c0 (&type->i_mutex_dir_key#12){++++}-{3:3}, at: chmod_common+0x1bb/0x4c0 fs/open.c:644 #2: ffff8880608ed220 (&ni->ni_lock/4){+.+.}-{3:3}, at: ni_lock fs/ntfs3/ntfs_fs.h:1123 [inline] #2: ffff8880608ed220 (&ni->ni_lock/4){+.+.}-{3:3}, at: ntfs_save_wsl_perm+0x8f/0x500 fs/ntfs3/xattr.c:958 stack backtrace: CPU: 1 PID: 18456 Comm: syz-executor.3 Not tainted 6.10.0-rc4-syzkaller-00330-g7c16f0a4ed1c #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+0x241/0x360 lib/dump_stack.c:114 check_noncircular+0x36a/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+0x18e0/0x5900 kernel/locking/lockdep.c:3869 __lock_acquire+0x1346/0x1fd0 kernel/locking/lockdep.c:5137 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754 __mutex_lock_common kernel/locking/mutex.c:608 [inline] __mutex_lock+0x136/0xd70 kernel/locking/mutex.c:752 ntfs_set_state+0x1ff/0x6c0 fs/ntfs3/fsntfs.c:947 attr_set_size+0x3311/0x4290 fs/ntfs3/attrib.c:866 ntfs_set_ea+0x982/0x16d0 fs/ntfs3/xattr.c:461 ntfs_save_wsl_perm+0x14f/0x500 fs/ntfs3/xattr.c:960 ntfs3_setattr+0x4fd/0xb40 fs/ntfs3/file.c:738 notify_change+0xb9d/0xe70 fs/attr.c:497 chmod_common+0x2ab/0x4c0 fs/open.c:650 vfs_fchmod fs/open.c:666 [inline] __do_sys_fchmod fs/open.c:675 [inline] __se_sys_fchmod fs/open.c:669 [inline] __x64_sys_fchmod+0xf8/0x160 fs/open.c:669 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f7aa247d0a9 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:00007f7aa31860c8 EFLAGS: 00000246 ORIG_RAX: 000000000000005b RAX: ffffffffffffffda RBX: 00007f7aa25b3f80 RCX: 00007f7aa247d0a9 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000006 RBP: 00007f7aa24ec074 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f7aa25b3f80 R15: 00007ffca5e833a8 ntfs3: loop3: Mark volume as dirty due to NTFS errors