loop1: detected capacity change from 0 to 4096 ntfs3: loop1: Different NTFS sector size (2048) and media sector size (512). ====================================================== WARNING: possible circular locking dependency detected 6.11.0-rc3-next-20240816-syzkaller #0 Not tainted ------------------------------------------------------ syz.1.1887/10358 is trying to acquire lock: ffff88805d604a70 (&ni->ni_lock){+.+.}-{3:3}, at: ntfs_set_state+0x1ff/0x6c0 fs/ntfs3/fsntfs.c:947 but task is already holding lock: ffff88805d450fb0 (&ni->ni_lock/4){+.+.}-{3:3}, at: ni_lock fs/ntfs3/ntfs_fs.h:1109 [inline] ffff88805d450fb0 (&ni->ni_lock/4){+.+.}-{3:3}, at: ntfs_lookup+0xf9/0x1f0 fs/ntfs3/namei.c:84 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:5762 __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:1109 [inline] mi_read+0x2e1/0x5a0 fs/ntfs3/record.c:148 ntfs_read_mft fs/ntfs3/inode.c:70 [inline] ntfs_iget5+0x4d1/0x3b60 fs/ntfs3/inode.c:537 ni_update_parent+0x943/0xdd0 fs/ntfs3/frecord.c:3286 ni_write_inode+0xd9f/0x1020 fs/ntfs3/frecord.c:3392 write_inode fs/fs-writeback.c:1502 [inline] __writeback_single_inode+0x6b9/0x10c0 fs/fs-writeback.c:1710 writeback_single_inode+0x1da/0x590 fs/fs-writeback.c:1766 sync_inode_metadata+0xc4/0x120 fs/fs-writeback.c:2836 __generic_file_fsync+0x13f/0x190 fs/libfs.c:1539 generic_file_fsync+0x73/0xf0 fs/libfs.c:1569 generic_write_sync include/linux/fs.h:2853 [inline] ntfs_file_write_iter+0x62b/0x740 fs/ntfs3/file.c:1198 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/0xe20 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){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3136 [inline] check_prevs_add kernel/locking/lockdep.c:3255 [inline] validate_chain+0x18e0/0x5900 kernel/locking/lockdep.c:3871 __lock_acquire+0x137a/0x2040 kernel/locking/lockdep.c:5145 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5762 __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 ntfs_read_ea+0x2a7/0xa10 fs/ntfs3/xattr.c:179 ntfs_get_ea+0x1c6/0x690 fs/ntfs3/xattr.c:274 ntfs_get_wsl_perm+0xd9/0x4c0 fs/ntfs3/xattr.c:1003 ntfs_read_mft fs/ntfs3/inode.c:382 [inline] ntfs_iget5+0x1c63/0x3b60 fs/ntfs3/inode.c:537 dir_search_u+0x2fe/0x3a0 fs/ntfs3/dir.c:264 ntfs_lookup+0x106/0x1f0 fs/ntfs3/namei.c:85 lookup_one_qstr_excl+0x11f/0x260 fs/namei.c:1633 do_unlinkat+0x297/0x830 fs/namei.c:4521 __do_sys_unlinkat fs/namei.c:4576 [inline] __se_sys_unlinkat fs/namei.c:4569 [inline] __x64_sys_unlinkat+0xcc/0xf0 fs/namei.c:4569 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); lock(&ni->ni_lock/4); lock(&ni->ni_lock); *** DEADLOCK *** 3 locks held by syz.1.1887/10358: #0: ffff888063836420 (sb_writers#23){.+.+}-{0:0}, at: mnt_want_write+0x3f/0x90 fs/namespace.c:515 #1: ffff88805d451248 (&type->i_mutex_dir_key#19/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:833 [inline] #1: ffff88805d451248 (&type->i_mutex_dir_key#19/1){+.+.}-{3:3}, at: do_unlinkat+0x26a/0x830 fs/namei.c:4520 #2: ffff88805d450fb0 (&ni->ni_lock/4){+.+.}-{3:3}, at: ni_lock fs/ntfs3/ntfs_fs.h:1109 [inline] #2: ffff88805d450fb0 (&ni->ni_lock/4){+.+.}-{3:3}, at: ntfs_lookup+0xf9/0x1f0 fs/ntfs3/namei.c:84 stack backtrace: CPU: 0 UID: 0 PID: 10358 Comm: syz.1.1887 Not tainted 6.11.0-rc3-next-20240816-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 check_noncircular+0x36a/0x4a0 kernel/locking/lockdep.c:2189 check_prev_add kernel/locking/lockdep.c:3136 [inline] check_prevs_add kernel/locking/lockdep.c:3255 [inline] validate_chain+0x18e0/0x5900 kernel/locking/lockdep.c:3871 __lock_acquire+0x137a/0x2040 kernel/locking/lockdep.c:5145 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5762 __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 ntfs_read_ea+0x2a7/0xa10 fs/ntfs3/xattr.c:179 ntfs_get_ea+0x1c6/0x690 fs/ntfs3/xattr.c:274 ntfs_get_wsl_perm+0xd9/0x4c0 fs/ntfs3/xattr.c:1003 ntfs_read_mft fs/ntfs3/inode.c:382 [inline] ntfs_iget5+0x1c63/0x3b60 fs/ntfs3/inode.c:537 dir_search_u+0x2fe/0x3a0 fs/ntfs3/dir.c:264 ntfs_lookup+0x106/0x1f0 fs/ntfs3/namei.c:85 lookup_one_qstr_excl+0x11f/0x260 fs/namei.c:1633 do_unlinkat+0x297/0x830 fs/namei.c:4521 __do_sys_unlinkat fs/namei.c:4576 [inline] __se_sys_unlinkat fs/namei.c:4569 [inline] __x64_sys_unlinkat+0xcc/0xf0 fs/namei.c:4569 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:0x7f7c25b79e79 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:00007f7c26982038 EFLAGS: 00000246 ORIG_RAX: 0000000000000107 RAX: ffffffffffffffda RBX: 00007f7c25d15f80 RCX: 00007f7c25b79e79 RDX: 0000000000000000 RSI: 00000000200001c0 RDI: ffffffffffffff9c RBP: 00007f7c25be7916 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f7c25d15f80 R15: 00007ffd89d11f58