syzbot


possible deadlock in ntfs_fiemap

Status: upstream: reported C repro on 2022/11/30 12:51
Reported-by: syzbot+96cee7d33ca3f87eee86@syzkaller.appspotmail.com
First crash: 66d, last: 19h45m

Cause bisection: failed (bisect log)
Last patch testing requests:
Created Duration User Patch Repo Result
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.1.0-rc8-syzkaller-00035-gf3e8416619ce #0 Not tainted
------------------------------------------------------
syz-executor145/3632 is trying to acquire lock:
ffff88801981bb58 (&mm->mmap_lock#2){++++}-{3:3}, at: __might_fault+0x8f/0x110 mm/memory.c:5644

but task is already holding lock:
ffff88807288d220 (&ni->ni_lock/4){+.+.}-{3:3}, at: ni_lock fs/ntfs3/ntfs_fs.h:1108 [inline]
ffff88807288d220 (&ni->ni_lock/4){+.+.}-{3:3}, at: ntfs_fiemap+0x101/0x180 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}:
       lock_acquire+0x182/0x3c0 kernel/locking/lockdep.c:5668
       __mutex_lock_common+0x1bd/0x26e0 kernel/locking/mutex.c:603
       __mutex_lock kernel/locking/mutex.c:747 [inline]
       mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:799
       ni_lock fs/ntfs3/ntfs_fs.h:1108 [inline]
       attr_data_get_block+0x301/0x2370 fs/ntfs3/attrib.c:917
       ntfs_file_mmap+0x48c/0x730 fs/ntfs3/file.c:387
       call_mmap include/linux/fs.h:2204 [inline]
       mmap_region+0xfe6/0x1e20 mm/mmap.c:2622
       do_mmap+0x8d9/0xf30 mm/mmap.c:1412
       vm_mmap_pgoff+0x19e/0x2b0 mm/util.c:520
       ksys_mmap_pgoff+0x48c/0x6d0 mm/mmap.c:1458
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x63/0xcd

-> #0 (&mm->mmap_lock#2){++++}-{3:3}:
       check_prev_add kernel/locking/lockdep.c:3097 [inline]
       check_prevs_add kernel/locking/lockdep.c:3216 [inline]
       validate_chain+0x1898/0x6ae0 kernel/locking/lockdep.c:3831
       __lock_acquire+0x1292/0x1f60 kernel/locking/lockdep.c:5055
       lock_acquire+0x182/0x3c0 kernel/locking/lockdep.c:5668
       __might_fault+0xb2/0x110 mm/memory.c:5645
       _copy_to_user+0x26/0x130 lib/usercopy.c:29
       copy_to_user include/linux/uaccess.h:169 [inline]
       fiemap_fill_next_extent+0x22e/0x410 fs/ioctl.c:144
       ni_fiemap+0xf57/0x1130 fs/ntfs3/frecord.c:1934
       ntfs_fiemap+0x134/0x180 fs/ntfs3/file.c:1245
       ioctl_fiemap fs/ioctl.c:219 [inline]
       do_vfs_ioctl+0x187f/0x29a0 fs/ioctl.c:810
       __do_sys_ioctl fs/ioctl.c:868 [inline]
       __se_sys_ioctl+0x83/0x170 fs/ioctl.c:856
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x63/0xcd

other info that might help us debug this:

 Possible unsafe locking scenario:

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

 *** DEADLOCK ***

1 lock held by syz-executor145/3632:
 #0: ffff88807288d220 (&ni->ni_lock/4){+.+.}-{3:3}, at: ni_lock fs/ntfs3/ntfs_fs.h:1108 [inline]
 #0: ffff88807288d220 (&ni->ni_lock/4){+.+.}-{3:3}, at: ntfs_fiemap+0x101/0x180 fs/ntfs3/file.c:1243

stack backtrace:
CPU: 0 PID: 3632 Comm: syz-executor145 Not tainted 6.1.0-rc8-syzkaller-00035-gf3e8416619ce #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1b1/0x28e lib/dump_stack.c:106
 check_noncircular+0x2cc/0x390 kernel/locking/lockdep.c:2177
 check_prev_add kernel/locking/lockdep.c:3097 [inline]
 check_prevs_add kernel/locking/lockdep.c:3216 [inline]
 validate_chain+0x1898/0x6ae0 kernel/locking/lockdep.c:3831
 __lock_acquire+0x1292/0x1f60 kernel/locking/lockdep.c:5055
 lock_acquire+0x182/0x3c0 kernel/locking/lockdep.c:5668
 __might_fault+0xb2/0x110 mm/memory.c:5645
 _copy_to_user+0x26/0x130 lib/usercopy.c:29
 copy_to_user include/linux/uaccess.h:169 [inline]
 fiemap_fill_next_extent+0x22e/0x410 fs/ioctl.c:144
 ni_fiemap+0xf57/0x1130 fs/ntfs3/frecord.c:1934
 ntfs_fiemap+0x134/0x180 fs/ntfs3/file.c:1245
 ioctl_fiemap fs/ioctl.c:219 [inline]
 do_vfs_ioctl+0x187f/0x29a0 fs/ioctl.c:810
 __do_sys_ioctl fs/ioctl.c:868 [inline]
 __se_sys_ioctl+0x83/0x170 fs/ioctl.c:856
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f84c755aca9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 51 14 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 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffdcb203e18 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f84c755aca9
RDX: 0000000020000040 RSI: 00000000c020660b RDI: 0000000000000006
RBP: 00007f84c751a2b0 R08: 0000000000000000 R09: 0000000000000000

Crashes (140):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets Title
ci2-upstream-fs 2022/12/09 04:00 upstream f3e8416619ce 1034e5fa .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] possible deadlock in ntfs_fiemap
ci2-upstream-fs 2023/02/04 14:59 upstream 0136d86b7852 be607b78 .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ntfs_fiemap
ci2-upstream-fs 2023/02/04 04:02 upstream 0136d86b7852 1b2f701a .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ntfs_fiemap
ci2-upstream-fs 2023/02/01 10:33 upstream c0b67534c95c 9a6f477c .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ntfs_fiemap
ci2-upstream-fs 2023/01/31 10:04 upstream 6d796c50f84c b68fb8d6 .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ntfs_fiemap
ci2-upstream-fs 2023/01/30 09:37 upstream ab072681eabe 9dfcf09c .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ntfs_fiemap
ci2-upstream-fs 2023/01/30 00:39 upstream ab072681eabe 9dfcf09c .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ntfs_fiemap
ci2-upstream-fs 2023/01/28 12:27 upstream 5af6ce704936 9dfcf09c .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ntfs_fiemap
ci2-upstream-fs 2023/01/28 09:27 upstream 83abd4d4c4be 9dfcf09c .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ntfs_fiemap
ci2-upstream-fs 2023/01/28 05:40 upstream 83abd4d4c4be 9dfcf09c .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ntfs_fiemap
ci2-upstream-fs 2023/01/27 19:21 upstream 7c46948a6e9c 9dfcf09c .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ntfs_fiemap
ci2-upstream-fs 2023/01/26 07:22 upstream 7c46948a6e9c 9dfcf09c .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ntfs_fiemap
ci2-upstream-fs 2023/01/25 18:56 upstream 948ef7bb70c4 9dfcf09c .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ntfs_fiemap
ci2-upstream-fs 2023/01/25 12:27 upstream 948ef7bb70c4 9dfcf09c .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ntfs_fiemap
ci2-upstream-fs 2023/01/23 14:22 upstream 2475bf0250de 9dfcf09c .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ntfs_fiemap
ci2-upstream-fs 2023/01/23 13:06 upstream 2475bf0250de 44388686 .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ntfs_fiemap
ci2-upstream-fs 2023/01/23 08:20 upstream 2475bf0250de 44388686 .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ntfs_fiemap
ci2-upstream-fs 2023/01/22 14:53 upstream 2241ab53cbb5 cc0f9968 .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ntfs_fiemap
ci2-upstream-fs 2023/01/21 01:25 upstream edc00350d205 cc0f9968 .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ntfs_fiemap
ci2-upstream-fs 2023/01/20 01:35 upstream 081edded9b38 71197f3a .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ntfs_fiemap
ci2-upstream-fs 2023/01/19 20:46 upstream 081edded9b38 71197f3a .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ntfs_fiemap
ci2-upstream-fs 2023/01/19 10:02 upstream 7287904c8771 66fca3ae .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ntfs_fiemap
ci2-upstream-fs 2023/01/19 07:58 upstream 7287904c8771 66fca3ae .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ntfs_fiemap
ci2-upstream-fs 2023/01/18 12:18 upstream c1649ec55708 4620c2d9 .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ntfs_fiemap
ci2-upstream-fs 2023/01/18 10:39 upstream 6e50979a9c87 42660d9e .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ntfs_fiemap
ci2-upstream-fs 2023/01/18 04:22 upstream 6e50979a9c87 42660d9e .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ntfs_fiemap
ci2-upstream-fs 2023/01/17 17:14 upstream 6e50979a9c87 42660d9e .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ntfs_fiemap
ci2-upstream-fs 2023/01/16 07:22 upstream 5dc4c995db9e a63719e7 .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ntfs_fiemap
ci2-upstream-fs 2023/01/13 07:42 upstream c757fc92a3f7 96166539 .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ntfs_fiemap
ci2-upstream-fs 2023/01/13 03:12 upstream e8f60cd7db24 96166539 .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ntfs_fiemap
ci2-upstream-fs 2023/01/13 00:20 upstream e8f60cd7db24 96166539 .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ntfs_fiemap
ci2-upstream-fs 2023/01/12 20:15 upstream e8f60cd7db24 96166539 .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ntfs_fiemap
ci2-upstream-fs 2023/01/12 10:11 upstream e8f60cd7db24 96166539 .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ntfs_fiemap
ci2-upstream-fs 2023/01/11 15:06 upstream 7dd4b804e080 96166539 .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ntfs_fiemap
ci2-upstream-fs 2023/01/11 02:57 upstream 40c18f363a08 48bc529a .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ntfs_fiemap
ci2-upstream-fs 2023/01/11 01:52 upstream 40c18f363a08 48bc529a .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ntfs_fiemap
ci2-upstream-fs 2023/01/10 23:06 upstream 5a41237ad1d4 48bc529a .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ntfs_fiemap
ci2-upstream-fs 2023/01/10 19:33 upstream 5a41237ad1d4 48bc529a .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ntfs_fiemap
ci2-upstream-fs 2023/01/10 15:57 upstream 5a41237ad1d4 48bc529a .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ntfs_fiemap
ci2-upstream-fs 2023/01/10 08:23 upstream 5a41237ad1d4 48bc529a .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ntfs_fiemap
ci-upstream-kasan-gce-root 2023/01/10 02:52 upstream 5a41237ad1d4 1dac8c7a .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ntfs_fiemap
ci2-upstream-fs 2023/01/09 22:29 upstream 1fe4fd6f5cad 48bc529a .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ntfs_fiemap
ci2-upstream-fs 2023/01/09 20:15 upstream 1fe4fd6f5cad 1dac8c7a .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ntfs_fiemap
ci2-upstream-fs 2023/01/09 13:44 upstream 1fe4fd6f5cad 1dac8c7a .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ntfs_fiemap
ci2-upstream-fs 2023/01/09 12:28 upstream 1fe4fd6f5cad 1dac8c7a .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ntfs_fiemap
ci-upstream-kasan-gce-root 2023/01/09 06:24 upstream 1fe4fd6f5cad 1dac8c7a .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ntfs_fiemap
ci2-upstream-fs 2023/01/08 19:45 upstream 9b43a525db12 1dac8c7a .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ntfs_fiemap
ci2-upstream-fs 2023/01/08 17:25 upstream 9b43a525db12 1dac8c7a .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ntfs_fiemap
ci2-upstream-fs 2023/01/08 09:57 upstream 9b43a525db12 1dac8c7a .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ntfs_fiemap
ci2-upstream-fs 2023/01/07 15:34 upstream 0a71553536d2 1dac8c7a .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ntfs_fiemap
ci2-upstream-fs 2023/01/06 19:12 upstream 1f5abbd77e2c 1dac8c7a .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ntfs_fiemap
ci-upstream-kasan-gce-selinux-root 2022/12/26 11:50 upstream 72a85e2b0a1e 9da18ae8 .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ntfs_fiemap
ci-upstream-kasan-gce-smack-root 2022/12/06 22:53 upstream 8ed710da2873 d88f3abb .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ntfs_fiemap
ci2-upstream-fs 2022/11/30 12:37 upstream 01f856ae6d0c 4c2a66e8 .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ntfs_fiemap
ci-qemu-upstream-386 2022/12/15 10:02 upstream 041fae9c105a 6f9c033e .config console log report info possible deadlock in ntfs_fiemap
ci-upstream-gce-arm64 2023/01/09 21:16 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 358a161a6a9e 1dac8c7a .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ntfs_fiemap
ci-upstream-gce-arm64 2023/01/07 04:41 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci ae87308093bc 1dac8c7a .config console log report info [disk image] [vmlinux] [kernel image] possible deadlock in ntfs_fiemap
* Struck through repros no longer work on HEAD.