====================================================== WARNING: possible circular locking dependency detected 6.11.0-syzkaller-11558-g075dbe9f6e3c #0 Not tainted ------------------------------------------------------ syz.3.787/7341 is trying to acquire lock: ffff88807d71d920 (&ni->ni_lock){+.+.}-{3:3}, at: ntfs_set_state+0x1d2/0x6a0 fs/ntfs3/fsntfs.c:947 but task is already holding lock: ffff88807d718100 (&ni->ni_lock/4){+.+.}-{3:3}, at: ni_lock fs/ntfs3/ntfs_fs.h:1109 [inline] ffff88807d718100 (&ni->ni_lock/4){+.+.}-{3:3}, at: ntfs_set_ea+0xbcd/0x1410 fs/ntfs3/xattr.c:336 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:1109 [inline] mi_read+0x466/0x660 fs/ntfs3/record.c:148 ntfs_read_mft fs/ntfs3/inode.c:70 [inline] ntfs_iget5+0x4c5/0x38b0 fs/ntfs3/inode.c:537 ni_update_parent fs/ntfs3/frecord.c:3286 [inline] ni_write_inode+0x1603/0x2900 fs/ntfs3/frecord.c:3392 write_inode fs/fs-writeback.c:1503 [inline] __writeback_single_inode+0xb4c/0xfa0 fs/fs-writeback.c:1723 writeback_single_inode+0x2bc/0x550 fs/fs-writeback.c:1779 sync_inode_metadata+0x9e/0xe0 fs/fs-writeback.c:2849 __generic_file_fsync+0x168/0x1f0 fs/libfs.c:1539 generic_file_fsync+0x70/0x120 fs/libfs.c:1569 vfs_fsync_range+0x139/0x220 fs/sync.c:188 generic_write_sync include/linux/fs.h:2871 [inline] ntfs_file_write_iter+0xf27/0x1ba0 fs/ntfs3/file.c:1198 iter_file_splice_write+0x912/0x10b0 fs/splice.c:743 do_splice_from fs/splice.c:941 [inline] direct_splice_actor+0x192/0x6c0 fs/splice.c:1164 splice_direct_to_actor+0x349/0xa40 fs/splice.c:1108 do_splice_direct_actor fs/splice.c:1207 [inline] do_splice_direct+0x178/0x250 fs/splice.c:1233 do_sendfile+0xb0c/0xe40 fs/read_write.c:1388 __do_sys_sendfile64 fs/read_write.c:1455 [inline] __se_sys_sendfile64 fs/read_write.c:1441 [inline] __x64_sys_sendfile64+0x1da/0x220 fs/read_write.c:1441 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}: check_prev_add kernel/locking/lockdep.c:3158 [inline] check_prevs_add kernel/locking/lockdep.c:3277 [inline] validate_chain kernel/locking/lockdep.c:3901 [inline] __lock_acquire+0x250b/0x3ce0 kernel/locking/lockdep.c:5199 lock_acquire kernel/locking/lockdep.c:5822 [inline] lock_acquire+0x1b1/0x560 kernel/locking/lockdep.c:5787 __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 ntfs_read_ea+0x71e/0xaa0 fs/ntfs3/xattr.c:179 ntfs_set_ea+0x256/0x1410 fs/ntfs3/xattr.c:347 ntfs_setxattr+0x58a/0x800 fs/ntfs3/xattr.c:938 __vfs_setxattr+0x176/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/0x360 fs/xattr.c:321 do_setxattr+0x146/0x170 fs/xattr.c:629 path_setxattr+0x221/0x280 fs/xattr.c:658 __do_sys_setxattr fs/xattr.c:676 [inline] __se_sys_setxattr fs/xattr.c:672 [inline] __x64_sys_setxattr+0xc4/0x160 fs/xattr.c:672 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); lock(&ni->ni_lock/4); lock(&ni->ni_lock); *** DEADLOCK *** 3 locks held by syz.3.787/7341: #0: ffff8880773c6420 (sb_writers#17){.+.+}-{0:0}, at: path_setxattr+0x144/0x280 fs/xattr.c:656 #1: ffff88807d718398 (&type->i_mutex_dir_key#10){++++}-{3:3}, at: inode_lock include/linux/fs.h:815 [inline] #1: ffff88807d718398 (&type->i_mutex_dir_key#10){++++}-{3:3}, at: vfs_setxattr+0x123/0x360 fs/xattr.c:320 #2: ffff88807d718100 (&ni->ni_lock/4){+.+.}-{3:3}, at: ni_lock fs/ntfs3/ntfs_fs.h:1109 [inline] #2: ffff88807d718100 (&ni->ni_lock/4){+.+.}-{3:3}, at: ntfs_set_ea+0xbcd/0x1410 fs/ntfs3/xattr.c:336 stack backtrace: CPU: 0 UID: 0 PID: 7341 Comm: syz.3.787 Not tainted 6.11.0-syzkaller-11558-g075dbe9f6e3c #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_circular_bug+0x419/0x5d0 kernel/locking/lockdep.c:2074 check_noncircular+0x31a/0x400 kernel/locking/lockdep.c:2203 check_prev_add kernel/locking/lockdep.c:3158 [inline] check_prevs_add kernel/locking/lockdep.c:3277 [inline] validate_chain kernel/locking/lockdep.c:3901 [inline] __lock_acquire+0x250b/0x3ce0 kernel/locking/lockdep.c:5199 lock_acquire kernel/locking/lockdep.c:5822 [inline] lock_acquire+0x1b1/0x560 kernel/locking/lockdep.c:5787 __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 ntfs_read_ea+0x71e/0xaa0 fs/ntfs3/xattr.c:179 ntfs_set_ea+0x256/0x1410 fs/ntfs3/xattr.c:347 ntfs_setxattr+0x58a/0x800 fs/ntfs3/xattr.c:938 __vfs_setxattr+0x176/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/0x360 fs/xattr.c:321 do_setxattr+0x146/0x170 fs/xattr.c:629 path_setxattr+0x221/0x280 fs/xattr.c:658 __do_sys_setxattr fs/xattr.c:676 [inline] __se_sys_setxattr fs/xattr.c:672 [inline] __x64_sys_setxattr+0xc4/0x160 fs/xattr.c:672 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:0x7fcd6cb7df39 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:00007fcd6d939038 EFLAGS: 00000246 ORIG_RAX: 00000000000000bc RAX: ffffffffffffffda RBX: 00007fcd6cd35f80 RCX: 00007fcd6cb7df39 RDX: 0000000020000580 RSI: 00000000200002c0 RDI: 00000000200001c0 RBP: 00007fcd6cbf0216 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000afe R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fcd6cd35f80 R15: 00007ffd1b379e78