syzbot


possible deadlock in ntfs_fiemap

Status: upstream: reported C repro on 2022/11/30 12:51
Subsystems: ntfs3
[Documentation on labels]
Reported-by: syzbot+96cee7d33ca3f87eee86@syzkaller.appspotmail.com
First crash: 456d, last: 5h10m
Cause bisection: failed (error log, bisect log)
  
Discussions (8)
Title Replies (including bot) Last reply
[syzbot] Monthly ntfs3 report (Jan 2024) 0 (1) 2024/01/02 13:36
[syzbot] Monthly ntfs3 report (Dec 2023) 0 (1) 2023/12/02 14:45
[syzbot] Monthly ntfs3 report (Jul 2023) 0 (1) 2023/07/30 13:16
[syzbot] Monthly ntfs3 report (Jun 2023) 0 (1) 2023/06/29 09:21
[syzbot] Monthly ntfs3 report (May 2023) 0 (1) 2023/05/29 08:47
[PATCH] fs/ntfs3: disable page fault during ntfs_fiemap() 7 (7) 2023/04/20 21:11
[syzbot] Monthly ntfs3 report 0 (1) 2023/03/27 17:38
[syzbot] possible deadlock in ntfs_fiemap 0 (2) 2022/12/09 04:00
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-6.1 possible deadlock in ntfs_fiemap origin:lts-only C inconclusive 11 149d 338d 0/3 upstream: reported C repro on 2023/03/28 04:41
linux-5.15 possible deadlock in ntfs_fiemap origin:lts-only C error 23 23d 336d 0/3 upstream: reported C repro on 2023/03/30 02:33
Last patch testing requests (2)
Created Duration User Patch Repo Result
2023/09/11 01:47 15m retest repro upstream OK log
2022/12/09 07:36 23m hdanton@sina.com patch https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master OK log

Sample crash report:
======================================================
WARNING: possible circular locking dependency detected
6.7.0-rc1-syzkaller-00012-g9bacdd8996c7 #0 Not tainted
------------------------------------------------------
syz-executor166/8642 is trying to acquire lock:
ffff8880221aeda0 (&mm->mmap_lock){++++}-{3:3}, at: __might_fault mm/memory.c:5955 [inline]
ffff8880221aeda0 (&mm->mmap_lock){++++}-{3:3}, at: __might_fault+0xe6/0x1a0 mm/memory.c:5948

but task is already holding lock:
ffff88802edbf8e0 (&ni->ni_lock#2/4){+.+.}-{3:3}, at: ni_lock fs/ntfs3/ntfs_fs.h:1124 [inline]
ffff88802edbf8e0 (&ni->ni_lock#2/4){+.+.}-{3:3}, at: ntfs_fiemap+0xb6/0x110 fs/ntfs3/file.c:1162

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #1 (&ni->ni_lock#2/4){+.+.}-{3:3}:
       __mutex_lock_common kernel/locking/mutex.c:603 [inline]
       __mutex_lock+0x175/0x9d0 kernel/locking/mutex.c:747
       ni_lock fs/ntfs3/ntfs_fs.h:1124 [inline]
       attr_data_get_block+0x383/0x1a20 fs/ntfs3/attrib.c:918
       ntfs_file_mmap+0x4cc/0x6c0 fs/ntfs3/file.c:292
       call_mmap include/linux/fs.h:2025 [inline]
       mmap_region+0x5e3/0x2830 mm/mmap.c:2851
       do_mmap+0x893/0xef0 mm/mmap.c:1379
       vm_mmap_pgoff+0x1a8/0x3c0 mm/util.c:546
       ksys_mmap_pgoff+0x422/0x5b0 mm/mmap.c:1425
       __do_sys_mmap arch/x86/kernel/sys_x86_64.c:93 [inline]
       __se_sys_mmap arch/x86/kernel/sys_x86_64.c:86 [inline]
       __x64_sys_mmap+0x125/0x190 arch/x86/kernel/sys_x86_64.c:86
       do_syscall_x64 arch/x86/entry/common.c:51 [inline]
       do_syscall_64+0x40/0x110 arch/x86/entry/common.c:82
       entry_SYSCALL_64_after_hwframe+0x63/0x6b

-> #0 (&mm->mmap_lock){++++}-{3:3}:
       check_prev_add kernel/locking/lockdep.c:3134 [inline]
       check_prevs_add kernel/locking/lockdep.c:3253 [inline]
       validate_chain kernel/locking/lockdep.c:3868 [inline]
       __lock_acquire+0x2464/0x3b10 kernel/locking/lockdep.c:5136
       lock_acquire kernel/locking/lockdep.c:5753 [inline]
       lock_acquire+0x1ae/0x520 kernel/locking/lockdep.c:5718
       __might_fault mm/memory.c:5955 [inline]
       __might_fault+0x11f/0x1a0 mm/memory.c:5948
       _copy_to_user+0x2b/0xb0 lib/usercopy.c:36
       copy_to_user include/linux/uaccess.h:191 [inline]
       fiemap_fill_next_extent+0x232/0x380 fs/ioctl.c:145
       ni_fiemap+0x2f2/0xc00 fs/ntfs3/frecord.c:1948
       ntfs_fiemap+0xc9/0x110 fs/ntfs3/file.c:1164
       ioctl_fiemap fs/ioctl.c:220 [inline]
       do_vfs_ioctl+0x339/0x1920 fs/ioctl.c:811
       __do_sys_ioctl fs/ioctl.c:869 [inline]
       __se_sys_ioctl fs/ioctl.c:857 [inline]
       __x64_sys_ioctl+0x112/0x210 fs/ioctl.c:857
       do_syscall_x64 arch/x86/entry/common.c:51 [inline]
       do_syscall_64+0x40/0x110 arch/x86/entry/common.c:82
       entry_SYSCALL_64_after_hwframe+0x63/0x6b

other info that might help us debug this:

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&ni->ni_lock#2/4);
                               lock(&mm->mmap_lock);
                               lock(&ni->ni_lock#2/4);
  rlock(&mm->mmap_lock);

 *** DEADLOCK ***

1 lock held by syz-executor166/8642:
 #0: ffff88802edbf8e0 (&ni->ni_lock#2/4){+.+.}-{3:3}, at: ni_lock fs/ntfs3/ntfs_fs.h:1124 [inline]
 #0: ffff88802edbf8e0 (&ni->ni_lock#2/4){+.+.}-{3:3}, at: ntfs_fiemap+0xb6/0x110 fs/ntfs3/file.c:1162

stack backtrace:
CPU: 2 PID: 8642 Comm: syz-executor166 Not tainted 6.7.0-rc1-syzkaller-00012-g9bacdd8996c7 #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106
 check_noncircular+0x317/0x400 kernel/locking/lockdep.c:2187
 check_prev_add kernel/locking/lockdep.c:3134 [inline]
 check_prevs_add kernel/locking/lockdep.c:3253 [inline]
 validate_chain kernel/locking/lockdep.c:3868 [inline]
 __lock_acquire+0x2464/0x3b10 kernel/locking/lockdep.c:5136
 lock_acquire kernel/locking/lockdep.c:5753 [inline]
 lock_acquire+0x1ae/0x520 kernel/locking/lockdep.c:5718
 __might_fault mm/memory.c:5955 [inline]
 __might_fault+0x11f/0x1a0 mm/memory.c:5948
 _copy_to_user+0x2b/0xb0 lib/usercopy.c:36
 copy_to_user include/linux/uaccess.h:191 [inline]
 fiemap_fill_next_extent+0x232/0x380 fs/ioctl.c:145
 ni_fiemap+0x2f2/0xc00 fs/ntfs3/frecord.c:1948
 ntfs_fiemap+0xc9/0x110 fs/ntfs3/file.c:1164
 ioctl_fiemap fs/ioctl.c:220 [inline]
 do_vfs_ioctl+0x339/0x1920 fs/ioctl.c:811
 __do_sys_ioctl fs/ioctl.c:869 [inline]
 __se_sys_ioctl fs/ioctl.c:857 [inline]
 __x64_sys_ioctl+0x112/0x210 fs/ioctl.c:857
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x40/0x110 arch/x86/entry/common.c:82
 entry_SYSCALL_64_after_hwframe+0x63/0x6b
RIP: 0033:0x7f5cd1cfa9e9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 91 1a 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f5cd14b1168 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f5cd1da2728 RCX: 00007f5cd1cfa9e9
RDX: 0000000020000180 RSI: 00000000c020660b RDI: 0000000000000007
RBP: 00007f5cd1da2720 R08: 00007f5cd14b16c0 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f5cd1da272c
R13: 0000000000000006 R14: 00007ffcc7117b90 R15: 00007ffcc7117c78
 </TASK>

Crashes (660):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/11/14 07:52 upstream 9bacdd8996c7 cb976f63 .config console log report syz C [disk image (non-bootable)] [vmlinux] [kernel image] [mounted in repro] ci-qemu-upstream possible deadlock in ntfs_fiemap
2022/12/09 04:00 upstream f3e8416619ce 1034e5fa .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-upstream-fs possible deadlock in ntfs_fiemap
2024/02/29 14:43 upstream 805d849d7c3c 352ab904 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_fiemap
2024/02/29 12:44 upstream e326df53af00 352ab904 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_fiemap
2024/02/29 08:30 upstream e326df53af00 352ab904 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_fiemap
2024/02/29 06:50 upstream e326df53af00 352ab904 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_fiemap
2024/02/29 02:04 upstream e326df53af00 352ab904 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_fiemap
2024/02/29 00:52 upstream e326df53af00 352ab904 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_fiemap
2024/02/28 18:50 upstream e326df53af00 55d6f11d .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_fiemap
2024/02/28 12:22 upstream cf1182944c7c 55d6f11d .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_fiemap
2024/02/28 06:40 upstream cf1182944c7c d367cbe5 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_fiemap
2024/02/28 02:27 upstream cf1182944c7c d367cbe5 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_fiemap
2024/02/27 19:20 upstream 45ec2f5f6ed3 d367cbe5 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_fiemap
2024/02/27 04:16 upstream 45ec2f5f6ed3 05e69c83 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_fiemap
2024/02/25 06:47 upstream f2e367d6ad3b 8d446f15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_fiemap
2024/02/24 17:01 upstream 603c04e27c3e 8d446f15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_fiemap
2024/02/24 14:55 upstream 603c04e27c3e 8d446f15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_fiemap
2024/02/24 07:28 upstream 603c04e27c3e 8d446f15 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root possible deadlock in ntfs_fiemap
2024/02/23 08:44 upstream ffd2cb6b718e 8d446f15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_fiemap
2024/02/22 20:16 upstream 1c892cdd8fe0 8d446f15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_fiemap
2024/02/21 18:54 upstream 39133352cbed 345111b5 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_fiemap
2024/02/21 11:39 upstream 9fc1ccccfd8d 3af7dd65 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_fiemap
2024/02/21 06:04 upstream fca7526b7d89 3af7dd65 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_fiemap
2024/02/20 17:07 upstream b401b621758e 3af7dd65 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_fiemap
2024/02/20 14:36 upstream b401b621758e 3af7dd65 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_fiemap
2024/02/20 07:57 upstream b401b621758e 3af7dd65 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_fiemap
2024/02/18 11:16 upstream c02197fc9076 578f7538 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_fiemap
2024/02/17 21:52 upstream ced590523156 578f7538 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_fiemap
2024/02/17 14:49 upstream c1ca10ceffbb 578f7538 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_fiemap
2024/02/17 05:47 upstream 0f1dd5e91e2b 578f7538 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_fiemap
2024/02/16 19:00 upstream 0f1dd5e91e2b 578f7538 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_fiemap
2024/02/16 05:37 upstream 4f5e5092fdbf 578f7538 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_fiemap
2024/02/15 21:52 upstream 4f5e5092fdbf fd39cf6f .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_fiemap
2024/02/15 20:51 upstream 4f5e5092fdbf fd39cf6f .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_fiemap
2024/02/15 01:42 upstream 8d3dea210042 d9b1cdd5 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_fiemap
2024/02/11 12:34 upstream 7521f258ea30 77b23aa1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_fiemap
2024/02/10 22:35 upstream a5b6244cf87c 77b23aa1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_fiemap
2024/02/10 09:50 upstream 4a7bbe7519b6 77b23aa1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_fiemap
2024/02/10 09:39 upstream 4a7bbe7519b6 77b23aa1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_fiemap
2024/02/09 18:17 upstream 1f719a2f3fa6 77b23aa1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_fiemap
2024/02/09 04:59 upstream 1f719a2f3fa6 7f07e9b0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_fiemap
2024/02/08 16:15 upstream 047371968ffc 7f07e9b0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_fiemap
2024/02/08 12:28 upstream 047371968ffc 6404acf9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_fiemap
2024/02/07 09:50 upstream 6d280f4d760e 6404acf9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_fiemap
2024/02/06 08:42 upstream 99bd3cb0d12e 6404acf9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_fiemap
2024/02/06 04:53 upstream 54be6c6c5ae8 6404acf9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_fiemap
2024/02/05 23:34 upstream 54be6c6c5ae8 6404acf9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_fiemap
2024/02/05 11:04 upstream 54be6c6c5ae8 e23e8c20 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_fiemap
2024/02/01 12:20 upstream 6764c317b6bb 81024119 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_fiemap
2024/02/01 08:50 upstream 6764c317b6bb 373b66cd .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_fiemap
2024/01/31 01:09 upstream 2a6526c4f389 7f400fcb .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_fiemap
2024/01/30 13:05 upstream 861c0981648f 7f400fcb .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_fiemap
2023/11/14 04:20 upstream 9bacdd8996c7 cb976f63 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root possible deadlock in ntfs_fiemap
2023/08/01 17:21 upstream 5d0c230f1de8 df07ffe8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root possible deadlock in ntfs_fiemap
2023/06/23 05:54 upstream 8a28a0b6f1a1 09ffe269 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in ntfs_fiemap
2022/11/30 12:37 upstream 01f856ae6d0c 4c2a66e8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ntfs_fiemap
2022/12/15 10:02 upstream 041fae9c105a 6f9c033e .config console log report info ci-qemu-upstream-386 possible deadlock in ntfs_fiemap
2023/06/19 18:18 linux-next f7efed9f38f8 d521bc56 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in ntfs_fiemap
2023/05/22 21:10 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci f1fcbaa18b28 4bce1a3e .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 possible deadlock in ntfs_fiemap
* Struck through repros no longer work on HEAD.