syzbot


possible deadlock in ntfs_file_mmap

Status: upstream: reported C repro on 2024/08/19 06:49
Bug presence: origin:lts-only
[Documentation on labels]
Reported-by: syzbot+a01597ecdc366fb3475b@syzkaller.appspotmail.com
First crash: 72d, last: 2h21m
Bug presence (2)
Date Name Commit Repro Result
2024/08/19 linux-5.15.y (ToT) fa93fa65db6e C [report] possible deadlock in ntfs_file_mmap
2024/08/19 upstream (ToT) 6e4436539ae1 C Didn't crash
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-6.1 possible deadlock in ntfs_file_mmap 89 1h03m 88d 0/3 upstream: reported on 2024/08/03 10:10
upstream possible deadlock in ntfs_file_mmap ntfs3 C done 1427 3h00m 137d 0/28 upstream: reported C repro on 2024/06/15 07:17
Fix bisection attempts (1)
Created Duration User Patch Repo Result
2024/09/28 17:31 4m fix candidate upstream error job log

Sample crash report:
ntfs3: loop0: Different NTFS' sector size (4096) and media sector size (512)
ntfs3: loop0: Mark volume as dirty due to NTFS errors
======================================================
WARNING: possible circular locking dependency detected
5.15.165-syzkaller #0 Not tainted
------------------------------------------------------
syz-executor116/4015 is trying to acquire lock:
ffff0000def8f240 (&sb->s_type->i_mutex_key#17){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:789 [inline]
ffff0000def8f240 (&sb->s_type->i_mutex_key#17){+.+.}-{3:3}, at: ntfs_file_mmap+0x4b0/0x688 fs/ntfs3/file.c:401

but task is already holding lock:
ffff0000c7fa1818 (&mm->mmap_lock){++++}-{3:3}, at: mmap_write_lock_killable include/linux/mmap_lock.h:87 [inline]
ffff0000c7fa1818 (&mm->mmap_lock){++++}-{3:3}, at: vm_mmap_pgoff+0x15c/0x2b4 mm/util.c:549

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #1 (&mm->mmap_lock){++++}-{3:3}:
       __might_fault+0xc8/0x128 mm/memory.c:5328
       fault_in_readable+0xdc/0x56c mm/gup.c:1793
       fault_in_iov_iter_readable+0x130/0x1b0 lib/iov_iter.c:460
       generic_perform_write+0x198/0x520 mm/filemap.c:3775
       __generic_file_write_iter+0x230/0x454 mm/filemap.c:3912
       ntfs_file_write_iter+0x40c/0x49c fs/ntfs3/file.c:1143
       call_write_iter include/linux/fs.h:2172 [inline]
       new_sync_write fs/read_write.c:507 [inline]
       vfs_write+0x884/0xb44 fs/read_write.c:594
       ksys_write+0x15c/0x26c fs/read_write.c:647
       __do_sys_write fs/read_write.c:659 [inline]
       __se_sys_write fs/read_write.c:656 [inline]
       __arm64_sys_write+0x7c/0x90 fs/read_write.c:656
       __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
       invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52
       el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
       do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181
       el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:608
       el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:626
       el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584

-> #0 (&sb->s_type->i_mutex_key#17){+.+.}-{3:3}:
       check_prev_add kernel/locking/lockdep.c:3053 [inline]
       check_prevs_add kernel/locking/lockdep.c:3172 [inline]
       validate_chain kernel/locking/lockdep.c:3788 [inline]
       __lock_acquire+0x32d4/0x7638 kernel/locking/lockdep.c:5012
       lock_acquire+0x240/0x77c kernel/locking/lockdep.c:5623
       down_write+0xbc/0x12c kernel/locking/rwsem.c:1551
       inode_lock include/linux/fs.h:789 [inline]
       ntfs_file_mmap+0x4b0/0x688 fs/ntfs3/file.c:401
       call_mmap include/linux/fs.h:2177 [inline]
       mmap_region+0xcb4/0x12f0 mm/mmap.c:1791
       do_mmap+0x6c0/0xcec mm/mmap.c:1575
       vm_mmap_pgoff+0x1a4/0x2b4 mm/util.c:551
       ksys_mmap_pgoff+0x458/0x668 mm/mmap.c:1624
       __do_sys_mmap arch/arm64/kernel/sys.c:28 [inline]
       __se_sys_mmap arch/arm64/kernel/sys.c:21 [inline]
       __arm64_sys_mmap+0xf8/0x110 arch/arm64/kernel/sys.c:21
       __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
       invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52
       el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
       do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181
       el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:608
       el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:626
       el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584

other info that might help us debug this:

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&mm->mmap_lock);
                               lock(&sb->s_type->i_mutex_key#17);
                               lock(&mm->mmap_lock);
  lock(&sb->s_type->i_mutex_key#17);

 *** DEADLOCK ***

1 lock held by syz-executor116/4015:
 #0: ffff0000c7fa1818 (&mm->mmap_lock){++++}-{3:3}, at: mmap_write_lock_killable include/linux/mmap_lock.h:87 [inline]
 #0: ffff0000c7fa1818 (&mm->mmap_lock){++++}-{3:3}, at: vm_mmap_pgoff+0x15c/0x2b4 mm/util.c:549

stack backtrace:
CPU: 0 PID: 4015 Comm: syz-executor116 Not tainted 5.15.165-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/27/2024
Call trace:
 dump_backtrace+0x0/0x530 arch/arm64/kernel/stacktrace.c:152
 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:216
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106
 dump_stack+0x1c/0x58 lib/dump_stack.c:113
 print_circular_bug+0x150/0x1b8 kernel/locking/lockdep.c:2011
 check_noncircular+0x2cc/0x378 kernel/locking/lockdep.c:2133
 check_prev_add kernel/locking/lockdep.c:3053 [inline]
 check_prevs_add kernel/locking/lockdep.c:3172 [inline]
 validate_chain kernel/locking/lockdep.c:3788 [inline]
 __lock_acquire+0x32d4/0x7638 kernel/locking/lockdep.c:5012
 lock_acquire+0x240/0x77c kernel/locking/lockdep.c:5623
 down_write+0xbc/0x12c kernel/locking/rwsem.c:1551
 inode_lock include/linux/fs.h:789 [inline]
 ntfs_file_mmap+0x4b0/0x688 fs/ntfs3/file.c:401
 call_mmap include/linux/fs.h:2177 [inline]
 mmap_region+0xcb4/0x12f0 mm/mmap.c:1791
 do_mmap+0x6c0/0xcec mm/mmap.c:1575
 vm_mmap_pgoff+0x1a4/0x2b4 mm/util.c:551
 ksys_mmap_pgoff+0x458/0x668 mm/mmap.c:1624
 __do_sys_mmap arch/arm64/kernel/sys.c:28 [inline]
 __se_sys_mmap arch/arm64/kernel/sys.c:21 [inline]
 __arm64_sys_mmap+0xf8/0x110 arch/arm64/kernel/sys.c:21
 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
 invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52
 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
 do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181
 el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:608
 el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:626
 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584

Crashes (98):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/08/19 22:32 linux-5.15.y fa93fa65db6e 9f0ab3fb .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_file_mmap
2024/08/19 21:56 linux-5.15.y fa93fa65db6e 9f0ab3fb .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro #1] [mounted in repro #2] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_file_mmap
2024/08/19 20:47 linux-5.15.y fa93fa65db6e 9f0ab3fb .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_file_mmap
2024/08/19 19:14 linux-5.15.y fa93fa65db6e 9f0ab3fb .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_file_mmap
2024/10/28 18:03 linux-5.15.y 74cdd62cb470 9efb3cc7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in ntfs_file_mmap
2024/10/26 03:17 linux-5.15.y 74cdd62cb470 65e8686b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in ntfs_file_mmap
2024/10/25 14:24 linux-5.15.y 74cdd62cb470 045e728d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in ntfs_file_mmap
2024/10/24 12:08 linux-5.15.y 74cdd62cb470 0d144d1a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in ntfs_file_mmap
2024/10/14 22:54 linux-5.15.y 3a5928702e71 b01b6661 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in ntfs_file_mmap
2024/10/05 23:52 linux-5.15.y 3a5928702e71 d7906eff .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in ntfs_file_mmap
2024/10/02 13:09 linux-5.15.y 3a5928702e71 02f9582a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in ntfs_file_mmap
2024/09/28 06:38 linux-5.15.y 3a5928702e71 440b26ec .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in ntfs_file_mmap
2024/09/26 21:27 linux-5.15.y 3a5928702e71 9314348a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in ntfs_file_mmap
2024/09/22 08:37 linux-5.15.y 3a5928702e71 6f888b75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in ntfs_file_mmap
2024/09/19 20:35 linux-5.15.y 3a5928702e71 6f888b75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in ntfs_file_mmap
2024/09/14 17:48 linux-5.15.y 3a5928702e71 c7e35043 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in ntfs_file_mmap
2024/09/14 03:42 linux-5.15.y 3a5928702e71 b58f933c .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in ntfs_file_mmap
2024/08/19 06:49 linux-5.15.y fa93fa65db6e dbc93b08 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in ntfs_file_mmap
2024/10/30 21:10 linux-5.15.y 74cdd62cb470 fb888278 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_file_mmap
2024/10/28 05:55 linux-5.15.y 74cdd62cb470 65e8686b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_file_mmap
2024/10/28 00:17 linux-5.15.y 74cdd62cb470 65e8686b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_file_mmap
2024/10/26 21:18 linux-5.15.y 74cdd62cb470 65e8686b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_file_mmap
2024/10/22 04:59 linux-5.15.y 584a40a22cb9 a93682b3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_file_mmap
2024/10/21 08:51 linux-5.15.y 584a40a22cb9 cd6fc0a3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_file_mmap
2024/10/20 04:09 linux-5.15.y 584a40a22cb9 cd6fc0a3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_file_mmap
2024/10/19 20:53 linux-5.15.y 584a40a22cb9 cd6fc0a3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_file_mmap
2024/10/14 22:15 linux-5.15.y 3a5928702e71 b01b6661 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_file_mmap
2024/10/11 14:14 linux-5.15.y 3a5928702e71 cd942402 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_file_mmap
2024/10/09 14:58 linux-5.15.y 3a5928702e71 56fb2cb7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_file_mmap
2024/10/09 03:30 linux-5.15.y 3a5928702e71 402f1df0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_file_mmap
2024/10/07 15:59 linux-5.15.y 3a5928702e71 d7906eff .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_file_mmap
2024/10/07 13:53 linux-5.15.y 3a5928702e71 d7906eff .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_file_mmap
2024/10/07 01:28 linux-5.15.y 3a5928702e71 d7906eff .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_file_mmap
2024/10/06 12:43 linux-5.15.y 3a5928702e71 d7906eff .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_file_mmap
2024/10/04 14:03 linux-5.15.y 3a5928702e71 d7906eff .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_file_mmap
2024/10/03 23:56 linux-5.15.y 3a5928702e71 d7906eff .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_file_mmap
2024/10/03 16:27 linux-5.15.y 3a5928702e71 d7906eff .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_file_mmap
2024/10/02 10:18 linux-5.15.y 3a5928702e71 ea2b66a6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_file_mmap
2024/09/30 01:40 linux-5.15.y 3a5928702e71 ba29ff75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_file_mmap
2024/09/29 12:38 linux-5.15.y 3a5928702e71 ba29ff75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_file_mmap
2024/09/28 08:51 linux-5.15.y 3a5928702e71 440b26ec .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_file_mmap
2024/09/25 22:13 linux-5.15.y 3a5928702e71 0d19f247 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_file_mmap
2024/09/25 09:42 linux-5.15.y 3a5928702e71 349a68c4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_file_mmap
2024/09/25 05:36 linux-5.15.y 3a5928702e71 5643e0e9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_file_mmap
2024/09/24 22:54 linux-5.15.y 3a5928702e71 5643e0e9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_file_mmap
2024/09/24 18:24 linux-5.15.y 3a5928702e71 5643e0e9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_file_mmap
2024/09/23 13:40 linux-5.15.y 3a5928702e71 89298aad .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_file_mmap
2024/09/20 19:05 linux-5.15.y 3a5928702e71 6f888b75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_file_mmap
2024/09/18 20:05 linux-5.15.y 3a5928702e71 c673ca06 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_file_mmap
2024/09/11 21:09 linux-5.15.y 14e468424d3e d94c83d8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_file_mmap
2024/09/11 21:09 linux-5.15.y 14e468424d3e d94c83d8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_file_mmap
2024/09/11 11:52 linux-5.15.y 14e468424d3e 8ab55d0e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_file_mmap
2024/09/11 11:49 linux-5.15.y 14e468424d3e 8ab55d0e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_file_mmap
* Struck through repros no longer work on HEAD.