====================================================== WARNING: possible circular locking dependency detected 6.10.0-rc5-syzkaller-00012-g626737a5791b #0 Not tainted ------------------------------------------------------ syz-executor.2/6853 is trying to acquire lock: ffff888032c460e0 (&ni->ni_lock/4){+.+.}-{3:3}, at: ni_lock fs/ntfs3/ntfs_fs.h:1123 [inline] ffff888032c460e0 (&ni->ni_lock/4){+.+.}-{3:3}, at: mi_read+0x466/0x660 fs/ntfs3/record.c:148 but task is already holding lock: ffff888032dfcac0 (&ni->ni_lock#2){+.+.}-{3:3}, at: ni_trylock fs/ntfs3/ntfs_fs.h:1143 [inline] ffff888032dfcac0 (&ni->ni_lock#2){+.+.}-{3:3}, at: ni_write_inode+0x24a/0x2920 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 ntfs_iget5+0x89a/0x3970 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_one_qstr_excl+0x11d/0x190 fs/namei.c:1607 filename_create+0x1ed/0x530 fs/namei.c:3901 do_mknodat+0x18e/0x5d0 fs/namei.c:4046 __do_sys_mknod fs/namei.c:4092 [inline] __se_sys_mknod fs/namei.c:4090 [inline] __x64_sys_mknod+0x119/0x170 fs/namei.c:4090 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #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+0x4c4/0x3970 fs/ntfs3/inode.c:539 ni_update_parent fs/ntfs3/frecord.c:3218 [inline] ni_write_inode+0x1603/0x2920 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_sys_sendfile64 fs/read_write.c:1362 [inline] __se_sys_sendfile64 fs/read_write.c:1348 [inline] __x64_sys_sendfile64+0x1da/0x220 fs/read_write.c:1348 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f 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-executor.2/6853: #0: ffff888046674420 (sb_writers#21){.+.+}-{0:0}, at: splice_direct_to_actor+0x346/0xa40 fs/splice.c:1108 #1: ffff888032dfcd60 (&sb->s_type->i_mutex_key#36){+.+.}-{3:3}, at: inode_trylock include/linux/fs.h:811 [inline] #1: ffff888032dfcd60 (&sb->s_type->i_mutex_key#36){+.+.}-{3:3}, at: ntfs_file_write_iter+0x2db/0x2050 fs/ntfs3/file.c:1102 #2: ffff888032dfcac0 (&ni->ni_lock#2){+.+.}-{3:3}, at: ni_trylock fs/ntfs3/ntfs_fs.h:1143 [inline] #2: ffff888032dfcac0 (&ni->ni_lock#2){+.+.}-{3:3}, at: ni_write_inode+0x24a/0x2920 fs/ntfs3/frecord.c:3265 stack backtrace: CPU: 0 PID: 6853 Comm: syz-executor.2 Not tainted 6.10.0-rc5-syzkaller-00012-g626737a5791b #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-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+0x4c4/0x3970 fs/ntfs3/inode.c:539 ni_update_parent fs/ntfs3/frecord.c:3218 [inline] ni_write_inode+0x1603/0x2920 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_sys_sendfile64 fs/read_write.c:1362 [inline] __se_sys_sendfile64 fs/read_write.c:1348 [inline] __x64_sys_sendfile64+0x1da/0x220 fs/read_write.c:1348 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7ff2a527cee9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 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 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ff2a5fc80c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000028 RAX: ffffffffffffffda RBX: 00007ff2a53abf80 RCX: 00007ff2a527cee9 RDX: 0000000000000000 RSI: 0000000000000004 RDI: 0000000000000005 RBP: 00007ff2a52c949e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000080000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007ff2a53abf80 R15: 00007ffc095ec108 ntfs3: loop2: ino=1d, "file1" failed to open parent directory r=400 to update ntfs3: loop2: ino=1d, "file1" failed to open parent directory r=400 to update