syzbot


possible deadlock in ntfs_fiemap

Status: upstream: reported C repro on 2023/03/30 02:33
Bug presence: origin:lts-only
[Documentation on labels]
Reported-by: syzbot+bd1c9712e5f211375acd@syzkaller.appspotmail.com
First crash: 620d, last: 3d01h
Fix bisection: failed (error log, bisect log)
  
Bug presence (2)
Date Name Commit Repro Result
2023/05/18 linux-5.15.y (ToT) 9d6bde853685 C [report] possible deadlock in ntfs_fiemap
2023/05/18 upstream (ToT) 4d6d4c7f541d C Didn't crash
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream possible deadlock in ntfs_fiemap ntfs3 C error inconclusive 3367 1h41m 740d 0/28 upstream: reported C repro on 2022/11/30 12:51
linux-6.1 possible deadlock in ntfs_fiemap origin:lts-only C inconclusive 103 1d09h 622d 0/3 upstream: reported C repro on 2023/03/28 04:41
Last patch testing requests (1)
Created Duration User Patch Repo Result
2024/10/01 14:55 15m retest repro linux-5.15.y report log
Fix bisection attempts (8)
Created Duration User Patch Repo Result
2024/10/23 21:18 3m fix candidate upstream error job log
2024/09/19 02:24 4m fix candidate upstream error job log
2024/05/27 20:12 0m fix candidate upstream error job log
2024/03/22 16:37 0m fix candidate upstream error job log
2024/01/05 15:52 0m fix candidate upstream error job log
2023/11/27 21:06 1m fix candidate upstream error job log
2023/09/27 23:22 0m fix candidate upstream error job log
2023/06/19 03:47 1m bisect fix linux-5.15.y error job log

Sample crash report:
loop0: detected capacity change from 0 to 4096
======================================================
WARNING: possible circular locking dependency detected
5.15.112-syzkaller #0 Not tainted
------------------------------------------------------
syz-executor126/3962 is trying to acquire lock:
ffff0000c84579d8 (&mm->mmap_lock){++++}-{3:3}, at: __might_fault+0xa0/0x128 mm/memory.c:5310

but task is already holding lock:
ffff0000dc7df700 (&ni->ni_lock/4){+.+.}-{3:3}, at: ni_lock fs/ntfs3/ntfs_fs.h:1108 [inline]
ffff0000dc7df700 (&ni->ni_lock/4){+.+.}-{3:3}, at: ntfs_fiemap+0xec/0x168 fs/ntfs3/file.c:1223

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #1 (&ni->ni_lock/4){+.+.}-{3:3}:
       __mutex_lock_common+0x194/0x2154 kernel/locking/mutex.c:596
       __mutex_lock kernel/locking/mutex.c:729 [inline]
       mutex_lock_nested+0xa4/0xf8 kernel/locking/mutex.c:743
       ni_lock fs/ntfs3/ntfs_fs.h:1108 [inline]
       attr_data_get_block+0x35c/0x1c18 fs/ntfs3/attrib.c:846
       ntfs_file_mmap+0x3a4/0x688 fs/ntfs3/file.c:389
       call_mmap include/linux/fs.h:2108 [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:596
       el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:614
       el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584

-> #0 (&mm->mmap_lock){++++}-{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:3787 [inline]
       __lock_acquire+0x32cc/0x7620 kernel/locking/lockdep.c:5011
       lock_acquire+0x240/0x77c kernel/locking/lockdep.c:5622
       __might_fault+0xc8/0x128 mm/memory.c:5311
       _copy_to_user include/linux/uaccess.h:174 [inline]
       copy_to_user include/linux/uaccess.h:200 [inline]
       fiemap_fill_next_extent+0x1b4/0x44c fs/ioctl.c:144
       ni_fiemap+0xc40/0xe10 fs/ntfs3/frecord.c:1894
       ntfs_fiemap+0x110/0x168 fs/ntfs3/file.c:1225
       ioctl_fiemap fs/ioctl.c:219 [inline]
       do_vfs_ioctl+0x1bcc/0x2a38 fs/ioctl.c:814
       __do_sys_ioctl fs/ioctl.c:872 [inline]
       __se_sys_ioctl fs/ioctl.c:860 [inline]
       __arm64_sys_ioctl+0xe4/0x1c8 fs/ioctl.c:860
       __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:596
       el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:614
       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(&ni->ni_lock/4);
                               lock(&mm->mmap_lock);
                               lock(&ni->ni_lock/4);
  lock(&mm->mmap_lock);

 *** DEADLOCK ***

1 lock held by syz-executor126/3962:
 #0: ffff0000dc7df700 (&ni->ni_lock/4){+.+.}-{3:3}, at: ni_lock fs/ntfs3/ntfs_fs.h:1108 [inline]
 #0: ffff0000dc7df700 (&ni->ni_lock/4){+.+.}-{3:3}, at: ntfs_fiemap+0xec/0x168 fs/ntfs3/file.c:1223

stack backtrace:
CPU: 1 PID: 3962 Comm: syz-executor126 Not tainted 5.15.112-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/14/2023
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:3787 [inline]
 __lock_acquire+0x32cc/0x7620 kernel/locking/lockdep.c:5011
 lock_acquire+0x240/0x77c kernel/locking/lockdep.c:5622
 __might_fault+0xc8/0x128 mm/memory.c:5311
 _copy_to_user include/linux/uaccess.h:174 [inline]
 copy_to_user include/linux/uaccess.h:200 [inline]
 fiemap_fill_next_extent+0x1b4/0x44c fs/ioctl.c:144
 ni_fiemap+0xc40/0xe10 fs/ntfs3/frecord.c:1894
 ntfs_fiemap+0x110/0x168 fs/ntfs3/file.c:1225
 ioctl_fiemap fs/ioctl.c:219 [inline]
 do_vfs_ioctl+0x1bcc/0x2a38 fs/ioctl.c:814
 __do_sys_ioctl fs/ioctl.c:872 [inline]
 __se_sys_ioctl fs/ioctl.c:860 [inline]
 __arm64_sys_ioctl+0xe4/0x1c8 fs/ioctl.c:860
 __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:596
 el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:614
 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584

Crashes (37):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/05/18 14:01 linux-5.15.y 9d6bde853685 3bb7af1d .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_fiemap
2024/10/11 07:35 linux-5.15.y 3a5928702e71 cd942402 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in ntfs_fiemap
2024/08/22 02:59 linux-5.15.y fa93fa65db6e ca02180f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in ntfs_fiemap
2024/08/09 15:00 linux-5.15.y 7e89efd3ae1c a83d9288 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in ntfs_fiemap
2024/06/18 03:38 linux-5.15.y 4878aadf2d15 ce6011bc .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in ntfs_fiemap
2024/06/17 13:21 linux-5.15.y 4878aadf2d15 1f11cfd7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in ntfs_fiemap
2024/04/04 10:51 linux-5.15.y 9465fef4ae35 0ee3535e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in ntfs_fiemap
2024/04/03 17:05 linux-5.15.y 9465fef4ae35 51c4dcff .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in ntfs_fiemap
2023/11/14 04:27 linux-5.15.y 80529b4968a8 cb976f63 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in ntfs_fiemap
2023/10/19 18:14 linux-5.15.y 02e21884dcf2 42e1d524 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in ntfs_fiemap
2023/10/08 02:24 linux-5.15.y 1edcec18cfb7 5e837c76 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in ntfs_fiemap
2024/12/06 22:21 linux-5.15.y 0a51d2d4527b 9ac0fdc6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_fiemap
2024/12/05 12:44 linux-5.15.y 0a51d2d4527b 29f61fce .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_fiemap
2024/12/05 12:43 linux-5.15.y 0a51d2d4527b 29f61fce .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_fiemap
2024/12/05 12:41 linux-5.15.y 0a51d2d4527b 29f61fce .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_fiemap
2024/12/02 13:55 linux-5.15.y 0a51d2d4527b b499ea68 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_fiemap
2024/11/03 10:27 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_fiemap
2024/03/02 05:55 linux-5.15.y 80efc6265290 25905f5d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_fiemap
2024/02/06 02:33 linux-5.15.y 6139f2a02fe0 6404acf9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_fiemap
2023/09/15 10:41 linux-5.15.y aff03380bda4 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_fiemap
2023/07/11 05:53 linux-5.15.y d54cfc420586 52ae002a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in ntfs_fiemap
2023/07/10 21:16 linux-5.15.y d54cfc420586 d47e94ee .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in ntfs_fiemap
2023/07/03 23:04 linux-5.15.y 4af60700a60c 6e553898 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in ntfs_fiemap
2023/06/26 23:25 linux-5.15.y f67653019430 4cd5bb25 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in ntfs_fiemap
2023/06/20 23:35 linux-5.15.y 471e639e59d1 79782afc .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in ntfs_fiemap
2023/05/10 17:53 linux-5.15.y 8a7f2a5c5aa1 14b12a99 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in ntfs_fiemap
2023/05/06 19:41 linux-5.15.y 8a7f2a5c5aa1 90c93c40 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in ntfs_fiemap
2023/05/04 16:09 linux-5.15.y 8a7f2a5c5aa1 518a39a6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in ntfs_fiemap
2023/05/01 18:10 linux-5.15.y 8a7f2a5c5aa1 62df2017 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in ntfs_fiemap
2023/04/07 14:53 linux-5.15.y d86dfc4d95cd f7ba566d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in ntfs_fiemap
2023/04/06 01:37 linux-5.15.y d86dfc4d95cd 8b834965 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in ntfs_fiemap
2023/03/30 02:33 linux-5.15.y 115472395b0a f325deb0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in ntfs_fiemap
2023/07/03 12:06 linux-5.15.y 4af60700a60c bfc47836 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_fiemap
2023/05/17 22:09 linux-5.15.y 9d6bde853685 3bb7af1d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_fiemap
2023/04/20 08:18 linux-5.15.y 4fdad925aa1a a219f34e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_fiemap
2023/04/08 04:16 linux-5.15.y d86dfc4d95cd 71147e29 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_fiemap
2023/04/02 01:49 linux-5.15.y c957cbb87315 f325deb0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in ntfs_fiemap
* Struck through repros no longer work on HEAD.