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: 721d, last: 25d
Cause bisection: failed (error log, bisect log)
  
Discussions (18)
Title Replies (including bot) Last reply
[syzbot] possible deadlock in ni_fiemap 0 (4) 2024/08/23 16:03
[syzbot] Monthly ntfs3 report (Aug 2024) 0 (1) 2024/08/13 08:54
[syzbot] Monthly ntfs3 report (Jul 2024) 0 (1) 2024/07/12 10:05
[syzbot] Monthly ntfs3 report (Jun 2024) 0 (1) 2024/06/10 12:41
[syzbot] Monthly ntfs3 report (May 2024) 0 (1) 2024/05/06 13:18
[syzbot] Monthly ntfs3 report (Apr 2024) 0 (1) 2024/04/05 12:38
[syzbot] Monthly ntfs3 report (Mar 2024) 0 (1) 2024/03/05 11:09
[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
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 197 12h12m 567d 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 165 40d 559d 0/3 upstream: reported C repro on 2023/03/29 02:45
Last patch testing requests (10)
Created Duration User Patch Repo Result
2024/08/27 00:40 25m retest repro git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci OK log
2024/08/27 00:19 26m retest repro git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci OK log
2024/08/26 22:33 23m retest repro upstream OK log
2024/08/26 21:53 19m retest repro upstream report log
2024/08/26 21:53 23m retest repro upstream OK log
2024/08/26 15:11 24m retest repro upstream OK log
2024/08/26 14:37 49m retest repro upstream OK log
2024/08/23 16:03 1h52m almaz.alexandrovich@paragon-software.com https://github.com/Paragon-Software-Group/linux-ntfs3.git master report log
2024/07/20 07:43 15m almaz.alexandrovich@paragon-software.com https://github.com/Paragon-Software-Group/linux-ntfs3.git d57431c6f511bf020e474026d9f3123d7bfbea8c report log
2023/09/14 17:08 18m retest repro upstream OK log
Fix bisection attempts (1)
Created Duration User Patch Repo Result
2024/09/13 08:17 3h02m bisect fix upstream OK (0) job log log

Sample crash report:
======================================================
WARNING: possible circular locking dependency detected
6.9.0-rc5-syzkaller-00036-g9d1ddab261f3 #0 Not tainted
------------------------------------------------------
syz-executor122/5083 is trying to acquire lock:
ffff8880150760a0 (&mm->mmap_lock){++++}-{3:3}, at: __might_fault+0xaa/0x120 mm/memory.c:6220

but task is already holding lock:
ffff888079346190 (&ni->file.run_lock#3){++++}-{3:3}, at: ni_fiemap+0x373/0x1230 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}:
       lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754
       down_read+0xb1/0xa40 kernel/locking/rwsem.c:1526
       attr_data_get_block+0x2e3/0x2e10 fs/ntfs3/attrib.c:902
       ntfs_file_mmap+0x50b/0x890 fs/ntfs3/file.c:294
       call_mmap include/linux/fs.h:2115 [inline]
       mmap_region+0xf3f/0x1e50 mm/mmap.c:2820
       do_mmap+0x7af/0xe60 mm/mmap.c:1385
       vm_mmap_pgoff+0x1e3/0x420 mm/util.c:573
       ksys_mmap_pgoff+0x504/0x6e0 mm/mmap.c:1431
       do_syscall_x64 arch/x86/entry/common.c:52 [inline]
       do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83
       entry_SYSCALL_64_after_hwframe+0x77/0x7f

-> #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+0x18cb/0x58e0 kernel/locking/lockdep.c:3869
       __lock_acquire+0x1346/0x1fd0 kernel/locking/lockdep.c:5137
       lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754
       __might_fault+0xc6/0x120 mm/memory.c:6220
       _copy_to_user+0x2a/0xb0 lib/usercopy.c:36
       copy_to_user include/linux/uaccess.h:191 [inline]
       fiemap_fill_next_extent+0x235/0x410 fs/ioctl.c:145
       ni_fiemap+0xa5e/0x1230 fs/ntfs3/frecord.c:2065
       ntfs_fiemap+0x132/0x180 fs/ntfs3/file.c:1206
       ioctl_fiemap fs/ioctl.c:220 [inline]
       do_vfs_ioctl+0x1c07/0x2e50 fs/ioctl.c:838
       __do_sys_ioctl fs/ioctl.c:902 [inline]
       __se_sys_ioctl+0x81/0x170 fs/ioctl.c:890
       do_syscall_x64 arch/x86/entry/common.c:52 [inline]
       do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83
       entry_SYSCALL_64_after_hwframe+0x77/0x7f

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-executor122/5083:
 #0: ffff8880793460e0 (&ni->ni_lock#2/4){+.+.}-{3:3}, at: ni_lock fs/ntfs3/ntfs_fs.h:1121 [inline]
 #0: ffff8880793460e0 (&ni->ni_lock#2/4){+.+.}-{3:3}, at: ntfs_fiemap+0xff/0x180 fs/ntfs3/file.c:1204
 #1: ffff888079346190 (&ni->file.run_lock#3){++++}-{3:3}, at: ni_fiemap+0x373/0x1230 fs/ntfs3/frecord.c:1961

stack backtrace:
CPU: 1 PID: 5083 Comm: syz-executor122 Not tainted 6.9.0-rc5-syzkaller-00036-g9d1ddab261f3 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114
 check_noncircular+0x36a/0x4a0 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+0x18cb/0x58e0 kernel/locking/lockdep.c:3869
 __lock_acquire+0x1346/0x1fd0 kernel/locking/lockdep.c:5137
 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754
 __might_fault+0xc6/0x120 mm/memory.c:6220
 _copy_to_user+0x2a/0xb0 lib/usercopy.c:36
 copy_to_user include/linux/uaccess.h:191 [inline]
 fiemap_fill_next_extent+0x235/0x410 fs/ioctl.c:145
 ni_fiemap+0xa5e/0x1230 fs/ntfs3/frecord.c:2065
 ntfs_fiemap+0x132/0x180 fs/ntfs3/file.c:1206
 ioctl_fiemap fs/ioctl.c:220 [inline]
 do_vfs_ioctl+0x1c07/0x2e50 fs/ioctl.c:838
 __do_sys_ioctl fs/ioctl.c:902 [inline]
 __se_sys_ioctl+0x81/0x170 fs/ioctl.c:890
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fec923b3c19
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:00007fec92349218 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007fec9245b6d8 RCX: 00007fec923b3c19
RDX: 0000000020000180 RSI: 00000000c020660b RDI: 0000000000000005
RBP: 00007fec9245b6d0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007fec92427bf0
R13: 00007fec92427a08 R14: 0000000000bcaefa R15: 0032656c69662f2e
 </TASK>

Crashes (4007):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/04/24 10:35 upstream 9d1ddab261f3 21339d7b .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
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
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
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
2024/07/22 11:45 upstream 933069701c1b df655b64 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/07/22 06:37 upstream 7846b618e0a4 b88348e9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/07/22 04:53 upstream 7846b618e0a4 b88348e9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in ni_fiemap
2024/07/22 00:04 upstream 7846b618e0a4 b88348e9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/07/21 21:07 upstream 2c9b3512402e b88348e9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in ni_fiemap
2024/07/20 23:35 upstream 2c9b3512402e b88348e9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/07/20 12:42 upstream 3c3ff7be9729 b88348e9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/07/20 09:21 upstream 3c3ff7be9729 b88348e9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/07/20 01:30 upstream 4305ca0087dd 890ce4f3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/07/19 22:17 upstream 4305ca0087dd 890ce4f3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/07/19 20:32 upstream 4305ca0087dd 890ce4f3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/07/19 16:36 upstream 720261cfc732 890ce4f3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/07/19 15:19 upstream 720261cfc732 ee4e11c8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in ni_fiemap
2024/07/19 11:18 upstream 720261cfc732 ee4e11c8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/07/19 00:53 upstream b1bc554e009e 71884c12 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/07/18 21:48 upstream b1bc554e009e 71884c12 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/07/18 20:30 upstream b1bc554e009e 7403ec00 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in ni_fiemap
2024/07/18 17:51 upstream b1bc554e009e 71884c12 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/07/18 12:22 upstream b1bc554e009e 7403ec00 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in ni_fiemap
2024/07/18 09:46 upstream b1bc554e009e 7403ec00 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in ni_fiemap
2024/07/18 08:24 upstream b1bc554e009e 03114f55 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in ni_fiemap
2024/07/18 06:30 upstream 51835949dda3 0f902625 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/07/18 00:39 upstream 51835949dda3 0f902625 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/07/17 17:18 upstream 51835949dda3 03114f55 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in ni_fiemap
2024/07/17 16:59 upstream 51835949dda3 03114f55 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in ni_fiemap
2024/07/17 15:56 upstream 51835949dda3 03114f55 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in ni_fiemap
2024/07/17 01:59 upstream 408323581b72 215bec2d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root possible deadlock in ni_fiemap
2024/07/16 21:40 upstream d67978318827 b66b37bd .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/07/16 20:02 upstream d67978318827 215bec2d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in ni_fiemap
2024/07/16 18:54 upstream d67978318827 215bec2d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in ni_fiemap
2024/07/16 09:24 upstream d67978318827 e8709b21 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/07/16 08:15 upstream 5e0497553643 e8709b21 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/07/16 06:44 upstream 5e0497553643 e8709b21 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/07/16 04:46 upstream 5e0497553643 e8709b21 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/07/15 18:58 upstream 5e0497553643 efee4ed2 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in ni_fiemap
2024/07/15 17:55 upstream 5e0497553643 c605e6a2 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/07/15 14:32 upstream 0c3836482481 efee4ed2 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in ni_fiemap
2024/07/15 02:29 upstream 0c3836482481 eaeb5c15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/07/14 22:57 upstream 4d145e3f830b eaeb5c15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/07/14 20:57 upstream 4d145e3f830b eaeb5c15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/07/14 16:35 upstream 4d145e3f830b eaeb5c15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/07/14 14:33 upstream 4d145e3f830b eaeb5c15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/07/14 12:09 upstream 4d145e3f830b eaeb5c15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/06/26 08:44 upstream 55027e689933 dec8bc94 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root possible deadlock in ni_fiemap
2024/06/25 11:27 upstream 55027e689933 215eef4a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root possible deadlock in ni_fiemap
2024/06/26 11:51 upstream 55027e689933 dec8bc94 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream possible deadlock in ni_fiemap
2024/06/26 03:38 upstream 55027e689933 c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in ni_fiemap
2024/06/11 16:07 linux-next a957267fa7e9 c7d7d815 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in ni_fiemap
2024/08/12 14:35 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci c912bf709078 6f4edef4 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 possible deadlock in ni_fiemap
2024/08/11 18:06 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci c912bf709078 6f4edef4 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 possible deadlock in ni_fiemap
2024/08/08 17:53 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci c912bf709078 de12cf65 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 possible deadlock in ni_fiemap
2024/07/29 11:46 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci c912bf709078 5187fc86 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 possible deadlock in ni_fiemap
2024/07/23 23:19 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci c912bf709078 708c10c4 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 possible deadlock in ni_fiemap
2024/07/23 06:23 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci c912bf709078 708c10c4 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 possible deadlock in ni_fiemap
2024/07/22 10:47 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci c912bf709078 f063dfd9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 possible deadlock in ni_fiemap
2024/07/21 02:44 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci c912bf709078 b88348e9 .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.