loop0: detected capacity change from 0 to 4096 ntfs3: loop0: Different NTFS sector size (4096) and media sector size (512). ====================================================== WARNING: possible circular locking dependency detected 6.11.0-rc7-syzkaller-g5f5673607153 #0 Not tainted ------------------------------------------------------ syz.0.74/6863 is trying to acquire lock: ffff0000db770fb0 (&ni->ni_lock#2){+.+.}-{3:3}, at: ntfs_set_state+0x1a4/0x5c0 fs/ntfs3/fsntfs.c:947 but task is already holding lock: ffff0000db776078 (&ni->ni_lock/4){+.+.}-{3:3}, at: ni_lock fs/ntfs3/ntfs_fs.h:1110 [inline] ffff0000db776078 (&ni->ni_lock/4){+.+.}-{3:3}, at: ntfs_lookup+0xf8/0x1f8 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}: __mutex_lock_common+0x190/0x21a0 kernel/locking/mutex.c:608 __mutex_lock kernel/locking/mutex.c:752 [inline] mutex_lock_nested+0x2c/0x38 kernel/locking/mutex.c:804 ni_lock fs/ntfs3/ntfs_fs.h:1110 [inline] mi_read+0x26c/0x4d8 fs/ntfs3/record.c:148 ntfs_read_mft fs/ntfs3/inode.c:70 [inline] ntfs_iget5+0x360/0x2bf8 fs/ntfs3/inode.c:537 ni_update_parent+0x6f0/0xac8 fs/ntfs3/frecord.c:3286 ni_write_inode+0xb64/0xda8 fs/ntfs3/frecord.c:3392 ntfs3_write_inode+0x70/0x98 fs/ntfs3/inode.c:1052 write_inode fs/fs-writeback.c:1497 [inline] __writeback_single_inode+0x5d8/0x14e4 fs/fs-writeback.c:1716 writeback_single_inode+0x1c0/0x64c fs/fs-writeback.c:1772 write_inode_now+0x190/0x224 fs/fs-writeback.c:2822 ntfs_extend+0x2e0/0x3f0 fs/ntfs3/file.c:421 ntfs_file_write_iter+0x320/0x610 fs/ntfs3/file.c:1188 aio_write+0x36c/0x4f8 fs/aio.c:1633 io_submit_one+0x788/0x14ec fs/aio.c:2052 __do_sys_io_submit fs/aio.c:2111 [inline] __se_sys_io_submit fs/aio.c:2081 [inline] __arm64_sys_io_submit+0x210/0x398 fs/aio.c:2081 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:49 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:132 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:151 el0_svc+0x54/0x168 arch/arm64/kernel/entry-common.c:712 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:730 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:598 -> #0 (&ni->ni_lock#2){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3133 [inline] check_prevs_add kernel/locking/lockdep.c:3252 [inline] validate_chain kernel/locking/lockdep.c:3868 [inline] __lock_acquire+0x33d8/0x779c kernel/locking/lockdep.c:5142 lock_acquire+0x240/0x728 kernel/locking/lockdep.c:5759 __mutex_lock_common+0x190/0x21a0 kernel/locking/mutex.c:608 __mutex_lock kernel/locking/mutex.c:752 [inline] mutex_lock_nested+0x2c/0x38 kernel/locking/mutex.c:804 ntfs_set_state+0x1a4/0x5c0 fs/ntfs3/fsntfs.c:947 ntfs_read_ea+0x210/0x808 fs/ntfs3/xattr.c:179 ntfs_get_ea+0x164/0x538 fs/ntfs3/xattr.c:274 ntfs_get_wsl_perm+0xdc/0x418 fs/ntfs3/xattr.c:1003 ntfs_read_mft fs/ntfs3/inode.c:382 [inline] ntfs_iget5+0x1380/0x2bf8 fs/ntfs3/inode.c:537 dir_search_u+0x298/0x324 fs/ntfs3/dir.c:264 ntfs_lookup+0x108/0x1f8 fs/ntfs3/namei.c:85 __lookup_slow+0x250/0x374 fs/namei.c:1718 lookup_slow+0x60/0x84 fs/namei.c:1735 walk_component+0x280/0x36c fs/namei.c:2039 lookup_last fs/namei.c:2542 [inline] path_lookupat+0x13c/0x3d0 fs/namei.c:2566 filename_lookup+0x1d4/0x4e0 fs/namei.c:2595 user_path_at+0x50/0x74 fs/namei.c:3002 do_sys_truncate+0xb0/0x1ac fs/open.c:132 __do_sys_truncate fs/open.c:146 [inline] __se_sys_truncate fs/open.c:144 [inline] __arm64_sys_truncate+0x5c/0x70 fs/open.c:144 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:49 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:132 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:151 el0_svc+0x54/0x168 arch/arm64/kernel/entry-common.c:712 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:730 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:598 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 *** 2 locks held by syz.0.74/6863: #0: ffff0000db776310 (&type->i_mutex_dir_key#12){++++}-{3:3}, at: inode_lock_shared include/linux/fs.h:810 [inline] #0: ffff0000db776310 (&type->i_mutex_dir_key#12){++++}-{3:3}, at: lookup_slow+0x50/0x84 fs/namei.c:1734 #1: ffff0000db776078 (&ni->ni_lock/4){+.+.}-{3:3}, at: ni_lock fs/ntfs3/ntfs_fs.h:1110 [inline] #1: ffff0000db776078 (&ni->ni_lock/4){+.+.}-{3:3}, at: ntfs_lookup+0xf8/0x1f8 fs/ntfs3/namei.c:84 stack backtrace: CPU: 0 UID: 0 PID: 6863 Comm: syz.0.74 Not tainted 6.11.0-rc7-syzkaller-g5f5673607153 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024 Call trace: dump_backtrace+0x1b8/0x1e4 arch/arm64/kernel/stacktrace.c:319 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:326 __dump_stack lib/dump_stack.c:93 [inline] dump_stack_lvl+0xe4/0x150 lib/dump_stack.c:119 dump_stack+0x1c/0x28 lib/dump_stack.c:128 print_circular_bug+0x150/0x1b8 kernel/locking/lockdep.c:2059 check_noncircular+0x310/0x404 kernel/locking/lockdep.c:2186 check_prev_add kernel/locking/lockdep.c:3133 [inline] check_prevs_add kernel/locking/lockdep.c:3252 [inline] validate_chain kernel/locking/lockdep.c:3868 [inline] __lock_acquire+0x33d8/0x779c kernel/locking/lockdep.c:5142 lock_acquire+0x240/0x728 kernel/locking/lockdep.c:5759 __mutex_lock_common+0x190/0x21a0 kernel/locking/mutex.c:608 __mutex_lock kernel/locking/mutex.c:752 [inline] mutex_lock_nested+0x2c/0x38 kernel/locking/mutex.c:804 ntfs_set_state+0x1a4/0x5c0 fs/ntfs3/fsntfs.c:947 ntfs_read_ea+0x210/0x808 fs/ntfs3/xattr.c:179 ntfs_get_ea+0x164/0x538 fs/ntfs3/xattr.c:274 ntfs_get_wsl_perm+0xdc/0x418 fs/ntfs3/xattr.c:1003 ntfs_read_mft fs/ntfs3/inode.c:382 [inline] ntfs_iget5+0x1380/0x2bf8 fs/ntfs3/inode.c:537 dir_search_u+0x298/0x324 fs/ntfs3/dir.c:264 ntfs_lookup+0x108/0x1f8 fs/ntfs3/namei.c:85 __lookup_slow+0x250/0x374 fs/namei.c:1718 lookup_slow+0x60/0x84 fs/namei.c:1735 walk_component+0x280/0x36c fs/namei.c:2039 lookup_last fs/namei.c:2542 [inline] path_lookupat+0x13c/0x3d0 fs/namei.c:2566 filename_lookup+0x1d4/0x4e0 fs/namei.c:2595 user_path_at+0x50/0x74 fs/namei.c:3002 do_sys_truncate+0xb0/0x1ac fs/open.c:132 __do_sys_truncate fs/open.c:146 [inline] __se_sys_truncate fs/open.c:144 [inline] __arm64_sys_truncate+0x5c/0x70 fs/open.c:144 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:49 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:132 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:151 el0_svc+0x54/0x168 arch/arm64/kernel/entry-common.c:712 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:730 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:598 ntfs3: loop0: ino=3, ntfs_set_state failed, -22.