loop1: detected capacity change from 0 to 4096 ntfs3: loop1: ino=0, failed to parse mft record ====================================================== WARNING: possible circular locking dependency detected 6.12.0-rc1-syzkaller-00349-g8f602276d390 #0 Not tainted ------------------------------------------------------ syz.1.521/10348 is trying to acquire lock: ffff88807febe7d0 (&ni->ni_lock){+.+.}-{3:3}, at: ntfs_set_state+0x1ff/0x6c0 fs/ntfs3/fsntfs.c:947 but task is already holding lock: ffff88805f95cb20 (&ni->file.run_lock#2){++++}-{3:3}, at: mi_read+0x2e9/0x5a0 fs/ntfs3/record.c:149 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&ni->file.run_lock#2){++++}-{3:3}: lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5825 down_read+0xb1/0xa40 kernel/locking/rwsem.c:1524 mi_read+0x181/0x5a0 fs/ntfs3/record.c:129 mi_format_new+0x1ab/0x5d0 fs/ntfs3/record.c:420 ni_add_subrecord+0xe2/0x430 fs/ntfs3/frecord.c:372 ntfs_look_free_mft+0x878/0x10c0 fs/ntfs3/fsntfs.c:715 ni_create_attr_list+0x9bd/0x1480 fs/ntfs3/frecord.c:876 ni_ins_attr_ext+0x369/0xbe0 fs/ntfs3/frecord.c:974 ni_insert_attr fs/ntfs3/frecord.c:1141 [inline] ni_insert_resident fs/ntfs3/frecord.c:1525 [inline] ni_add_name+0x809/0xe90 fs/ntfs3/frecord.c:3115 ni_rename+0xc2/0x1e0 fs/ntfs3/frecord.c:3155 ntfs_rename+0x7c1/0xd10 fs/ntfs3/namei.c:317 vfs_rename+0xbdb/0xf00 fs/namei.c:5013 do_renameat2+0xd94/0x13f0 fs/namei.c:5170 __do_sys_rename fs/namei.c:5217 [inline] __se_sys_rename fs/namei.c:5215 [inline] __x64_sys_rename+0x82/0x90 fs/namei.c:5215 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 -> #1 (&wnd->rw_lock/1){+.+.}-{3:3}: lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5825 down_write_nested+0xa2/0x220 kernel/locking/rwsem.c:1693 ntfs_mark_rec_free+0x3f/0x2b0 fs/ntfs3/fsntfs.c:742 ni_write_inode+0xb8a/0x1010 fs/ntfs3/frecord.c:3433 write_inode fs/fs-writeback.c:1503 [inline] __writeback_single_inode+0x711/0x10d0 fs/fs-writeback.c:1723 writeback_sb_inodes+0x80c/0x1370 fs/fs-writeback.c:1954 wb_writeback+0x41b/0xbd0 fs/fs-writeback.c:2134 wb_do_writeback fs/fs-writeback.c:2281 [inline] wb_workfn+0x410/0x1090 fs/fs-writeback.c:2321 process_one_work kernel/workqueue.c:3229 [inline] process_scheduled_works+0xa63/0x1850 kernel/workqueue.c:3310 worker_thread+0x870/0xd30 kernel/workqueue.c:3391 kthread+0x2f0/0x390 kernel/kthread.c:389 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 -> #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+0x18ef/0x5920 kernel/locking/lockdep.c:3904 __lock_acquire+0x1384/0x2050 kernel/locking/lockdep.c:5202 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5825 __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 ni_find_attr+0x6eb/0x8d0 fs/ntfs3/frecord.c:240 attr_load_runs_vcn+0xd5/0x360 fs/ntfs3/attrib.c:1316 mi_read+0x346/0x5a0 fs/ntfs3/record.c:151 ntfs_read_mft fs/ntfs3/inode.c:70 [inline] ntfs_iget5+0x482/0x3940 fs/ntfs3/inode.c:537 ntfs_export_get_inode+0xdc/0x190 fs/ntfs3/super.c:797 generic_fh_to_dentry+0x9f/0xf0 fs/libfs.c:1468 exportfs_decode_fh_raw+0x166/0x6a0 fs/exportfs/expfs.c:444 do_handle_to_path fs/fhandle.c:224 [inline] handle_to_path fs/fhandle.c:325 [inline] do_handle_open+0x764/0x9a0 fs/fhandle.c:343 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: Chain exists of: &ni->ni_lock --> &wnd->rw_lock/1 --> &ni->file.run_lock#2 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&ni->file.run_lock#2); lock(&wnd->rw_lock/1); lock(&ni->file.run_lock#2); lock(&ni->ni_lock); *** DEADLOCK *** 2 locks held by syz.1.521/10348: #0: ffff88805f95ca70 (&ni->ni_lock/4){+.+.}-{3:3}, at: ni_lock fs/ntfs3/ntfs_fs.h:1109 [inline] #0: ffff88805f95ca70 (&ni->ni_lock/4){+.+.}-{3:3}, at: mi_read+0x2e1/0x5a0 fs/ntfs3/record.c:148 #1: ffff88805f95cb20 (&ni->file.run_lock#2){++++}-{3:3}, at: mi_read+0x2e9/0x5a0 fs/ntfs3/record.c:149 stack backtrace: CPU: 1 UID: 0 PID: 10348 Comm: syz.1.521 Not tainted 6.12.0-rc1-syzkaller-00349-g8f602276d390 #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+0x241/0x360 lib/dump_stack.c:120 print_circular_bug+0x13a/0x1b0 kernel/locking/lockdep.c:2074 check_noncircular+0x36a/0x4a0 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+0x18ef/0x5920 kernel/locking/lockdep.c:3904 __lock_acquire+0x1384/0x2050 kernel/locking/lockdep.c:5202 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5825 __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 ni_find_attr+0x6eb/0x8d0 fs/ntfs3/frecord.c:240 attr_load_runs_vcn+0xd5/0x360 fs/ntfs3/attrib.c:1316 mi_read+0x346/0x5a0 fs/ntfs3/record.c:151 ntfs_read_mft fs/ntfs3/inode.c:70 [inline] ntfs_iget5+0x482/0x3940 fs/ntfs3/inode.c:537 ntfs_export_get_inode+0xdc/0x190 fs/ntfs3/super.c:797 generic_fh_to_dentry+0x9f/0xf0 fs/libfs.c:1468 exportfs_decode_fh_raw+0x166/0x6a0 fs/exportfs/expfs.c:444 do_handle_to_path fs/fhandle.c:224 [inline] handle_to_path fs/fhandle.c:325 [inline] do_handle_open+0x764/0x9a0 fs/fhandle.c:343 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:0x7fe347d7dff9 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:00007fe348b1b038 EFLAGS: 00000246 ORIG_RAX: 0000000000000130 RAX: ffffffffffffffda RBX: 00007fe347f35f80 RCX: 00007fe347d7dff9 RDX: 0000000000000000 RSI: 0000000020000240 RDI: 0000000000000007 RBP: 00007fe347df0296 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fe347f35f80 R15: 00007ffd121fc128 ntfs3: loop1: Mark volume as dirty due to NTFS errors