====================================================== WARNING: possible circular locking dependency detected 6.10.0-rc5-syzkaller-00018-g55027e689933 #0 Not tainted ------------------------------------------------------ syz.2.1029/9247 is trying to acquire lock: ffff88804c7a8fc0 (&ni->ni_lock#3){+.+.}-{3:3}, at: ntfs_set_state+0x1d2/0x6a0 fs/ntfs3/fsntfs.c:947 but task is already holding lock: ffff88804c6a1e80 (&ni->ni_lock/4){+.+.}-{3:3}, at: ni_lock fs/ntfs3/ntfs_fs.h:1123 [inline] ffff88804c6a1e80 (&ni->ni_lock/4){+.+.}-{3:3}, at: ntfs_lookup+0x1b8/0x2a0 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 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 -> #0 (&ni->ni_lock#3){+.+.}-{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 ntfs_set_state+0x1d2/0x6a0 fs/ntfs3/fsntfs.c:947 ntfs_iget5+0x861/0x3810 fs/ntfs3/inode.c:546 dir_search_u+0x162/0x3d0 fs/ntfs3/dir.c:264 ntfs_lookup+0x1c5/0x2a0 fs/ntfs3/namei.c:85 lookup_open.isra.0+0x928/0x13c0 fs/namei.c:3483 open_last_lookups fs/namei.c:3574 [inline] path_openat+0x92f/0x29f0 fs/namei.c:3804 do_filp_open+0x1dc/0x430 fs/namei.c:3834 do_sys_openat2+0x17a/0x1e0 fs/open.c:1405 do_sys_open fs/open.c:1420 [inline] __do_sys_creat fs/open.c:1496 [inline] __se_sys_creat fs/open.c:1490 [inline] __ia32_sys_creat+0xcc/0x120 fs/open.c:1490 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/4); lock(&ni->ni_lock#3); lock(&ni->ni_lock/4); lock(&ni->ni_lock#3); *** DEADLOCK *** 3 locks held by syz.2.1029/9247: #0: ffff888057f5e420 (sb_writers#22){.+.+}-{0:0}, at: open_last_lookups fs/namei.c:3563 [inline] #0: ffff888057f5e420 (sb_writers#22){.+.+}-{0:0}, at: path_openat+0x19e6/0x29f0 fs/namei.c:3804 #1: ffff88804c6a2120 (&type->i_mutex_dir_key#16){++++}-{3:3}, at: inode_lock include/linux/fs.h:791 [inline] #1: ffff88804c6a2120 (&type->i_mutex_dir_key#16){++++}-{3:3}, at: open_last_lookups fs/namei.c:3571 [inline] #1: ffff88804c6a2120 (&type->i_mutex_dir_key#16){++++}-{3:3}, at: path_openat+0x8c7/0x29f0 fs/namei.c:3804 #2: ffff88804c6a1e80 (&ni->ni_lock/4){+.+.}-{3:3}, at: ni_lock fs/ntfs3/ntfs_fs.h:1123 [inline] #2: ffff88804c6a1e80 (&ni->ni_lock/4){+.+.}-{3:3}, at: ntfs_lookup+0x1b8/0x2a0 fs/ntfs3/namei.c:84 stack backtrace: CPU: 0 PID: 9247 Comm: syz.2.1029 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 ntfs_set_state+0x1d2/0x6a0 fs/ntfs3/fsntfs.c:947 ntfs_iget5+0x861/0x3810 fs/ntfs3/inode.c:546 dir_search_u+0x162/0x3d0 fs/ntfs3/dir.c:264 ntfs_lookup+0x1c5/0x2a0 fs/ntfs3/namei.c:85 lookup_open.isra.0+0x928/0x13c0 fs/namei.c:3483 open_last_lookups fs/namei.c:3574 [inline] path_openat+0x92f/0x29f0 fs/namei.c:3804 do_filp_open+0x1dc/0x430 fs/namei.c:3834 do_sys_openat2+0x17a/0x1e0 fs/open.c:1405 do_sys_open fs/open.c:1420 [inline] __do_sys_creat fs/open.c:1496 [inline] __se_sys_creat fs/open.c:1490 [inline] __ia32_sys_creat+0xcc/0x120 fs/open.c:1490 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:0xf73e9579 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:00000000f5d0157c EFLAGS: 00000292 ORIG_RAX: 0000000000000008 RAX: ffffffffffffffda RBX: 00000000200000c0 RCX: 0000000000000000 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000292 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 ntfs3: loop2: Mark volume as dirty due to NTFS errors ---------------- 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