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: 345d, last: 37d
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 1 2d17h 16d 0/26 upstream: reported C repro on 2024/02/13 07:12
linux-5.15 possible deadlock in ntfs_set_state origin:lts-only C inconclusive 6 92d 170d 0/3 upstream: reported C repro on 2023/09/12 02:25
upstream possible deadlock in ntfs_set_state ntfs3 C done done 1360 42d 435d 26/26 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 job log (0)

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 (41):
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
2023/10/11 17:19 linux-6.1.y 082280fe94a0 83165b57 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_set_state
2023/10/07 13:04 linux-6.1.y ecda77b46871 5e837c76 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_set_state
2023/11/28 22:17 linux-6.1.y 6ac30d748bb0 1adfb6f6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
2023/10/09 16:03 linux-6.1.y ecda77b46871 3c53c7d9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
2023/10/06 15:28 linux-6.1.y ecda77b46871 ea12a918 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
2023/09/25 14:10 linux-6.1.y d23900f974e0 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
2023/09/14 07:57 linux-6.1.y 09045dae0d90 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
2023/09/12 03:59 linux-6.1.y 59b13c2b647e 59da8366 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
2023/07/25 18:42 linux-6.1.y 5302e81aa209 6756545c .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_set_state
2023/07/25 04:30 linux-6.1.y 5302e81aa209 b03242d7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_set_state
2023/07/13 04:12 linux-6.1.y 61fd484b2cf6 86081196 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_set_state
2023/07/11 04:37 linux-6.1.y 61fd484b2cf6 52ae002a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_set_state
2023/07/06 04:47 linux-6.1.y 0f4ac6b4c5f0 ba5dba36 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_set_state
2023/05/29 01:53 linux-6.1.y a343b0dd87b4 cf184559 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_set_state
2023/05/22 21:17 linux-6.1.y fa74641fb6b9 4bce1a3e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_set_state
2023/05/04 08:21 linux-6.1.y ca48fc16c493 5b7ff9dd .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_set_state
2023/05/03 11:46 linux-6.1.y ca48fc16c493 48e0a81d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan 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
2023/08/09 04:23 linux-6.1.y 0a4a7855302d 8ad1a287 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
2023/07/06 04:59 linux-6.1.y 61fd484b2cf6 ba5dba36 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
2023/05/29 02:02 linux-6.1.y a343b0dd87b4 cf184559 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
2023/05/26 10:12 linux-6.1.y a343b0dd87b4 b40ef614 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
2023/05/26 09:26 linux-6.1.y a343b0dd87b4 b40ef614 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
2023/05/26 06:15 linux-6.1.y a343b0dd87b4 b40ef614 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
2023/05/25 16:31 linux-6.1.y a343b0dd87b4 0513b3e6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
2023/05/25 14:18 linux-6.1.y a343b0dd87b4 0513b3e6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
2023/05/25 01:10 linux-6.1.y a343b0dd87b4 4bce1a3e .config console log report info [disk image] [vmlinux] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
2023/05/24 19:45 linux-6.1.y a343b0dd87b4 4bce1a3e .config console log report info [disk image] [vmlinux] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
2023/05/24 17:36 linux-6.1.y fa74641fb6b9 4bce1a3e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
2023/05/22 21:14 linux-6.1.y fa74641fb6b9 4bce1a3e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
2023/05/22 21:09 linux-6.1.y fa74641fb6b9 4bce1a3e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
2023/05/21 06:20 linux-6.1.y fa74641fb6b9 4bce1a3e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
2023/05/17 09:20 linux-6.1.y bf4ad6fa4e53 eaac4681 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
2023/05/16 07:08 linux-6.1.y bf4ad6fa4e53 71b00cfb .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
2023/05/11 05:08 linux-6.1.y ca48fc16c493 0fbd49f4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
2023/05/05 18:42 linux-6.1.y ca48fc16c493 de870ca5 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
* Struck through repros no longer work on HEAD.