====================================================== WARNING: possible circular locking dependency detected 6.10.0-rc4-syzkaller-00164-g66cc544fd75c #0 Not tainted ------------------------------------------------------ syz-executor.1/9167 is trying to acquire lock: ffff88804fef9720 (&ni->ni_lock#3){+.+.}-{3:3}, at: ntfs_set_state+0x1d2/0x6a0 fs/ntfs3/fsntfs.c:947 but task is already holding lock: ffff88804880f700 (&ni->ni_lock/4){+.+.}-{3:3}, at: ni_lock fs/ntfs3/ntfs_fs.h:1123 [inline] ffff88804880f700 (&ni->ni_lock/4){+.+.}-{3:3}, at: ntfs_set_ea+0xbcd/0x1410 fs/ntfs3/xattr.c:335 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 sync_inode_metadata+0xa5/0xf0 fs/fs-writeback.c:2842 __generic_file_fsync+0x16a/0x200 fs/libfs.c:1527 generic_file_fsync+0x76/0x130 fs/libfs.c:1557 vfs_fsync_range+0x141/0x230 fs/sync.c:188 generic_write_sync include/linux/fs.h:2794 [inline] ntfs_file_write_iter+0xd38/0x2050 fs/ntfs3/file.c:1135 new_sync_write fs/read_write.c:497 [inline] vfs_write+0x6b6/0x1140 fs/read_write.c:590 ksys_write+0x12f/0x260 fs/read_write.c:643 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 attr_set_size+0x1307/0x2c60 fs/ntfs3/attrib.c:866 ntfs_set_ea+0x655/0x1410 fs/ntfs3/xattr.c:461 ntfs_setxattr+0x58a/0x800 fs/ntfs3/xattr.c:937 __vfs_setxattr+0x173/0x1e0 fs/xattr.c:200 __vfs_setxattr_noperm+0x127/0x660 fs/xattr.c:234 __vfs_setxattr_locked+0x182/0x260 fs/xattr.c:295 vfs_setxattr+0x146/0x350 fs/xattr.c:321 do_setxattr+0x146/0x170 fs/xattr.c:629 setxattr+0x15d/0x180 fs/xattr.c:652 path_setxattr+0x179/0x1e0 fs/xattr.c:671 __do_sys_setxattr fs/xattr.c:687 [inline] __se_sys_setxattr fs/xattr.c:683 [inline] __x64_sys_setxattr+0xc4/0x160 fs/xattr.c:683 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 *** 3 locks held by syz-executor.1/9167: #0: ffff88804dc32420 (sb_writers#13){.+.+}-{0:0}, at: path_setxattr+0xc3/0x1e0 fs/xattr.c:669 #1: ffff88804880f9a0 (&type->i_mutex_dir_key#9){++++}-{3:3}, at: inode_lock include/linux/fs.h:791 [inline] #1: ffff88804880f9a0 (&type->i_mutex_dir_key#9){++++}-{3:3}, at: vfs_setxattr+0x123/0x350 fs/xattr.c:320 #2: ffff88804880f700 (&ni->ni_lock/4){+.+.}-{3:3}, at: ni_lock fs/ntfs3/ntfs_fs.h:1123 [inline] #2: ffff88804880f700 (&ni->ni_lock/4){+.+.}-{3:3}, at: ntfs_set_ea+0xbcd/0x1410 fs/ntfs3/xattr.c:335 stack backtrace: CPU: 0 PID: 9167 Comm: syz-executor.1 Not tainted 6.10.0-rc4-syzkaller-00164-g66cc544fd75c #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 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 attr_set_size+0x1307/0x2c60 fs/ntfs3/attrib.c:866 ntfs_set_ea+0x655/0x1410 fs/ntfs3/xattr.c:461 ntfs_setxattr+0x58a/0x800 fs/ntfs3/xattr.c:937 __vfs_setxattr+0x173/0x1e0 fs/xattr.c:200 __vfs_setxattr_noperm+0x127/0x660 fs/xattr.c:234 __vfs_setxattr_locked+0x182/0x260 fs/xattr.c:295 vfs_setxattr+0x146/0x350 fs/xattr.c:321 do_setxattr+0x146/0x170 fs/xattr.c:629 setxattr+0x15d/0x180 fs/xattr.c:652 path_setxattr+0x179/0x1e0 fs/xattr.c:671 __do_sys_setxattr fs/xattr.c:687 [inline] __se_sys_setxattr fs/xattr.c:683 [inline] __x64_sys_setxattr+0xc4/0x160 fs/xattr.c:683 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:0x7f01a287cee9 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:00007f01a35320c8 EFLAGS: 00000246 ORIG_RAX: 00000000000000bc RAX: ffffffffffffffda RBX: 00007f01a29abf80 RCX: 00007f01a287cee9 RDX: 0000000000000000 RSI: 000000002001f440 RDI: 0000000020000100 RBP: 00007f01a28c949e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f01a29abf80 R15: 00007ffc8074cfa8 ntfs3: loop1: Mark volume as dirty due to NTFS errors