ntfs3: loop0: ino=1b, "file0" failed to parse mft record ====================================================== WARNING: possible circular locking dependency detected 6.12.0-rc1-syzkaller-g2d8bce6e34be #0 Not tainted ------------------------------------------------------ syz.0.551/9444 is trying to acquire lock: ffff0000de3f8100 (&ni->ni_lock){+.+.}-{3:3}, at: ntfs_set_state+0x1a4/0x5c0 fs/ntfs3/fsntfs.c:947 but task is already holding lock: ffff0000de3f8858 (&ni->ni_lock/4){+.+.}-{3:3}, at: ni_lock fs/ntfs3/ntfs_fs.h:1109 [inline] ffff0000de3f8858 (&ni->ni_lock/4){+.+.}-{3:3}, at: ntfs_save_wsl_perm+0x90/0x42c fs/ntfs3/xattr.c:959 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:1109 [inline] mi_read+0x26c/0x4d8 fs/ntfs3/record.c:148 ntfs_read_mft fs/ntfs3/inode.c:70 [inline] ntfs_iget5+0x358/0x2c0c 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:1011 write_inode fs/fs-writeback.c:1503 [inline] __writeback_single_inode+0x5a4/0x156c fs/fs-writeback.c:1723 writeback_sb_inodes+0x648/0x1090 fs/fs-writeback.c:1954 __writeback_inodes_wb+0xec/0x234 fs/fs-writeback.c:2025 wb_writeback+0x400/0xf0c fs/fs-writeback.c:2136 wb_check_background_flush fs/fs-writeback.c:2206 [inline] wb_do_writeback fs/fs-writeback.c:2294 [inline] wb_workfn+0xc2c/0x104c fs/fs-writeback.c:2321 process_one_work+0x7bc/0x1600 kernel/workqueue.c:3229 process_scheduled_works kernel/workqueue.c:3310 [inline] worker_thread+0x97c/0xeec kernel/workqueue.c:3391 kthread+0x288/0x310 kernel/kthread.c:389 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:860 -> #0 (&ni->ni_lock){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3161 [inline] check_prevs_add kernel/locking/lockdep.c:3280 [inline] validate_chain kernel/locking/lockdep.c:3904 [inline] __lock_acquire+0x33f8/0x77c8 kernel/locking/lockdep.c:5202 lock_acquire+0x240/0x728 kernel/locking/lockdep.c:5825 __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 ni_find_attr+0x608/0x7c8 fs/ntfs3/frecord.c:240 attr_set_size+0x3b8/0x3468 fs/ntfs3/attrib.c:426 ntfs_set_ea+0x6dc/0x1318 fs/ntfs3/xattr.c:462 ntfs_save_wsl_perm+0x120/0x42c fs/ntfs3/xattr.c:961 ntfs3_setattr+0x400/0x95c fs/ntfs3/file.c:800 notify_change+0x9f0/0xca0 fs/attr.c:503 chmod_common+0x23c/0x418 fs/open.c:653 do_fchmodat fs/open.c:701 [inline] __do_sys_fchmodat fs/open.c:720 [inline] __se_sys_fchmodat fs/open.c:717 [inline] __arm64_sys_fchmodat+0x114/0x1d4 fs/open.c:717 __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:732 el0t_64_sync_handler+0x84/0x108 arch/arm64/kernel/entry-common.c:750 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); lock(&ni->ni_lock/4); lock(&ni->ni_lock); *** DEADLOCK *** 3 locks held by syz.0.551/9444: #0: ffff0000d6382420 (sb_writers#22){.+.+}-{0:0}, at: mnt_want_write+0x44/0x9c fs/namespace.c:515 #1: ffff0000de3f8af0 (&type->i_mutex_dir_key#17){++++}-{3:3}, at: inode_lock include/linux/fs.h:815 [inline] #1: ffff0000de3f8af0 (&type->i_mutex_dir_key#17){++++}-{3:3}, at: chmod_common+0x17c/0x418 fs/open.c:647 #2: ffff0000de3f8858 (&ni->ni_lock/4){+.+.}-{3:3}, at: ni_lock fs/ntfs3/ntfs_fs.h:1109 [inline] #2: ffff0000de3f8858 (&ni->ni_lock/4){+.+.}-{3:3}, at: ntfs_save_wsl_perm+0x90/0x42c fs/ntfs3/xattr.c:959 stack backtrace: CPU: 0 UID: 0 PID: 9444 Comm: syz.0.551 Not tainted 6.12.0-rc1-syzkaller-g2d8bce6e34be #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:94 [inline] dump_stack_lvl+0xe4/0x150 lib/dump_stack.c:120 dump_stack+0x1c/0x28 lib/dump_stack.c:129 print_circular_bug+0x154/0x1c0 kernel/locking/lockdep.c:2074 check_noncircular+0x310/0x404 kernel/locking/lockdep.c:2206 check_prev_add kernel/locking/lockdep.c:3161 [inline] check_prevs_add kernel/locking/lockdep.c:3280 [inline] validate_chain kernel/locking/lockdep.c:3904 [inline] __lock_acquire+0x33f8/0x77c8 kernel/locking/lockdep.c:5202 lock_acquire+0x240/0x728 kernel/locking/lockdep.c:5825 __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 ni_find_attr+0x608/0x7c8 fs/ntfs3/frecord.c:240 attr_set_size+0x3b8/0x3468 fs/ntfs3/attrib.c:426 ntfs_set_ea+0x6dc/0x1318 fs/ntfs3/xattr.c:462 ntfs_save_wsl_perm+0x120/0x42c fs/ntfs3/xattr.c:961 ntfs3_setattr+0x400/0x95c fs/ntfs3/file.c:800 notify_change+0x9f0/0xca0 fs/attr.c:503 chmod_common+0x23c/0x418 fs/open.c:653 do_fchmodat fs/open.c:701 [inline] __do_sys_fchmodat fs/open.c:720 [inline] __se_sys_fchmodat fs/open.c:717 [inline] __arm64_sys_fchmodat+0x114/0x1d4 fs/open.c:717 __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:732 el0t_64_sync_handler+0x84/0x108 arch/arm64/kernel/entry-common.c:750 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:598 ntfs3: loop0: Mark volume as dirty due to NTFS errors ntfs3: loop0: ino=1b, "file0" attr_set_size