syzbot


possible deadlock in ntfs_fiemap

Status: upstream: reported C repro on 2023/03/28 04:41
Bug presence: origin:lts-only
[Documentation on labels]
Reported-by: syzbot+b40a7a91431612fd07c7@syzkaller.appspotmail.com
First crash: 604d, last: 15h11m
Fix bisection: the issue occurs on the latest tested release (bisect log)
Crash: possible deadlock in ntfs_fiemap (log)
Repro: C syz .config
  
Bug presence (2)
Date Name Commit Repro Result
2023/05/18 linux-6.1.y (ToT) fa74641fb6b9 C [report] possible deadlock in ntfs_fiemap
2023/05/18 upstream (ToT) 2d1bcbc6cd70 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 3127 29m 721d 0/28 upstream: reported C repro on 2022/11/30 12:51
linux-5.15 possible deadlock in ntfs_fiemap origin:lts-only C error 32 17d 602d 0/3 upstream: reported C repro on 2023/03/30 02:33
Fix bisection attempts (3)
Created Duration User Patch Repo Result
2023/10/04 18:54 1h47m fix candidate upstream OK (0) job log
2023/10/03 12:27 2h16m bisect fix linux-6.1.y OK (0) job log log
2023/08/07 21:04 4h55m bisect fix linux-6.1.y OK (0) job log log

Sample crash report:
loop0: detected capacity change from 0 to 4096
======================================================
WARNING: possible circular locking dependency detected
6.1.29-syzkaller #0 Not tainted
------------------------------------------------------
syz-executor315/4216 is trying to acquire lock:
ffff0000d44cc948 (&mm->mmap_lock){++++}-{3:3}, at: __might_fault+0x9c/0x124 mm/memory.c:5654

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

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+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
       ni_lock fs/ntfs3/ntfs_fs.h:1109 [inline]
       attr_data_get_block+0x330/0x1bdc fs/ntfs3/attrib.c:921
       ntfs_file_mmap+0x3a4/0x688 fs/ntfs3/file.c:387
       call_mmap include/linux/fs.h:2210 [inline]
       mmap_region+0xdd0/0x1a98 mm/mmap.c:2663
       do_mmap+0xa00/0x1108 mm/mmap.c:1411
       vm_mmap_pgoff+0x1a4/0x2b4 mm/util.c:520
       ksys_mmap_pgoff+0x3c8/0x5b0 mm/mmap.c:1457
       __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/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

-> #0 (&mm->mmap_lock){++++}-{3:3}:
       check_prev_add kernel/locking/lockdep.c:3098 [inline]
       check_prevs_add kernel/locking/lockdep.c:3217 [inline]
       validate_chain kernel/locking/lockdep.c:3832 [inline]
       __lock_acquire+0x3338/0x764c kernel/locking/lockdep.c:5056
       lock_acquire+0x26c/0x7cc kernel/locking/lockdep.c:5669
       __might_fault+0xc4/0x124 mm/memory.c:5655
       _copy_to_user include/linux/uaccess.h:143 [inline]
       copy_to_user include/linux/uaccess.h:169 [inline]
       fiemap_fill_next_extent+0x1b4/0x424 fs/ioctl.c:144
       ni_fiemap+0xc40/0xe10 fs/ntfs3/frecord.c:1943
       ntfs_fiemap+0x110/0x168 fs/ntfs3/file.c:1245
       ioctl_fiemap fs/ioctl.c:219 [inline]
       do_vfs_ioctl+0x194c/0x26f8 fs/ioctl.c:810
       __do_sys_ioctl fs/ioctl.c:868 [inline]
       __se_sys_ioctl fs/ioctl.c:856 [inline]
       __arm64_sys_ioctl+0xe4/0x1c8 fs/ioctl.c:856
       __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

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-executor315/4216:
 #0: ffff0000df187700 (&ni->ni_lock/4){+.+.}-{3:3}, at: ni_lock fs/ntfs3/ntfs_fs.h:1109 [inline]
 #0: ffff0000df187700 (&ni->ni_lock/4){+.+.}-{3:3}, at: ntfs_fiemap+0xec/0x168 fs/ntfs3/file.c:1243

stack backtrace:
CPU: 0 PID: 4216 Comm: syz-executor315 Not tainted 6.1.29-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
 print_circular_bug+0x150/0x1b8 kernel/locking/lockdep.c:2056
 check_noncircular+0x2cc/0x378 kernel/locking/lockdep.c:2178
 check_prev_add kernel/locking/lockdep.c:3098 [inline]
 check_prevs_add kernel/locking/lockdep.c:3217 [inline]
 validate_chain kernel/locking/lockdep.c:3832 [inline]
 __lock_acquire+0x3338/0x764c kernel/locking/lockdep.c:5056
 lock_acquire+0x26c/0x7cc kernel/locking/lockdep.c:5669
 __might_fault+0xc4/0x124 mm/memory.c:5655
 _copy_to_user include/linux/uaccess.h:143 [inline]
 copy_to_user include/linux/uaccess.h:169 [inline]
 fiemap_fill_next_extent+0x1b4/0x424 fs/ioctl.c:144
 ni_fiemap+0xc40/0xe10 fs/ntfs3/frecord.c:1943
 ntfs_fiemap+0x110/0x168 fs/ntfs3/file.c:1245
 ioctl_fiemap fs/ioctl.c:219 [inline]
 do_vfs_ioctl+0x194c/0x26f8 fs/ioctl.c:810
 __do_sys_ioctl fs/ioctl.c:868 [inline]
 __se_sys_ioctl fs/ioctl.c:856 [inline]
 __arm64_sys_ioctl+0xe4/0x1c8 fs/ioctl.c:856
 __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

Crashes (83):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/05/18 14:49 linux-6.1.y fa74641fb6b9 3bb7af1d .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_fiemap
2023/06/19 06:55 linux-6.1.y ca87e77a2ef8 f3921d4d .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2024/11/20 18:57 linux-6.1.y b67dc5c9ade9 4fca1650 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2024/11/18 20:13 linux-6.1.y b67dc5c9ade9 e7bb5d6e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2024/11/18 14:08 linux-6.1.y b67dc5c9ade9 e7bb5d6e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2024/11/17 18:19 linux-6.1.y b67dc5c9ade9 cfe3a04a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2024/11/16 03:01 linux-6.1.y 59d7b1a7104a cfe3a04a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2024/11/06 13:34 linux-6.1.y 7c15117f9468 3a465482 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2024/11/05 05:14 linux-6.1.y 7c15117f9468 509da429 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2024/11/04 08:03 linux-6.1.y 7c15117f9468 f00eed24 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2024/10/31 05:01 linux-6.1.y 7ec6f9fa3d97 96eb609f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2024/10/30 16:05 linux-6.1.y 7ec6f9fa3d97 fb888278 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2024/10/30 16:05 linux-6.1.y 7ec6f9fa3d97 fb888278 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2024/10/29 18:39 linux-6.1.y 7ec6f9fa3d97 66aeb999 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2024/10/25 02:34 linux-6.1.y 7ec6f9fa3d97 c79b8ca5 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2024/10/24 11:52 linux-6.1.y 7ec6f9fa3d97 0d144d1a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2024/10/23 00:55 linux-6.1.y 7ec6f9fa3d97 15fa2979 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2024/10/22 17:52 linux-6.1.y 7ec6f9fa3d97 a93682b3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2024/10/22 07:49 linux-6.1.y 54d90d17e8ce a93682b3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2024/10/22 06:02 linux-6.1.y 54d90d17e8ce a93682b3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2024/10/21 16:12 linux-6.1.y 54d90d17e8ce f1e4447c .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2024/10/21 15:08 linux-6.1.y 54d90d17e8ce f1e4447c .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2024/10/19 00:23 linux-6.1.y 54d90d17e8ce cd6fc0a3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2024/10/17 17:55 linux-6.1.y 54d90d17e8ce 666f77ed .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2024/10/12 01:19 linux-6.1.y aa4cd140bba5 084d8178 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2024/10/11 16:00 linux-6.1.y aa4cd140bba5 cd942402 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2024/10/11 16:00 linux-6.1.y aa4cd140bba5 cd942402 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2024/10/11 01:40 linux-6.1.y aa4cd140bba5 8fbfc0c8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2024/10/10 17:41 linux-6.1.y aa4cd140bba5 8fbfc0c8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2024/10/10 17:39 linux-6.1.y aa4cd140bba5 8fbfc0c8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2024/10/10 17:38 linux-6.1.y aa4cd140bba5 8fbfc0c8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2024/10/08 14:39 linux-6.1.y aa4cd140bba5 402f1df0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2024/10/08 14:39 linux-6.1.y aa4cd140bba5 402f1df0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2024/10/08 08:21 linux-6.1.y aa4cd140bba5 402f1df0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2024/10/08 07:20 linux-6.1.y aa4cd140bba5 402f1df0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2024/10/08 07:15 linux-6.1.y aa4cd140bba5 402f1df0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2024/10/04 00:49 linux-6.1.y aa4cd140bba5 d7906eff .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2024/11/19 22:04 linux-6.1.y b67dc5c9ade9 7d02db5a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_fiemap
2024/11/16 17:59 linux-6.1.y 59d7b1a7104a cfe3a04a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_fiemap
2024/11/12 03:04 linux-6.1.y d7039b844a1c 75bb1b32 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_fiemap
2024/11/10 22:07 linux-6.1.y d7039b844a1c 6b856513 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_fiemap
2024/11/09 23:31 linux-6.1.y d7039b844a1c 6b856513 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_fiemap
2024/11/05 06:40 linux-6.1.y 7c15117f9468 509da429 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_fiemap
2024/10/31 21:05 linux-6.1.y 7ec6f9fa3d97 96eb609f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_fiemap
2024/10/16 20:15 linux-6.1.y aa4cd140bba5 666f77ed .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_fiemap
2024/10/16 20:15 linux-6.1.y aa4cd140bba5 666f77ed .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_fiemap
2023/04/03 16:17 linux-6.1.y 3b29299e5f60 41147e3e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2023/03/28 04:40 linux-6.1.y e3a87a10f259 47f3aaf1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2023/05/05 15:48 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_fiemap
2023/04/25 18:07 linux-6.1.y f17b0ab65d17 65320f8e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_fiemap
* Struck through repros no longer work on HEAD.