syzbot


possible deadlock in mi_read

Status: upstream: reported on 2025/10/10 02:42
Reported-by: syzbot+bc688b7a7970327eef2d@syzkaller.appspotmail.com
First crash: 12d, last: 12d
Similar bugs (5)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-5.15 possible deadlock in mi_read (2) origin:upstream 4 C 16 17d 282d 0/3 upstream: reported C repro on 2025/01/13 02:48
upstream possible deadlock in mi_read ntfs3 4 C error 11141 343d 1116d 28/29 fixed on 2024/11/12 23:31
upstream possible deadlock in mi_read (2) ntfs3 4 C inconclusive 378 12h04m 338d 0/29 upstream: reported C repro on 2024/11/17 08:21
linux-5.15 possible deadlock in mi_read origin:upstream missing-backport 4 C done 827 347d 952d 3/3 fixed on 2024/12/22 10:18
linux-6.1 possible deadlock in mi_read origin:upstream missing-backport 4 C done 837 219d 949d 0/3 upstream: reported C repro on 2023/03/17 09:05

Sample crash report:
============================================
WARNING: possible recursive locking detected
syzkaller #0 Not tainted
--------------------------------------------
syz.7.2594/13031 is trying to acquire lock:
ffff88805d0f6840 (&ni->ni_lock#3/5){+.+.}-{3:3}, at: ni_lock fs/ntfs3/ntfs_fs.h:1119 [inline]
ffff88805d0f6840 (&ni->ni_lock#3/5){+.+.}-{3:3}, at: mi_read+0x2d4/0x5a0 fs/ntfs3/record.c:148

but task is already holding lock:
ffff888057f59e80 (&ni->ni_lock#3/5){+.+.}-{3:3}, at: ni_lock fs/ntfs3/ntfs_fs.h:1119 [inline]
ffff888057f59e80 (&ni->ni_lock#3/5){+.+.}-{3:3}, at: ntfs_rename+0x69d/0xb30 fs/ntfs3/namei.c:329

other info that might help us debug this:
 Possible unsafe locking scenario:

       CPU0
       ----
  lock(&ni->ni_lock#3/5);
  lock(&ni->ni_lock#3/5);

 *** DEADLOCK ***

 May be due to missing lock nesting notation

5 locks held by syz.7.2594/13031:
 #0: ffff88805c344418 (sb_writers#23){.+.+}-{0:0}, at: mnt_want_write+0x41/0x90 fs/namespace.c:403
 #1: ffff88805d0f5c30 (&type->i_mutex_dir_key#19/1){+.+.}-{3:3}, at: lock_rename include/linux/fs.h:-1 [inline]
 #1: ffff88805d0f5c30 (&type->i_mutex_dir_key#19/1){+.+.}-{3:3}, at: do_renameat2+0x427/0xc70 fs/namei.c:4964
 #2: ffff88805d0f5980 (&ni->ni_lock/6){+.+.}-{3:3}, at: ni_lock_dir fs/ntfs3/ntfs_fs.h:1124 [inline]
 #2: ffff88805d0f5980 (&ni->ni_lock/6){+.+.}-{3:3}, at: ntfs_rename+0x687/0xb30 fs/ntfs3/namei.c:328
 #3: ffff888057f59e80 (&ni->ni_lock#3/5){+.+.}-{3:3}, at: ni_lock fs/ntfs3/ntfs_fs.h:1119 [inline]
 #3: ffff888057f59e80 (&ni->ni_lock#3/5){+.+.}-{3:3}, at: ntfs_rename+0x69d/0xb30 fs/ntfs3/namei.c:329
 #4: ffff88802b5fc128 (&wnd->rw_lock/1){+.+.}-{3:3}, at: ntfs_look_free_mft+0x164/0xd40 fs/ntfs3/fsntfs.c:571

stack backtrace:
CPU: 1 PID: 13031 Comm: syz.7.2594 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/18/2025
Call Trace:
 <TASK>
 dump_stack_lvl+0x16c/0x230 lib/dump_stack.c:106
 check_deadlock kernel/locking/lockdep.c:3062 [inline]
 validate_chain kernel/locking/lockdep.c:3856 [inline]
 __lock_acquire+0x5d40/0x7c80 kernel/locking/lockdep.c:5137
 lock_acquire+0x197/0x410 kernel/locking/lockdep.c:5754
 __mutex_lock_common kernel/locking/mutex.c:603 [inline]
 __mutex_lock+0x129/0xcc0 kernel/locking/mutex.c:747
 ni_lock fs/ntfs3/ntfs_fs.h:1119 [inline]
 mi_read+0x2d4/0x5a0 fs/ntfs3/record.c:148
 mi_format_new+0x1a3/0x600 fs/ntfs3/record.c:419
 ni_add_subrecord+0xd0/0x440 fs/ntfs3/frecord.c:374
 ntfs_look_free_mft+0x6a8/0xd40 fs/ntfs3/fsntfs.c:715
 ni_create_attr_list+0x904/0x1370 fs/ntfs3/frecord.c:878
 ni_ins_attr_ext+0x315/0x9c0 fs/ntfs3/frecord.c:976
 ni_insert_attr fs/ntfs3/frecord.c:1143 [inline]
 ni_insert_resident fs/ntfs3/frecord.c:1527 [inline]
 ni_add_name+0x6e0/0xc90 fs/ntfs3/frecord.c:3042
 ni_rename+0x4b/0x100 fs/ntfs3/frecord.c:3081
 ntfs_rename+0x6dc/0xb30 fs/ntfs3/namei.c:333
 vfs_rename+0xb96/0xec0 fs/namei.c:4872
 do_renameat2+0x8a1/0xc70 fs/namei.c:5025
 __do_sys_rename fs/namei.c:5071 [inline]
 __se_sys_rename fs/namei.c:5069 [inline]
 __x64_sys_rename+0x86/0x90 fs/namei.c:5069
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:81
 entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7f6b81f8eec9
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:00007f6b82eb9038 EFLAGS: 00000246 ORIG_RAX: 0000000000000052
RAX: ffffffffffffffda RBX: 00007f6b821e6090 RCX: 00007f6b81f8eec9
RDX: 0000000000000000 RSI: 0000200000000f40 RDI: 00002000000003c0
RBP: 00007f6b82011f91 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f6b821e6128 R14: 00007f6b821e6090 R15: 00007ffe8100e368
 </TASK>

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/10/10 02:41 linux-6.6.y e617101e5626 ff1712fe .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan possible deadlock in mi_read
* Struck through repros no longer work on HEAD.