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: 614d, last: 1h21m
Cause bisection: failed (error log, bisect log)
  
Discussions (16)
Title Replies (including bot) Last reply
[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
[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 140 6d16h 460d 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 133 4d07h 452d 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.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 (3812):
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
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/06/23 13:50 upstream 5f583a3162ff edc5149a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in ni_fiemap
2024/06/21 22:09 upstream 4545981f33be edc5149a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root possible deadlock in ni_fiemap
2024/06/21 19:41 upstream 66cc544fd75c edc5149a .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/06/21 16:12 upstream 50736169ecc8 edc5149a .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/06/21 05:50 upstream 50736169ecc8 dac2aa43 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/06/21 01:51 upstream 50736169ecc8 dac2aa43 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in ni_fiemap
2024/06/20 22:27 upstream 50736169ecc8 dac2aa43 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/06/20 21:09 upstream 50736169ecc8 dac2aa43 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/06/20 13:33 upstream 2ccbdf43d5e7 dac2aa43 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/06/20 02:31 upstream 2ccbdf43d5e7 41b7e219 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root possible deadlock in ni_fiemap
2024/06/20 00:31 upstream 2ccbdf43d5e7 41b7e219 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root possible deadlock in ni_fiemap
2024/06/19 13:28 upstream 2ccbdf43d5e7 41b7e219 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root possible deadlock in ni_fiemap
2024/06/19 04:20 upstream 2ccbdf43d5e7 41b7e219 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/06/18 20:31 upstream 2ccbdf43d5e7 639d6cdf .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/06/18 19:20 upstream 2ccbdf43d5e7 639d6cdf .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/06/17 23:12 upstream 2ccbdf43d5e7 1f11cfd7 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root possible deadlock in ni_fiemap
2024/06/17 18:41 upstream 2ccbdf43d5e7 1f11cfd7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/06/17 17:28 upstream 2ccbdf43d5e7 1f11cfd7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/06/17 10:03 upstream 2ccbdf43d5e7 88722c0f .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/06/17 09:01 upstream 2ccbdf43d5e7 88722c0f .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/06/17 05:36 upstream 2ccbdf43d5e7 f429ab00 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/06/17 03:56 upstream 2ccbdf43d5e7 f429ab00 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root possible deadlock in ni_fiemap
2024/06/16 23:36 upstream 2ccbdf43d5e7 f429ab00 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/06/16 20:34 upstream 2ccbdf43d5e7 f429ab00 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root possible deadlock in ni_fiemap
2024/06/16 11:10 upstream 2ccbdf43d5e7 f429ab00 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/06/16 11:09 upstream 2ccbdf43d5e7 f429ab00 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/06/16 02:22 upstream 2ccbdf43d5e7 f429ab00 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root possible deadlock in ni_fiemap
2024/06/16 01:18 upstream 2ccbdf43d5e7 f429ab00 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/06/16 00:10 upstream 2ccbdf43d5e7 f429ab00 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/06/15 15:36 upstream 2ccbdf43d5e7 f429ab00 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in ni_fiemap
2024/06/15 13:53 upstream 2ccbdf43d5e7 f429ab00 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root possible deadlock in ni_fiemap
2024/06/23 11:12 upstream 5f583a3162ff c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream possible deadlock in ni_fiemap
2024/06/19 10:21 upstream 2ccbdf43d5e7 c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream possible deadlock in ni_fiemap
2024/06/19 07:04 upstream 2ccbdf43d5e7 c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream possible deadlock in ni_fiemap
2024/06/18 17:18 upstream 2ccbdf43d5e7 c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream possible deadlock in ni_fiemap
2024/06/18 14:05 upstream 2ccbdf43d5e7 c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream possible deadlock in ni_fiemap
2024/06/18 11:10 upstream 2ccbdf43d5e7 c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream possible deadlock in ni_fiemap
2024/06/18 03:53 upstream 2ccbdf43d5e7 c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream possible deadlock in ni_fiemap
2024/06/17 13:53 upstream 2ccbdf43d5e7 c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream possible deadlock in ni_fiemap
2024/06/17 01:06 upstream 2ccbdf43d5e7 c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream possible deadlock in ni_fiemap
2024/06/22 23:40 upstream 563a50672d8a c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in ni_fiemap
2024/06/20 10:01 upstream 2ccbdf43d5e7 c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in ni_fiemap
2024/06/20 07:44 upstream 2ccbdf43d5e7 c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in ni_fiemap
2024/06/19 20:49 upstream 2ccbdf43d5e7 c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in ni_fiemap
2024/06/18 12:44 upstream 2ccbdf43d5e7 c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in ni_fiemap
2024/06/18 05:25 upstream 2ccbdf43d5e7 c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in ni_fiemap
2024/06/17 21:22 upstream 2ccbdf43d5e7 c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in ni_fiemap
2024/06/16 19:18 upstream 2ccbdf43d5e7 c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in ni_fiemap
2024/06/16 03:56 upstream 2ccbdf43d5e7 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/06/16 17:33 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci ac2193b4b460 f429ab00 .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.