syzbot


possible deadlock in mi_read (2)

Status: upstream: reported C repro on 2025/01/13 02:48
Bug presence: origin:upstream
[Documentation on labels]
Reported-by: syzbot+c69c5ad75584648b282b@syzkaller.appspotmail.com
First crash: 2d05h, last: 2d04h
Bug presence (1)
Date Name Commit Repro Result
2025/01/13 upstream (ToT) 5bc55a333a2f C [report] possible deadlock in mi_read
Similar bugs (4)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream possible deadlock in mi_read ntfs3 C error 11141 63d 836d 28/28 fixed on 2024/11/12 23:31
upstream possible deadlock in mi_read (2) ntfs3 C inconclusive 73 30m 59d 0/28 upstream: reported C repro on 2024/11/17 08:21
linux-5.15 possible deadlock in mi_read origin:upstream missing-backport C done 827 67d 673d 3/3 fixed on 2024/12/22 10:18
linux-6.1 possible deadlock in mi_read origin:upstream missing-backport C done 830 2d04h 669d 0/3 upstream: reported C repro on 2023/03/17 09:05

Sample crash report:
loop0: detected capacity change from 0 to 4096
ntfs3: loop0: Mark volume as dirty due to NTFS errors
ntfs3: loop0: Failed to load $Extend.
============================================
WARNING: possible recursive locking detected
5.15.176-syzkaller #0 Not tainted
--------------------------------------------
syz-executor285/4162 is trying to acquire lock:
ffff88806ee51e80 (&ni->ni_lock/5){+.+.}-{3:3}, at: ni_lock fs/ntfs3/ntfs_fs.h:1100 [inline]
ffff88806ee51e80 (&ni->ni_lock/5){+.+.}-{3:3}, at: mi_read+0x2dd/0x5a0 fs/ntfs3/record.c:148

but task is already holding lock:
ffff88806ee55980 (&ni->ni_lock/5){+.+.}-{3:3}, at: ni_lock fs/ntfs3/ntfs_fs.h:1100 [inline]
ffff88806ee55980 (&ni->ni_lock/5){+.+.}-{3:3}, at: ntfs_rename+0x710/0xd40 fs/ntfs3/namei.c:315

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

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

 *** DEADLOCK ***

 May be due to missing lock nesting notation

6 locks held by syz-executor285/4162:
 #0: ffff8880728ae460 (sb_writers#9){.+.+}-{0:0}, at: mnt_want_write+0x3b/0x80 fs/namespace.c:377
 #1: ffff88806ee554c0 (&type->i_mutex_dir_key#6/1){+.+.}-{3:3}, at: do_renameat2+0x67e/0x1700 fs/namei.c:4924
 #2: ffff88806ee55c20 (&sb->s_type->i_mutex_key#15/4){+.+.}-{3:3}, at: vfs_rename+0x7e4/0x10f0 fs/namei.c:4803
 #3: ffff88806ee55220 (&ni->ni_lock/6){+.+.}-{3:3}, at: ni_lock_dir fs/ntfs3/ntfs_fs.h:1105 [inline]
 #3: ffff88806ee55220 (&ni->ni_lock/6){+.+.}-{3:3}, at: ntfs_rename+0x6fa/0xd40 fs/ntfs3/namei.c:314
 #4: ffff88806ee55980 (&ni->ni_lock/5){+.+.}-{3:3}, at: ni_lock fs/ntfs3/ntfs_fs.h:1100 [inline]
 #4: ffff88806ee55980 (&ni->ni_lock/5){+.+.}-{3:3}, at: ntfs_rename+0x710/0xd40 fs/ntfs3/namei.c:315
 #5: ffff8880728ac120 (&wnd->rw_lock/1){+.+.}-{3:3}, at: ntfs_look_free_mft+0x1e7/0xff0 fs/ntfs3/fsntfs.c:542

stack backtrace:
CPU: 1 PID: 4162 Comm: syz-executor285 Not tainted 5.15.176-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106
 print_deadlock_bug kernel/locking/lockdep.c:2946 [inline]
 check_deadlock kernel/locking/lockdep.c:2989 [inline]
 validate_chain+0x46d2/0x5930 kernel/locking/lockdep.c:3775
 __lock_acquire+0x1295/0x1ff0 kernel/locking/lockdep.c:5012
 lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623
 __mutex_lock_common+0x1da/0x25a0 kernel/locking/mutex.c:596
 __mutex_lock kernel/locking/mutex.c:729 [inline]
 mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743
 ni_lock fs/ntfs3/ntfs_fs.h:1100 [inline]
 mi_read+0x2dd/0x5a0 fs/ntfs3/record.c:148
 mi_format_new+0x1a7/0x5c0 fs/ntfs3/record.c:374
 ni_add_subrecord+0xde/0x430 fs/ntfs3/frecord.c:372
 ntfs_look_free_mft+0x7f1/0xff0 fs/ntfs3/fsntfs.c:686
 ni_create_attr_list+0x9b6/0x1470 fs/ntfs3/frecord.c:850
 ni_ins_attr_ext+0x364/0xb30 fs/ntfs3/frecord.c:951
 ni_insert_attr fs/ntfs3/frecord.c:1105 [inline]
 ni_insert_resident fs/ntfs3/frecord.c:1479 [inline]
 ni_add_name+0x689/0x9d0 fs/ntfs3/frecord.c:2985
 ni_rename+0xbe/0x1e0 fs/ntfs3/frecord.c:3025
 ntfs_rename+0x74a/0xd40 fs/ntfs3/namei.c:318
 vfs_rename+0xd32/0x10f0 fs/namei.c:4832
 do_renameat2+0xe0f/0x1700 fs/namei.c:4985
 __do_sys_rename fs/namei.c:5031 [inline]
 __se_sys_rename fs/namei.c:5029 [inline]
 __x64_sys_rename+0x82/0x90 fs/namei.c:5029
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7f5d622587b9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 61 17 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffce4613be8 EFLAGS: 00000246 ORIG_RAX: 0000000000000052
RAX: ffffffffffffffda RBX: 0030656c69662f2e RCX: 00007f5d622587b9
RDX: 00007f5d622587b9 RSI: 0000000020000480 RDI: 0000000020000340

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/01/13 03:51 linux-5.15.y 4735586da88e 6dbc6a9b .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-5-15-kasan possible deadlock in mi_read
2025/01/13 03:12 linux-5.15.y 4735586da88e 6dbc6a9b .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-5-15-kasan possible deadlock in mi_read
2025/01/13 02:47 linux-5.15.y 4735586da88e 6dbc6a9b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in mi_read
2025/01/13 02:47 linux-5.15.y 4735586da88e 6dbc6a9b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in mi_read
* Struck through repros no longer work on HEAD.