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: 666d, last: 8h32m
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 3646 1h00m 784d 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 40 32d 664d 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 (160):
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
2025/01/22 04:38 linux-6.1.y f4f677285b38 da72ac06 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2025/01/15 05:54 linux-6.1.y c63962be84ef 7315a7cf .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2025/01/14 07:38 linux-6.1.y c63962be84ef b1f1cd88 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2025/01/10 19:59 linux-6.1.y c63962be84ef 6dbc6a9b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2025/01/10 04:34 linux-6.1.y c63962be84ef 67d7ec0a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2025/01/09 16:11 linux-6.1.y c63962be84ef 9220929f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2025/01/08 14:09 linux-6.1.y 7dc732d24ff7 f3558dbf .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2025/01/07 21:02 linux-6.1.y 7dc732d24ff7 f3558dbf .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2025/01/07 14:32 linux-6.1.y 7dc732d24ff7 f3558dbf .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2025/01/07 11:53 linux-6.1.y 7dc732d24ff7 f3558dbf .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2025/01/05 16:26 linux-6.1.y 7dc732d24ff7 f3558dbf .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2025/01/05 09:21 linux-6.1.y 7dc732d24ff7 f3558dbf .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2025/01/04 20:44 linux-6.1.y 7dc732d24ff7 f3558dbf .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2025/01/02 19:07 linux-6.1.y 7dc732d24ff7 d3ccff63 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2025/01/02 12:58 linux-6.1.y 7dc732d24ff7 d3ccff63 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2025/01/01 02:11 linux-6.1.y 563edd786f0a d3ccff63 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2024/12/31 19:32 linux-6.1.y 563edd786f0a d3ccff63 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2024/12/31 09:47 linux-6.1.y 563edd786f0a d3ccff63 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2024/12/24 22:42 linux-6.1.y 29f02ec58a94 444551c4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2024/12/20 01:01 linux-6.1.y 29f02ec58a94 5905cb39 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2024/12/19 21:25 linux-6.1.y 29f02ec58a94 5905cb39 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2024/12/19 21:25 linux-6.1.y 29f02ec58a94 5905cb39 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2024/12/19 08:48 linux-6.1.y 52f863f820fd 1432fc84 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2024/12/19 02:09 linux-6.1.y 52f863f820fd 1432fc84 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2024/12/18 01:49 linux-6.1.y 52f863f820fd a0626d3a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2024/12/13 21:56 linux-6.1.y e4d90d63d385 7cbfbb3a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2024/12/12 17:13 linux-6.1.y e4d90d63d385 530e80f8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2024/12/12 04:47 linux-6.1.y e4d90d63d385 6f1b0fa8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2024/12/10 02:22 linux-6.1.y e4d90d63d385 cfc402b4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2024/12/08 13:28 linux-6.1.y e4d90d63d385 9ac0fdc6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2024/12/06 20:46 linux-6.1.y e4d90d63d385 9ac0fdc6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2024/12/05 10:54 linux-6.1.y e4d90d63d385 29f61fce .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2024/12/02 14:52 linux-6.1.y e4d90d63d385 b499ea68 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2024/12/02 13:38 linux-6.1.y e4d90d63d385 b499ea68 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2024/11/30 03:03 linux-6.1.y e4d90d63d385 68914665 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2024/11/27 20:51 linux-6.1.y e4d90d63d385 5df23865 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2024/11/27 07:24 linux-6.1.y e4d90d63d385 52b38cc1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in ntfs_fiemap
2024/11/26 03:17 linux-6.1.y e4d90d63d385 11dbc254 .config console log report info [disk image] [vmlinux] [kernel image] 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
2025/01/06 21:20 linux-6.1.y 7dc732d24ff7 f3558dbf .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_fiemap
2025/01/04 00:14 linux-6.1.y 7dc732d24ff7 f3558dbf .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_fiemap
2024/12/31 14:41 linux-6.1.y 563edd786f0a d3ccff63 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_fiemap
2024/12/29 14:45 linux-6.1.y 563edd786f0a d3ccff63 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_fiemap
2024/12/26 12:58 linux-6.1.y 29f02ec58a94 d3ccff63 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_fiemap
2024/12/25 15:21 linux-6.1.y 29f02ec58a94 444551c4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_fiemap
2024/12/24 19:35 linux-6.1.y 29f02ec58a94 444551c4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_fiemap
2024/12/19 03:48 linux-6.1.y 52f863f820fd 1432fc84 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_fiemap
2024/12/14 19:37 linux-6.1.y e4d90d63d385 7cbfbb3a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_fiemap
2024/12/12 09:14 linux-6.1.y e4d90d63d385 6f1b0fa8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_fiemap
2024/12/10 10:54 linux-6.1.y e4d90d63d385 cfc402b4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_fiemap
2024/12/06 03:38 linux-6.1.y e4d90d63d385 29f61fce .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_fiemap
2024/12/05 13:19 linux-6.1.y e4d90d63d385 29f61fce .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_fiemap
2024/12/01 14:40 linux-6.1.y e4d90d63d385 68914665 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_fiemap
2024/11/27 10:17 linux-6.1.y e4d90d63d385 52b38cc1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in ntfs_fiemap
2024/11/24 12:46 linux-6.1.y e4d90d63d385 68da6d95 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 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
* Struck through repros no longer work on HEAD.