syzbot


possible deadlock in ntfs_set_state

Status: fixed on 2024/01/30 15:47
Subsystems: ntfs3
[Documentation on labels]
Reported-by: syzbot+f91c29a5d5a01ada051a@syzkaller.appspotmail.com
Fix commit: 6f861765464f fs: Block writes to mounted block devices
First crash: 661d, last: 266d
Cause bisection: introduced by (bisect log) :
commit d9a434fa0c12ed5f7afe1e9dd30003ab5d059b85
Author: Jason Yan <yanaijie@huawei.com>
Date: Wed Jul 20 02:51:20 2022 +0000

  scsi: core: Fix warning in scsi_alloc_sgtables()

Crash: KASAN: out-of-bounds Write in end_buffer_read_sync (log)
Repro: C syz .config
  
Fix bisection: fixed by (bisect log) :
commit 6f861765464f43a71462d52026fbddfc858239a5
Author: Jan Kara <jack@suse.cz>
Date: Wed Nov 1 17:43:10 2023 +0000

  fs: Block writes to mounted block devices

  
Discussions (10)
Title Replies (including bot) Last reply
[syzbot] [ntfs3?] possible deadlock in ntfs_set_state 1 (3) 2024/01/15 13:41
[syzbot] Monthly ntfs3 report (Dec 2023) 0 (1) 2023/12/02 14:45
[syzbot] Monthly ntfs3 report (Oct 2023) 0 (1) 2023/11/01 10:13
[syzbot] Monthly ntfs3 report (Sep 2023) 0 (1) 2023/10/02 09:42
[syzbot] Monthly ntfs3 report (Aug 2023) 0 (1) 2023/08/30 12:45
[syzbot] Monthly ntfs3 report (Jul 2023) 0 (1) 2023/07/30 13:16
[syzbot] Monthly ntfs3 report (Jun 2023) 0 (1) 2023/06/29 09:21
[syzbot] Monthly ntfs3 report (May 2023) 0 (1) 2023/05/29 08:47
[syzbot] Monthly ntfs3 report (Apr 2023) 0 (1) 2023/04/28 08:47
[syzbot] Monthly ntfs3 report 0 (1) 2023/03/27 17:38
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 942 1d11h 240d 22/28 upstream: reported C repro on 2024/02/13 07:12
linux-6.1 possible deadlock in ntfs_set_state origin:upstream missing-backport C inconclusive 165 12h56m 570d 0/3 upstream: reported C repro on 2023/03/21 01:37
linux-5.15 possible deadlock in ntfs_set_state origin:lts-only C inconclusive 107 5h50m 395d 0/3 upstream: reported C repro on 2023/09/12 02:25
Last patch testing requests (6)
Created Duration User Patch Repo Result
2023/12/14 11:59 10m retest repro upstream report log
2023/11/02 17:53 21m retest repro upstream OK log
2023/11/02 17:18 21m retest repro linux-next OK log
2023/11/02 13:46 20m retest repro upstream OK log
2023/11/02 13:46 27m retest repro git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci OK log
2023/09/11 10:53 26m retest repro upstream OK log

Sample crash report:
loop0: detected capacity change from 0 to 4096
ntfs3: loop0: Different NTFS sector size (4096) and media sector size (512).
ntfs3: loop0: ino=5, "/" ntfs_iget5
============================================
WARNING: possible recursive locking detected
6.6.0-syzkaller-12401-g8f6f76a6a29f #0 Not tainted
--------------------------------------------
syz-executor174/5058 is trying to acquire lock:
ffff88807d450100 (&ni->ni_lock#3){+.+.}-{3:3}, at: ntfs_set_state+0x1ff/0x6b0 fs/ntfs3/fsntfs.c:946

but task is already holding lock:
ffff88807d456fa0 (&ni->ni_lock#3){+.+.}-{3:3}, at: ni_trylock fs/ntfs3/ntfs_fs.h:1144 [inline]
ffff88807d456fa0 (&ni->ni_lock#3){+.+.}-{3:3}, at: ni_write_inode+0x172/0x1090 fs/ntfs3/frecord.c:3262

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

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

 *** DEADLOCK ***

 May be due to missing lock nesting notation

3 locks held by syz-executor174/5058:
 #0: ffff88807712e418 (sb_writers#9){.+.+}-{0:0}, at: do_sys_ftruncate+0x258/0x390 fs/open.c:191
 #1: ffff88807d457240 (&sb->s_type->i_mutex_key#14){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:802 [inline]
 #1: ffff88807d457240 (&sb->s_type->i_mutex_key#14){+.+.}-{3:3}, at: do_truncate+0x20c/0x300 fs/open.c:64
 #2: ffff88807d456fa0 (&ni->ni_lock#3){+.+.}-{3:3}, at: ni_trylock fs/ntfs3/ntfs_fs.h:1144 [inline]
 #2: ffff88807d456fa0 (&ni->ni_lock#3){+.+.}-{3:3}, at: ni_write_inode+0x172/0x1090 fs/ntfs3/frecord.c:3262

stack backtrace:
CPU: 0 PID: 5058 Comm: syz-executor174 Not tainted 6.6.0-syzkaller-12401-g8f6f76a6a29f #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/09/2023
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106
 check_deadlock kernel/locking/lockdep.c:3062 [inline]
 validate_chain kernel/locking/lockdep.c:3855 [inline]
 __lock_acquire+0x6a81/0x7f70 kernel/locking/lockdep.c:5136
 lock_acquire+0x1e3/0x520 kernel/locking/lockdep.c:5753
 __mutex_lock_common kernel/locking/mutex.c:603 [inline]
 __mutex_lock+0x136/0xd60 kernel/locking/mutex.c:747
 ntfs_set_state+0x1ff/0x6b0 fs/ntfs3/fsntfs.c:946
 ntfs_iget5+0x3f0/0x3b70 fs/ntfs3/inode.c:537
 ni_update_parent+0x943/0xdc0 fs/ntfs3/frecord.c:3218
 ni_write_inode+0xe60/0x1090 fs/ntfs3/frecord.c:3321
 ntfs_truncate fs/ntfs3/file.c:408 [inline]
 ntfs3_setattr+0x724/0xae0 fs/ntfs3/file.c:683
 notify_change+0xb99/0xe60 fs/attr.c:499
 do_truncate+0x220/0x300 fs/open.c:66
 do_sys_ftruncate+0x2f3/0x390 fs/open.c:194
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x44/0x110 arch/x86/entry/common.c:82
 entry_SYSCALL_64_after_hwframe+0x63/0x6b
RIP: 0033:0x7f284caf55f9
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:00007ffe6c44eef8 EFLAGS: 00000246 ORIG_RAX: 000000000000004d
RAX: ffffffffffffffda RBX: 00007ffe6c44f0c8 RCX: 00007f284caf55f9
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000004
RBP: 00007f284cb87610 R08: 0000000000000000 R09: 00007ffe6c44f0c8
R10: 000000000001f20a R11: 0000000000000246 R12: 0000000000000001
R13: 00007ffe6c44f0b8 R14: 0000000000000001 R15: 0000000000000001
 </TASK>


Crashes (1360):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/11/03 18:33 upstream 8f6f76a6a29f c4ac074c .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-upstream-fs possible deadlock in ntfs_set_state
2023/09/21 00:39 upstream 5d2f53532ecc 0b6a67ac .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci-upstream-kasan-gce-smack-root possible deadlock in ntfs_set_state
2023/06/17 01:45 upstream 40f71e7cd3c6 f3921d4d .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci-upstream-kasan-gce-root possible deadlock in ntfs_set_state
2022/12/20 15:22 upstream aeba12b26c79 c52b2efb .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-upstream-fs possible deadlock in ntfs_set_state
2023/07/23 16:15 linux-next ae867bc97b71 27cbe77f .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci-upstream-linux-next-kasan-gce-root possible deadlock in ntfs_set_state
2023/05/04 18:45 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 14f8db1c0f9a 3a560463 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro #1] [mounted in repro #2] ci-upstream-gce-arm64 possible deadlock in ntfs_set_state
2024/01/18 18:24 upstream 296455ade1fd 239abf84 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_set_state
2023/11/30 11:37 upstream 3b47bc037bd4 f819d6f7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_set_state
2023/11/24 16:39 upstream f1a09972a45a 5b429f39 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_set_state
2023/11/18 22:04 upstream 23dfa043f6d5 cb976f63 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_set_state
2023/11/16 01:21 upstream c42d9eeef8e5 cb976f63 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_set_state
2023/11/14 04:06 upstream 9bacdd8996c7 cb976f63 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_set_state
2023/11/13 17:45 upstream b85ea95d0864 6d6dbf8a .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_set_state
2023/11/09 11:29 upstream 6bc986ab839c 4862372a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in ntfs_set_state
2023/11/04 23:40 upstream 90b0c2b2edd1 500bfdc4 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in ntfs_set_state
2023/11/03 18:17 upstream 8f6f76a6a29f c4ac074c .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_set_state
2023/10/19 10:47 upstream dd72f9c7e512 42e1d524 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_set_state
2023/10/18 17:38 upstream dd72f9c7e512 342b9c55 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_set_state
2023/10/18 01:57 upstream 06dc10eae55b 342b9c55 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_set_state
2023/10/16 19:30 upstream 58720809f527 342b9c55 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_set_state
2023/10/16 12:03 upstream 58720809f527 f757a323 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_set_state
2023/10/16 10:48 upstream 58720809f527 f757a323 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_set_state
2023/10/15 20:36 upstream fbe1bf1e5ff1 f757a323 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_set_state
2023/10/15 06:54 upstream 70f8c6f8f880 f757a323 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_set_state
2023/10/14 20:10 upstream 70f8c6f8f880 f757a323 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_set_state
2023/10/13 15:35 upstream 10a6e5feccb8 f757a323 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_set_state
2023/10/13 09:46 upstream ce583d5fb9d3 6388bc36 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root possible deadlock in ntfs_set_state
2023/10/12 23:10 upstream e8c127b05766 6388bc36 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_set_state
2023/10/12 21:19 upstream 401644852d0b 6388bc36 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_set_state
2023/10/11 22:18 upstream 8182d7a3f1b8 83165b57 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_set_state
2023/10/10 22:45 upstream 1c8b86a3799f 83165b57 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_set_state
2023/10/09 14:05 upstream 94f6f0550c62 3c53c7d9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_set_state
2023/10/09 04:33 upstream 37faf07bf90a 5e837c76 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_set_state
2023/10/08 19:43 upstream 37faf07bf90a 5e837c76 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_set_state
2023/10/08 16:02 upstream b9ddbb0cde2a 5e837c76 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_set_state
2023/10/08 07:39 upstream b9ddbb0cde2a 5e837c76 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_set_state
2023/10/07 21:50 upstream b9ddbb0cde2a 5e837c76 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_set_state
2023/10/06 16:36 upstream 7de25c855b63 ea12a918 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_set_state
2023/10/06 14:30 upstream b78b18fb8ee1 ea12a918 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_set_state
2023/10/06 07:38 upstream b78b18fb8ee1 db17ad9f .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_set_state
2023/10/06 00:45 upstream 3006adf3be79 db17ad9f .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_set_state
2023/10/05 14:32 upstream 3006adf3be79 b7d7ff54 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_set_state
2023/10/05 04:27 upstream ba7d997a2a29 b7d7ff54 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root possible deadlock in ntfs_set_state
2023/10/05 00:44 upstream ba7d997a2a29 b7d7ff54 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_set_state
2023/10/04 11:28 upstream cbf3a2cb156a b7d7ff54 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_set_state
2023/10/03 16:42 upstream ce36c8b14987 65faba36 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_set_state
2023/10/02 05:21 upstream 8a749fd1a872 8e26a358 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in ntfs_set_state
2023/10/02 02:58 upstream 8a749fd1a872 8e26a358 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root possible deadlock in ntfs_set_state
2023/10/01 09:38 upstream e402b08634b3 8e26a358 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_set_state
2023/09/30 07:40 upstream 9f3ebbef746f 8e26a358 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_set_state
2023/09/29 15:25 upstream 9ed22ae6be81 8e26a358 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_set_state
2023/09/29 04:01 upstream 9ed22ae6be81 d265efd8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_set_state
2023/09/29 00:43 upstream 9ed22ae6be81 d265efd8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_set_state
2023/09/28 20:08 upstream 9ed22ae6be81 d265efd8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_set_state
2023/09/28 16:11 upstream 633b47cb009d d265efd8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_set_state
2023/09/28 13:09 upstream 633b47cb009d c2ab1e5d .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_set_state
2023/09/28 09:04 upstream 633b47cb009d c2ab1e5d .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_set_state
2023/09/26 18:03 upstream 50768a425b46 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_set_state
2023/09/26 03:49 upstream 6465e260f487 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_set_state
2023/09/23 12:41 upstream d90b0276af8f 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_set_state
2023/09/18 09:17 upstream ce9ecca0238b 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_set_state
2023/09/17 19:23 upstream e789286468a9 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_set_state
2023/09/17 17:24 upstream f0b0d403eabb 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_set_state
2023/09/17 14:20 upstream f0b0d403eabb 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_set_state
2023/09/17 04:52 upstream f0b0d403eabb 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_set_state
2023/09/16 11:31 upstream 57d88e8a5974 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_set_state
2023/09/24 04:41 upstream 3aba70aed91f 0b6a67ac .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream possible deadlock in ntfs_set_state
2023/07/25 22:40 upstream af2e19389c2c 6756545c .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root possible deadlock in ntfs_set_state
2023/08/26 17:17 upstream 7d2f353b2682 7ba13a15 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in ntfs_set_state
2023/09/18 01:07 linux-next dfa449a58323 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in ntfs_set_state
2023/09/17 06:25 linux-next dfa449a58323 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in ntfs_set_state
2023/09/12 02:18 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci fe4469582053 59da8366 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 possible deadlock in ntfs_set_state
* Struck through repros no longer work on HEAD.