ntfs3: loop1: Different NTFS sector size (4096) and media sector size (512). ntfs3: loop1: Inode r=19 is not in use! ntfs3: loop1: Mark volume as dirty due to NTFS errors ====================================================== WARNING: possible circular locking dependency detected 6.10.0-rc5-syzkaller-00018-g55027e689933 #0 Not tainted ------------------------------------------------------ syz.1.1048/8670 is trying to acquire lock: ffff88804bd5bc00 (&ni->ni_lock/4){+.+.}-{3:3}, at: ni_lock fs/ntfs3/ntfs_fs.h:1123 [inline] ffff88804bd5bc00 (&ni->ni_lock/4){+.+.}-{3:3}, at: mi_read+0x466/0x660 fs/ntfs3/record.c:148 but task is already holding lock: ffff88804bd5e840 (&ni->ni_lock#2){+.+.}-{3:3}, at: ni_trylock fs/ntfs3/ntfs_fs.h:1143 [inline] ffff88804bd5e840 (&ni->ni_lock#2){+.+.}-{3:3}, at: ni_write_inode+0x24c/0x2990 fs/ntfs3/frecord.c:3265 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&ni->ni_lock#2){+.+.}-{3:3}: __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 ni_remove_name+0x2ff/0x680 fs/ntfs3/frecord.c:2926 ntfs_unlink_inode+0x37a/0x750 fs/ntfs3/inode.c:1806 ntfs_unlink+0xc7/0x120 fs/ntfs3/namei.c:181 vfs_rmdir fs/namei.c:4214 [inline] vfs_rmdir+0x203/0x690 fs/namei.c:4191 do_rmdir+0x3a2/0x410 fs/namei.c:4273 __do_sys_unlinkat fs/namei.c:4449 [inline] __se_sys_unlinkat fs/namei.c:4443 [inline] __ia32_sys_unlinkat+0xf3/0x130 fs/namei.c:4443 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x73/0x120 arch/x86/entry/common.c:386 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:411 entry_SYSENTER_compat_after_hwframe+0x84/0x8e -> #0 (&ni->ni_lock/4){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain kernel/locking/lockdep.c:3869 [inline] __lock_acquire+0x2478/0x3b30 kernel/locking/lockdep.c:5137 lock_acquire kernel/locking/lockdep.c:5754 [inline] lock_acquire+0x1b1/0x560 kernel/locking/lockdep.c:5719 __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:1123 [inline] mi_read+0x466/0x660 fs/ntfs3/record.c:148 ntfs_read_mft fs/ntfs3/inode.c:70 [inline] ntfs_iget5+0x4be/0x3810 fs/ntfs3/inode.c:539 ni_update_parent fs/ntfs3/frecord.c:3218 [inline] ni_write_inode+0x16d5/0x2990 fs/ntfs3/frecord.c:3324 write_inode fs/fs-writeback.c:1497 [inline] __writeback_single_inode+0xb36/0xf90 fs/fs-writeback.c:1716 writeback_single_inode+0x2b5/0x5a0 fs/fs-writeback.c:1772 write_inode_now+0x174/0x1f0 fs/fs-writeback.c:2822 ntfs_extend+0x2ec/0x570 fs/ntfs3/file.c:358 ntfs_file_write_iter+0x433/0x2050 fs/ntfs3/file.c:1124 iter_file_splice_write+0x906/0x10b0 fs/splice.c:743 do_splice_from fs/splice.c:941 [inline] direct_splice_actor+0x19b/0x6d0 fs/splice.c:1164 splice_direct_to_actor+0x346/0xa40 fs/splice.c:1108 do_splice_direct_actor fs/splice.c:1207 [inline] do_splice_direct+0x17e/0x250 fs/splice.c:1233 do_sendfile+0xb1e/0xe50 fs/read_write.c:1295 __do_compat_sys_sendfile fs/read_write.c:1383 [inline] __se_compat_sys_sendfile fs/read_write.c:1366 [inline] __ia32_compat_sys_sendfile+0x1e7/0x230 fs/read_write.c:1366 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x73/0x120 arch/x86/entry/common.c:386 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:411 entry_SYSENTER_compat_after_hwframe+0x84/0x8e other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&ni->ni_lock#2); lock(&ni->ni_lock/4); lock(&ni->ni_lock#2); lock(&ni->ni_lock/4); *** DEADLOCK *** 3 locks held by syz.1.1048/8670: #0: ffff88802b62e420 (sb_writers#21){.+.+}-{0:0}, at: splice_direct_to_actor+0x346/0xa40 fs/splice.c:1108 #1: ffff88804bd5eae0 (&sb->s_type->i_mutex_key#28){+.+.}-{3:3}, at: inode_trylock include/linux/fs.h:811 [inline] #1: ffff88804bd5eae0 (&sb->s_type->i_mutex_key#28){+.+.}-{3:3}, at: ntfs_file_write_iter+0x2db/0x2050 fs/ntfs3/file.c:1102 #2: ffff88804bd5e840 (&ni->ni_lock#2){+.+.}-{3:3}, at: ni_trylock fs/ntfs3/ntfs_fs.h:1143 [inline] #2: ffff88804bd5e840 (&ni->ni_lock#2){+.+.}-{3:3}, at: ni_write_inode+0x24c/0x2990 fs/ntfs3/frecord.c:3265 stack backtrace: CPU: 3 PID: 8670 Comm: syz.1.1048 Not tainted 6.10.0-rc5-syzkaller-00018-g55027e689933 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:114 check_noncircular+0x31a/0x400 kernel/locking/lockdep.c:2187 check_prev_add kernel/locking/lockdep.c:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain kernel/locking/lockdep.c:3869 [inline] __lock_acquire+0x2478/0x3b30 kernel/locking/lockdep.c:5137 lock_acquire kernel/locking/lockdep.c:5754 [inline] lock_acquire+0x1b1/0x560 kernel/locking/lockdep.c:5719 __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:1123 [inline] mi_read+0x466/0x660 fs/ntfs3/record.c:148 ntfs_read_mft fs/ntfs3/inode.c:70 [inline] ntfs_iget5+0x4be/0x3810 fs/ntfs3/inode.c:539 ni_update_parent fs/ntfs3/frecord.c:3218 [inline] ni_write_inode+0x16d5/0x2990 fs/ntfs3/frecord.c:3324 write_inode fs/fs-writeback.c:1497 [inline] __writeback_single_inode+0xb36/0xf90 fs/fs-writeback.c:1716 writeback_single_inode+0x2b5/0x5a0 fs/fs-writeback.c:1772 write_inode_now+0x174/0x1f0 fs/fs-writeback.c:2822 ntfs_extend+0x2ec/0x570 fs/ntfs3/file.c:358 ntfs_file_write_iter+0x433/0x2050 fs/ntfs3/file.c:1124 iter_file_splice_write+0x906/0x10b0 fs/splice.c:743 do_splice_from fs/splice.c:941 [inline] direct_splice_actor+0x19b/0x6d0 fs/splice.c:1164 splice_direct_to_actor+0x346/0xa40 fs/splice.c:1108 do_splice_direct_actor fs/splice.c:1207 [inline] do_splice_direct+0x17e/0x250 fs/splice.c:1233 do_sendfile+0xb1e/0xe50 fs/read_write.c:1295 __do_compat_sys_sendfile fs/read_write.c:1383 [inline] __se_compat_sys_sendfile fs/read_write.c:1366 [inline] __ia32_compat_sys_sendfile+0x1e7/0x230 fs/read_write.c:1366 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x73/0x120 arch/x86/entry/common.c:386 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:411 entry_SYSENTER_compat_after_hwframe+0x84/0x8e RIP: 0023:0xf7483579 Code: b8 01 10 06 03 74 b4 01 10 07 03 74 b0 01 10 08 03 74 d8 01 00 00 00 00 00 00 00 00 00 00 00 00 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 8d b4 26 00 00 00 00 8d b4 26 00 00 00 00 RSP: 002b:00000000f5d9b57c EFLAGS: 00000292 ORIG_RAX: 00000000000000bb RAX: ffffffffffffffda RBX: 0000000000000005 RCX: 0000000000000004 RDX: 0000000000000000 RSI: 0000000080000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000292 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 ntfs3: loop1: ino=1d, "file1" failed to open parent directory r=400 to update ntfs3: loop1: ino=1d, "file1" failed to open parent directory r=400 to update ---------------- Code disassembly (best guess), 2 bytes skipped: 0: 10 06 adc %al,(%rsi) 2: 03 74 b4 01 add 0x1(%rsp,%rsi,4),%esi 6: 10 07 adc %al,(%rdi) 8: 03 74 b0 01 add 0x1(%rax,%rsi,4),%esi c: 10 08 adc %cl,(%rax) e: 03 74 d8 01 add 0x1(%rax,%rbx,8),%esi 1e: 00 51 52 add %dl,0x52(%rcx) 21: 55 push %rbp 22: 89 e5 mov %esp,%ebp 24: 0f 34 sysenter 26: cd 80 int $0x80 * 28: 5d pop %rbp <-- trapping instruction 29: 5a pop %rdx 2a: 59 pop %rcx 2b: c3 ret 2c: 90 nop 2d: 90 nop 2e: 90 nop 2f: 90 nop 30: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi 37: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi