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: 481d, last: 4d09h
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 567 3h30m 152d 0/27 upstream: reported C repro on 2024/02/13 07:12
linux-5.15 possible deadlock in ntfs_set_state origin:lts-only C inconclusive 35 2d17h 306d 0/3 upstream: reported C repro on 2023/09/12 02:25
upstream possible deadlock in ntfs_set_state ntfs3 C done done 1360 177d 571d 26/27 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 (84):
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/07/08 17:45 linux-6.1.y 7753af06eebf cde64f7d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_set_state
2024/07/07 16:57 linux-6.1.y 7753af06eebf 2a40360c .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_set_state
2024/06/26 22:44 linux-6.1.y eb44d83053d6 c6d33a01 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_set_state
2024/06/23 02:36 linux-6.1.y eb44d83053d6 edc5149a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_set_state
2024/06/16 11:21 linux-6.1.y ae9f2a70d69e f429ab00 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_set_state
2024/06/14 11:54 linux-6.1.y ae9f2a70d69e 8d849073 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_set_state
2024/06/01 03:23 linux-6.1.y 88690811da69 3113787f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_set_state
2024/05/28 14:36 linux-6.1.y 88690811da69 f550015e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_set_state
2024/05/22 15:03 linux-6.1.y 4078fa637fcd 4d098039 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_set_state
2024/05/22 00:52 linux-6.1.y 4078fa637fcd 1014eca7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_set_state
2024/05/21 15:49 linux-6.1.y 4078fa637fcd 4c0d3ee3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_set_state
2024/05/18 22:44 linux-6.1.y 4078fa637fcd c0f1611a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_set_state
2024/05/03 16:27 linux-6.1.y 909ba1f1b414 dd26401e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_set_state
2024/05/03 05:36 linux-6.1.y 909ba1f1b414 ddfc15a1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_set_state
2024/04/30 02:59 linux-6.1.y dcbc050cb0d3 f10afd69 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan 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
2024/07/10 05:11 linux-6.1.y 7753af06eebf bc144f9a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
2024/07/09 10:41 linux-6.1.y 7753af06eebf bc23a442 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
2024/07/03 05:24 linux-6.1.y 99e6a620de00 1ecfa2d8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
2024/06/21 16:45 linux-6.1.y eb44d83053d6 edc5149a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
2024/06/17 02:43 linux-6.1.y eb44d83053d6 f429ab00 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
2024/06/16 13:10 linux-6.1.y eb44d83053d6 f429ab00 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
2024/06/15 10:46 linux-6.1.y ae9f2a70d69e f429ab00 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
2024/06/15 03:51 linux-6.1.y ae9f2a70d69e f429ab00 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
2024/06/13 03:57 linux-6.1.y ae9f2a70d69e 2aa5052f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
2024/06/10 15:55 linux-6.1.y 88690811da69 048c640a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
2024/06/07 19:21 linux-6.1.y 88690811da69 82c05ab8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
2024/06/04 12:59 linux-6.1.y 88690811da69 11f2afa5 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
2024/06/04 01:42 linux-6.1.y 88690811da69 a1feae05 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
2024/06/04 01:42 linux-6.1.y 88690811da69 a1feae05 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
2024/05/31 02:36 linux-6.1.y 88690811da69 34889ee3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
2024/05/28 06:53 linux-6.1.y 88690811da69 f550015e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
2024/05/25 17:40 linux-6.1.y 88690811da69 a10a183e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
2024/05/24 21:08 linux-6.1.y 4078fa637fcd a10a183e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_set_state
2024/05/24 08:12 linux-6.1.y 4078fa637fcd 8f98448e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 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/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/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.