syzbot


possible deadlock in ni_fiemap

Status: upstream: reported C repro on 2022/10/18 05:47
Subsystems: ntfs3
[Documentation on labels]
Reported-by: syzbot+c300ab283ba3bc072439@syzkaller.appspotmail.com
First crash: 498d, last: 1h34m
Cause bisection: failed (error log, bisect log)
  
Discussions (12)
Title Replies (including bot) Last reply
[syzbot] Monthly ntfs3 report (Feb 2024) 0 (1) 2024/02/02 21:04
[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 (Oct 2023) 0 (1) 2023/11/01 10:13
[syzbot] Monthly ntfs3 report (Sep 2023) 0 (1) 2023/10/02 09:42
[syzbot] Monthly ntfs3 report (Aug 2023) 0 (1) 2023/08/30 12: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 ni_fiemap 0 (2) 2022/11/30 17:25
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-5.15 possible deadlock in ni_fiemap origin:upstream missing-backport C done 82 3d07h 344d 0/3 upstream: reported C repro on 2023/03/20 17:55
linux-6.1 possible deadlock in ni_fiemap origin:lts-only C unreliable 49 5d10h 336d 0/3 upstream: reported C repro on 2023/03/29 02:45
Last patch testing requests (1)
Created Duration User Patch Repo Result
2023/09/14 17:08 18m retest repro upstream OK log

Sample crash report:
======================================================
WARNING: possible circular locking dependency detected
6.7.0-rc8-syzkaller #0 Not tainted
------------------------------------------------------
syz-executor702/5066 is trying to acquire lock:
ffff88802a2eb120 (&mm->mmap_lock){++++}-{3:3}, at: __might_fault mm/memory.c:5956 [inline]
ffff88802a2eb120 (&mm->mmap_lock){++++}-{3:3}, at: __might_fault+0xe6/0x1a0 mm/memory.c:5949

but task is already holding lock:
ffff88807d12f050 (&ni->file.run_lock#3){++++}-{3:3}, at: ni_fiemap+0x381/0xc00 fs/ntfs3/frecord.c:1961

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #1 (&ni->file.run_lock#3){++++}-{3:3}:
       down_read+0x9a/0x330 kernel/locking/rwsem.c:1526
       attr_data_get_block+0x189/0x1a20 fs/ntfs3/attrib.c:902
       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:556
       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:52 [inline]
       do_syscall_64+0x40/0x110 arch/x86/entry/common.c:83
       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:3869 [inline]
       __lock_acquire+0x2433/0x3b20 kernel/locking/lockdep.c:5137
       lock_acquire kernel/locking/lockdep.c:5754 [inline]
       lock_acquire+0x1ae/0x520 kernel/locking/lockdep.c:5719
       __might_fault mm/memory.c:5956 [inline]
       __might_fault+0x11f/0x1a0 mm/memory.c:5949
       _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+0x440/0xc00 fs/ntfs3/frecord.c:2065
       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:52 [inline]
       do_syscall_64+0x40/0x110 arch/x86/entry/common.c:83
       entry_SYSCALL_64_after_hwframe+0x63/0x6b

other info that might help us debug this:

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  rlock(&ni->file.run_lock#3);
                               lock(&mm->mmap_lock);
                               lock(&ni->file.run_lock#3);
  rlock(&mm->mmap_lock);

 *** DEADLOCK ***

2 locks held by syz-executor702/5066:
 #0: ffff88807d12efa0 (&ni->ni_lock#2/4){+.+.}-{3:3}, at: ni_lock fs/ntfs3/ntfs_fs.h:1124 [inline]
 #0: ffff88807d12efa0 (&ni->ni_lock#2/4){+.+.}-{3:3}, at: ntfs_fiemap+0xb6/0x110 fs/ntfs3/file.c:1162
 #1: ffff88807d12f050 (&ni->file.run_lock#3){++++}-{3:3}, at: ni_fiemap+0x381/0xc00 fs/ntfs3/frecord.c:1961

stack backtrace:
CPU: 0 PID: 5066 Comm: syz-executor702 Not tainted 6.7.0-rc8-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023
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:3869 [inline]
 __lock_acquire+0x2433/0x3b20 kernel/locking/lockdep.c:5137
 lock_acquire kernel/locking/lockdep.c:5754 [inline]
 lock_acquire+0x1ae/0x520 kernel/locking/lockdep.c:5719
 __might_fault mm/memory.c:5956 [inline]
 __might_fault+0x11f/0x1a0 mm/memory.c:5949
 _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+0x440/0xc00 fs/ntfs3/frecord.c:2065
 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:52 [inline]
 do_syscall_64+0x40/0x110 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x63/0x6b
RIP: 0033:0x7fd3cb0bbc19
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 b1 18 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:00007fd3cb078218 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007fd3cb1636c8 RCX: 00007fd3cb0bbc19
RDX: 0000000020000180 RSI: 00000000c020660b RDI: 0000000000000005
RBP: 00007fd3cb1636c0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007fd3cb12fbf0
R13: 00007fd3cb12fa08 R14: 0000000000bcaefa R15: 0032656c69662f2e
 </TASK>

Crashes (2563):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/01/02 02:18 upstream 610a9b8f49fb fb427a07 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci-upstream-kasan-gce-root possible deadlock in ni_fiemap
2023/10/22 03:13 upstream d537ae43f8a1 361b23dc .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-upstream-fs possible deadlock in ni_fiemap
2023/10/04 11:47 upstream cbf3a2cb156a 65faba36 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci-upstream-kasan-gce-smack-root possible deadlock in ni_fiemap
2023/09/26 10:52 upstream 6465e260f487 0b6a67ac .config console log report syz C [disk image (non-bootable)] [vmlinux] [kernel image] [mounted in repro] ci-qemu-upstream possible deadlock in ni_fiemap
2024/01/12 23:06 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 0802e17d9aca dda5a988 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro #1] [mounted in repro #2] ci-upstream-gce-arm64 possible deadlock in ni_fiemap
2022/11/30 17:25 upstream 01f856ae6d0c 4c2a66e8 .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-upstream-fs possible deadlock in ni_fiemap
2024/02/28 02:36 upstream cf1182944c7c d367cbe5 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/02/27 19:42 upstream 45ec2f5f6ed3 d367cbe5 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/02/27 11:51 upstream 45ec2f5f6ed3 05e69c83 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/02/27 06:12 upstream 45ec2f5f6ed3 05e69c83 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/02/27 04:30 upstream 45ec2f5f6ed3 05e69c83 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/02/26 21:57 upstream d206a76d7d27 da36a36b .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/02/26 14:33 upstream d206a76d7d27 da36a36b .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/02/26 11:56 upstream d206a76d7d27 8d446f15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/02/26 05:28 upstream 70ff1fe626a1 8d446f15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/02/25 22:40 upstream 70ff1fe626a1 8d446f15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/02/25 17:17 upstream ab0a97cffa0b 8d446f15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/02/25 09:27 upstream ab0a97cffa0b 8d446f15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/02/25 03:54 upstream f2e367d6ad3b 8d446f15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/02/24 21:04 upstream f2e367d6ad3b 8d446f15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/02/24 19:55 upstream f2e367d6ad3b 8d446f15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/02/24 17:44 upstream 603c04e27c3e 8d446f15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/02/24 11:39 upstream 603c04e27c3e 8d446f15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/02/24 09:58 upstream 603c04e27c3e 8d446f15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/02/23 22:27 upstream 603c04e27c3e 8d446f15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/02/23 16:13 upstream ffd2cb6b718e 8d446f15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/02/23 13:09 upstream ffd2cb6b718e 8d446f15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/02/23 08:30 upstream ffd2cb6b718e 8d446f15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/02/23 04:00 upstream 1c892cdd8fe0 8d446f15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/02/22 19:41 upstream 1c892cdd8fe0 8d446f15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/02/22 17:01 upstream 39133352cbed 8d446f15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/02/22 15:04 upstream 39133352cbed 345111b5 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/02/22 14:02 upstream 39133352cbed 345111b5 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/02/22 10:49 upstream 39133352cbed 345111b5 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/02/22 05:10 upstream 39133352cbed 345111b5 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/02/21 18:56 upstream 39133352cbed 345111b5 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/02/21 11:56 upstream 9fc1ccccfd8d 3af7dd65 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/02/21 11:37 upstream 9fc1ccccfd8d 3af7dd65 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/02/21 05:05 upstream fca7526b7d89 3af7dd65 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/02/20 22:20 upstream fca7526b7d89 3af7dd65 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/02/20 20:35 upstream b401b621758e 3af7dd65 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/02/20 17:17 upstream b401b621758e 3af7dd65 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/02/20 11:17 upstream b401b621758e 3af7dd65 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/02/19 21:35 upstream b401b621758e 3af7dd65 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/02/19 20:14 upstream b401b621758e 3af7dd65 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/02/19 12:36 upstream b401b621758e 3af7dd65 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/02/19 10:58 upstream b401b621758e 578f7538 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/02/19 09:26 upstream b401b621758e 578f7538 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/02/18 23:49 upstream b401b621758e 578f7538 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/02/18 21:23 upstream c02197fc9076 578f7538 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/01/03 01:54 upstream 610a9b8f49fb fb427a07 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root possible deadlock in ni_fiemap
2023/12/20 01:06 upstream 55cb5f43689d 3ad490ea .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root possible deadlock in ni_fiemap
2023/11/16 03:57 upstream c42d9eeef8e5 cb976f63 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root possible deadlock in ni_fiemap
2024/01/19 02:50 upstream b0d326da462e 21772ce4 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream possible deadlock in ni_fiemap
2023/06/07 18:17 upstream a27648c74210 6b9fb3c4 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in ni_fiemap
2024/01/16 01:18 linux-next 8d04a7e2ee3f 2a7bcc7f .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in ni_fiemap
2024/02/16 07:13 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci f735966ee23c 578f7538 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 possible deadlock in ni_fiemap
2022/10/18 00:14 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci bbed346d5a96 754863b4 .config console log report info [disk image] [vmlinux] ci-upstream-gce-arm64 possible deadlock in ni_fiemap
* Struck through repros no longer work on HEAD.