syzbot


possible deadlock in ntfs_set_state

Status: upstream: reported C repro on 2023/03/21 01:37
Bug presence: origin:upstream
Labels: missing-backport
[Documentation on labels]
Reported-by: syzbot+93a13140a96de3ffd18c@syzkaller.appspotmail.com
First crash: 626d, last: 29d
Bug presence (3)
Date Name Commit Repro Result
2023/11/10 linux-6.1.y (ToT) fb2635ac69ab C [report] possible deadlock in ntfs_set_state
2023/05/13 upstream (ToT) 76c7f8873a76 C [report] possible deadlock in ntfs_set_state
2023/11/10 upstream (ToT) a12deb44f973 C Didn't crash
Similar bugs (3)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream possible deadlock in ntfs_set_state (2) ntfs3 C error 943 56d 297d 28/28 fixed on 2024/11/12 23:31
linux-5.15 possible deadlock in ntfs_set_state origin:lts-only C inconclusive 128 28d 451d 0/3 upstream: reported C repro on 2023/09/12 02:25
upstream possible deadlock in ntfs_set_state ntfs3 C done done 1360 322d 716d 25/28 fixed on 2024/01/30 15:47
Fix bisection attempts (1)
Created Duration User Patch Repo Result
2023/12/20 13:03 2h15m fix candidate upstream OK (0) job log

Sample crash report:
ntfs3: loop0: Different NTFS' sector size (2048) and media sector size (512)
ntfs3: loop0: ino=1b, "file0" ntfs_iget5
============================================
WARNING: possible recursive locking detected
6.1.27-syzkaller #0 Not tainted
--------------------------------------------
syz-executor120/4217 is trying to acquire lock:
ffff0000e2400100 (&ni->ni_lock){+.+.}-{3:3}, at: ntfs_set_state+0x1a4/0x5c4 fs/ntfs3/fsntfs.c:920

but task is already holding lock:
ffff0000e2407700 (&ni->ni_lock){+.+.}-{3:3}, at: ni_trylock fs/ntfs3/ntfs_fs.h:1123 [inline]
ffff0000e2407700 (&ni->ni_lock){+.+.}-{3:3}, at: ni_write_inode+0x134/0xfb8 fs/ntfs3/frecord.c:3240

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

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

 *** DEADLOCK ***

 May be due to missing lock nesting notation

3 locks held by syz-executor120/4217:
 #0: ffff0000d5d0a460 (sb_writers#8){.+.+}-{0:0}, at: mnt_want_write+0x44/0x9c fs/namespace.c:393
 #1: ffff0000e24079a0 (&sb->s_type->i_mutex_key#17){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:756 [inline]
 #1: ffff0000e24079a0 (&sb->s_type->i_mutex_key#17){+.+.}-{3:3}, at: do_truncate+0x1ac/0x28c fs/open.c:63
 #2: ffff0000e2407700 (&ni->ni_lock){+.+.}-{3:3}, at: ni_trylock fs/ntfs3/ntfs_fs.h:1123 [inline]
 #2: ffff0000e2407700 (&ni->ni_lock){+.+.}-{3:3}, at: ni_write_inode+0x134/0xfb8 fs/ntfs3/frecord.c:3240

stack backtrace:
CPU: 0 PID: 4217 Comm: syz-executor120 Not tainted 6.1.27-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/14/2023
Call trace:
 dump_backtrace+0x1c8/0x1f4 arch/arm64/kernel/stacktrace.c:158
 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106
 dump_stack+0x1c/0x5c lib/dump_stack.c:113
 __lock_acquire+0x6310/0x764c kernel/locking/lockdep.c:5056
 lock_acquire+0x26c/0x7cc kernel/locking/lockdep.c:5669
 __mutex_lock_common+0x190/0x21a0 kernel/locking/mutex.c:603
 __mutex_lock kernel/locking/mutex.c:747 [inline]
 mutex_lock_nested+0x38/0x44 kernel/locking/mutex.c:799
 ntfs_set_state+0x1a4/0x5c4 fs/ntfs3/fsntfs.c:920
 ntfs_bad_inode+0x88/0x9c fs/ntfs3/fsntfs.c:885
 ntfs_iget5+0x2d4/0x2b38 fs/ntfs3/inode.c:520
 ni_update_parent+0x688/0xa58 fs/ntfs3/frecord.c:3196
 ni_write_inode+0xc4c/0xfb8 fs/ntfs3/frecord.c:3291
 ntfs_sync_inode+0x2c/0x3c fs/ntfs3/inode.c:1025
 ntfs_truncate fs/ntfs3/file.c:508 [inline]
 ntfs3_setattr+0x784/0x974 fs/ntfs3/file.c:792
 notify_change+0xc24/0xec0 fs/attr.c:482
 do_truncate+0x1c0/0x28c fs/open.c:65
 vfs_truncate+0x2c4/0x36c fs/open.c:111
 do_sys_truncate+0xec/0x1b4 fs/open.c:134
 __do_sys_truncate fs/open.c:146 [inline]
 __se_sys_truncate fs/open.c:144 [inline]
 __arm64_sys_truncate+0x5c/0x70 fs/open.c:144
 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
 invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52
 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
 do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:206
 el0_svc+0x58/0x168 arch/arm64/kernel/entry-common.c:637
 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:581
ntfs3: loop0: Mark volume as dirty due to NTFS errors

Crashes (194):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/05/06 08:44 linux-6.1.y ca48fc16c493 de870ca5 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
2023/06/03 23:41 linux-6.1.y d2869ace6eeb a4ae4f42 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan possible deadlock in ntfs_set_state
2024/01/23 16:40 linux-6.1.y 8fd7f4462453 1c0ecc51 .config console log report syz [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
2024/01/21 05:36 linux-6.1.y 8fd7f4462453 9bd8dcda .config console log report syz [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
2023/10/07 02:06 linux-6.1.y ecda77b46871 ea12a918 .config console log report syz [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
2024/11/03 15:28 linux-6.1.y 7c15117f9468 f00eed24 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_set_state
2024/10/29 10:23 linux-6.1.y 7ec6f9fa3d97 66aeb999 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_set_state
2024/10/26 16:51 linux-6.1.y 7ec6f9fa3d97 65e8686b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_set_state
2024/10/24 14:56 linux-6.1.y 7ec6f9fa3d97 0d144d1a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_set_state
2024/10/23 03:43 linux-6.1.y 7ec6f9fa3d97 15fa2979 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_set_state
2024/10/11 06:47 linux-6.1.y aa4cd140bba5 cd942402 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_set_state
2024/10/10 03:48 linux-6.1.y aa4cd140bba5 0278d004 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_set_state
2024/10/09 14:28 linux-6.1.y aa4cd140bba5 56fb2cb7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_set_state
2024/10/09 14:28 linux-6.1.y aa4cd140bba5 56fb2cb7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_set_state
2024/10/08 15:46 linux-6.1.y aa4cd140bba5 402f1df0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_set_state
2024/10/04 00:50 linux-6.1.y aa4cd140bba5 d7906eff .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_set_state
2024/10/03 20:36 linux-6.1.y aa4cd140bba5 d7906eff .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_set_state
2024/10/03 12:30 linux-6.1.y aa4cd140bba5 a4c7fd36 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_set_state
2024/10/02 12:32 linux-6.1.y aa4cd140bba5 02f9582a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_set_state
2024/09/30 16:48 linux-6.1.y aa4cd140bba5 bbd4e0a4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_set_state
2024/09/28 11:08 linux-6.1.y e526b12bf916 ba29ff75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_set_state
2024/09/27 19:28 linux-6.1.y e526b12bf916 440b26ec .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_set_state
2024/09/26 21:32 linux-6.1.y e526b12bf916 9314348a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_set_state
2024/09/26 08:10 linux-6.1.y e526b12bf916 0d19f247 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_set_state
2024/09/25 17:48 linux-6.1.y e526b12bf916 349a68c4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_set_state
2024/09/20 04:45 linux-6.1.y e526b12bf916 6f888b75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_set_state
2024/09/17 12:37 linux-6.1.y 5f55cad62cc9 c673ca06 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_set_state
2024/09/14 04:57 linux-6.1.y 5f55cad62cc9 b58f933c .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_set_state
2024/09/04 20:42 linux-6.1.y 699506173494 dfbe2ed4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_set_state
2024/09/03 19:25 linux-6.1.y 311d8503ef9f 326f9c5a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_set_state
2024/08/30 20:34 linux-6.1.y 311d8503ef9f 1eda0d14 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_set_state
2024/08/30 05:54 linux-6.1.y 311d8503ef9f ee2602b8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_set_state
2024/08/27 17:51 linux-6.1.y ee5e09825b81 6c853ff9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_set_state
2024/08/27 00:52 linux-6.1.y ee5e09825b81 9aee4e0b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_set_state
2024/11/07 13:33 linux-6.1.y 7c15117f9468 867e44df .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
2024/11/06 09:15 linux-6.1.y 7c15117f9468 3a465482 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
2024/11/05 13:59 linux-6.1.y 7c15117f9468 da38b4c9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
2024/11/03 14:21 linux-6.1.y 7c15117f9468 f00eed24 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
2024/10/25 02:47 linux-6.1.y 7ec6f9fa3d97 c79b8ca5 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
2024/10/18 23:07 linux-6.1.y 54d90d17e8ce cd6fc0a3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
2024/10/18 23:07 linux-6.1.y 54d90d17e8ce cd6fc0a3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
2024/10/17 03:08 linux-6.1.y aa4cd140bba5 666f77ed .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
2024/10/16 21:11 linux-6.1.y aa4cd140bba5 666f77ed .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
2024/10/15 11:37 linux-6.1.y aa4cd140bba5 7eb57b4a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
2024/10/14 22:34 linux-6.1.y aa4cd140bba5 b01b6661 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
2024/10/10 16:45 linux-6.1.y aa4cd140bba5 8fbfc0c8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
2024/10/02 14:03 linux-6.1.y aa4cd140bba5 02f9582a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
2024/10/01 14:04 linux-6.1.y aa4cd140bba5 ea2b66a6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
2024/09/30 18:28 linux-6.1.y aa4cd140bba5 bbd4e0a4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
2024/09/27 20:28 linux-6.1.y e526b12bf916 440b26ec .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
2024/09/25 10:49 linux-6.1.y e526b12bf916 349a68c4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
2024/09/18 19:07 linux-6.1.y e526b12bf916 c673ca06 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
2024/09/14 21:36 linux-6.1.y 5f55cad62cc9 08d8a733 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
2024/09/12 04:51 linux-6.1.y 5ca5b389fddf d94c83d8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
2024/09/10 15:52 linux-6.1.y 5ca5b389fddf 86aa7bd7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
2024/09/04 13:57 linux-6.1.y 699506173494 9d47f20a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
2024/09/04 06:29 linux-6.1.y 311d8503ef9f 9d47f20a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
2024/08/30 03:23 linux-6.1.y 311d8503ef9f 9bd464fc .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
2023/03/21 01:36 linux-6.1.y 7eaef76fbc46 7939252e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_set_state
* Struck through repros no longer work on HEAD.