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: 94d, last: 18h27m
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 117 6h13m 109d 0/3 upstream: reported on 2024/08/03 10:10
upstream possible deadlock in ntfs_file_mmap ntfs3 C done 1626 12h14m 159d 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 (145):
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/11/18 12:49 linux-5.15.y 0a51d2d4527b e7bb5d6e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in ntfs_file_mmap
2024/11/15 16:12 linux-5.15.y d98fd109f827 f6ede3a3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in ntfs_file_mmap
2024/11/13 00:12 linux-5.15.y 3c17fc483905 62026c85 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in ntfs_file_mmap
2024/11/13 00:11 linux-5.15.y 3c17fc483905 62026c85 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in ntfs_file_mmap
2024/11/11 18:28 linux-5.15.y 3c17fc483905 0c4b1325 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in ntfs_file_mmap
2024/11/11 14:08 linux-5.15.y 3c17fc483905 0c4b1325 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in ntfs_file_mmap
2024/11/07 05:57 linux-5.15.y 72244eab0dad df3dc63b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in ntfs_file_mmap
2024/11/06 08:38 linux-5.15.y 72244eab0dad 3a465482 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan 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/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/11/20 14:42 linux-5.15.y 0a51d2d4527b 4fca1650 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_file_mmap
2024/11/19 02:21 linux-5.15.y 0a51d2d4527b 571351cb .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_file_mmap
2024/11/17 17:40 linux-5.15.y 0a51d2d4527b cfe3a04a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_file_mmap
2024/11/17 17:24 linux-5.15.y 0a51d2d4527b cfe3a04a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_file_mmap
2024/11/17 01:03 linux-5.15.y d98fd109f827 cfe3a04a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_file_mmap
2024/11/16 20:52 linux-5.15.y d98fd109f827 cfe3a04a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_file_mmap
2024/11/16 17:37 linux-5.15.y d98fd109f827 cfe3a04a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_file_mmap
2024/11/16 15:17 linux-5.15.y d98fd109f827 cfe3a04a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_file_mmap
2024/11/15 20:57 linux-5.15.y d98fd109f827 cfe3a04a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_file_mmap
2024/11/14 15:46 linux-5.15.y d98fd109f827 a8c99394 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_file_mmap
2024/11/14 09:41 linux-5.15.y 3c17fc483905 a8c99394 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_file_mmap
2024/11/13 14:39 linux-5.15.y 3c17fc483905 bb3f8425 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_file_mmap
2024/11/13 13:05 linux-5.15.y 3c17fc483905 bb3f8425 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_file_mmap
2024/11/12 01:52 linux-5.15.y 3c17fc483905 75bb1b32 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_file_mmap
2024/11/11 11:28 linux-5.15.y 3c17fc483905 0c4b1325 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_file_mmap
2024/11/11 06:01 linux-5.15.y 3c17fc483905 6b856513 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_file_mmap
2024/11/10 11:48 linux-5.15.y 3c17fc483905 6b856513 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_file_mmap
2024/11/10 03:27 linux-5.15.y 3c17fc483905 6b856513 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_file_mmap
2024/11/09 21:37 linux-5.15.y 3c17fc483905 6b856513 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_file_mmap
2024/11/06 17:40 linux-5.15.y 72244eab0dad df3dc63b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_file_mmap
2024/11/06 03:37 linux-5.15.y 72244eab0dad 3a465482 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_file_mmap
2024/11/04 04:30 linux-5.15.y 72244eab0dad f00eed24 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_file_mmap
2024/11/03 16:50 linux-5.15.y 72244eab0dad f00eed24 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_file_mmap
2024/11/01 19:04 linux-5.15.y 72244eab0dad f00eed24 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_file_mmap
2024/11/01 03:19 linux-5.15.y 72244eab0dad 96eb609f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_file_mmap
2024/10/31 10:21 linux-5.15.y 74cdd62cb470 96eb609f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 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
* Struck through repros no longer work on HEAD.