syzbot


possible deadlock in attr_data_get_block (2)

Status: upstream: reported C repro on 2024/08/15 10:46
Subsystems: ntfs3
[Documentation on labels]
Reported-by: syzbot+262a71e9d2faf8747085@syzkaller.appspotmail.com
First crash: 99d, last: 1h02m
Cause bisection: failed (error log, bisect log)
  
Discussions (3)
Title Replies (including bot) Last reply
[syzbot] Monthly ntfs3 report (Nov 2024) 0 (1) 2024/11/13 11:07
[syzbot] Monthly ntfs3 report (Sep 2024) 0 (1) 2024/09/12 08:11
[syzbot] [ntfs3?] possible deadlock in attr_data_get_block (2) 0 (1) 2024/08/15 10:46
Similar bugs (3)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-6.1 possible deadlock in attr_data_get_block origin:lts-only C inconclusive 184 16h22m 603d 0/3 upstream: reported C repro on 2023/03/29 04:32
upstream possible deadlock in attr_data_get_block ntfs3 C error 3111 99d 765d 27/28 fixed on 2024/08/14 03:44
linux-5.15 possible deadlock in attr_data_get_block origin:lts-only C done 224 15h11m 604d 0/3 upstream: reported C repro on 2023/03/27 15:11

Sample crash report:
======================================================
WARNING: possible circular locking dependency detected
6.11.0-rc7-syzkaller-00093-gfdf042df0463 #0 Not tainted
------------------------------------------------------
syz-executor319/5224 is trying to acquire lock:
ffff888075c6ef28 (&ni->ni_lock/4){+.+.}-{3:3}, at: ni_lock fs/ntfs3/ntfs_fs.h:1110 [inline]
ffff888075c6ef28 (&ni->ni_lock/4){+.+.}-{3:3}, at: attr_data_get_block+0x463/0x2ff0 fs/ntfs3/attrib.c:917

but task is already holding lock:
ffff88801a874418 (&mm->mmap_lock){++++}-{3:3}, at: mmap_write_lock_killable include/linux/mmap_lock.h:122 [inline]
ffff88801a874418 (&mm->mmap_lock){++++}-{3:3}, at: vm_mmap_pgoff+0x17c/0x3d0 mm/util.c:586

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #1 (&mm->mmap_lock){++++}-{3:3}:
       lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5759
       __might_fault+0xc6/0x120 mm/memory.c:6404
       _inline_copy_to_user include/linux/uaccess.h:176 [inline]
       _copy_to_user+0x2a/0xb0 lib/usercopy.c:26
       copy_to_user include/linux/uaccess.h:209 [inline]
       ni_fiemap+0x5b4/0x1910 fs/ntfs3/frecord.c:2140
       ntfs_fiemap+0x132/0x180 fs/ntfs3/file.c:1279
       ioctl_fiemap fs/ioctl.c:220 [inline]
       do_vfs_ioctl+0x1c07/0x2e50 fs/ioctl.c:841
       __do_sys_ioctl fs/ioctl.c:905 [inline]
       __se_sys_ioctl+0x81/0x170 fs/ioctl.c:893
       do_syscall_x64 arch/x86/entry/common.c:52 [inline]
       do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
       entry_SYSCALL_64_after_hwframe+0x77/0x7f

-> #0 (&ni->ni_lock/4){+.+.}-{3:3}:
       check_prev_add kernel/locking/lockdep.c:3133 [inline]
       check_prevs_add kernel/locking/lockdep.c:3252 [inline]
       validate_chain+0x18e0/0x5900 kernel/locking/lockdep.c:3868
       __lock_acquire+0x137a/0x2040 kernel/locking/lockdep.c:5142
       lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5759
       __mutex_lock_common kernel/locking/mutex.c:608 [inline]
       __mutex_lock+0x136/0xd70 kernel/locking/mutex.c:752
       ni_lock fs/ntfs3/ntfs_fs.h:1110 [inline]
       attr_data_get_block+0x463/0x2ff0 fs/ntfs3/attrib.c:917
       ntfs_file_mmap+0x4f5/0x850 fs/ntfs3/file.c:360
       call_mmap include/linux/fs.h:2130 [inline]
       mmap_region+0xe8f/0x2090 mm/mmap.c:2957
       do_mmap+0x8f9/0x1010 mm/mmap.c:1468
       vm_mmap_pgoff+0x1dd/0x3d0 mm/util.c:588
       ksys_mmap_pgoff+0x4f1/0x720 mm/mmap.c:1514
       do_syscall_x64 arch/x86/entry/common.c:52 [inline]
       do_syscall_64+0xf3/0x230 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
       ----                    ----
  lock(&mm->mmap_lock);
                               lock(&ni->ni_lock/4);
                               lock(&mm->mmap_lock);
  lock(&ni->ni_lock/4);

 *** DEADLOCK ***

1 lock held by syz-executor319/5224:
 #0: ffff88801a874418 (&mm->mmap_lock){++++}-{3:3}, at: mmap_write_lock_killable include/linux/mmap_lock.h:122 [inline]
 #0: ffff88801a874418 (&mm->mmap_lock){++++}-{3:3}, at: vm_mmap_pgoff+0x17c/0x3d0 mm/util.c:586

stack backtrace:
CPU: 1 UID: 0 PID: 5224 Comm: syz-executor319 Not tainted 6.11.0-rc7-syzkaller-00093-gfdf042df0463 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:93 [inline]
 dump_stack_lvl+0x241/0x360 lib/dump_stack.c:119
 check_noncircular+0x36a/0x4a0 kernel/locking/lockdep.c:2186
 check_prev_add kernel/locking/lockdep.c:3133 [inline]
 check_prevs_add kernel/locking/lockdep.c:3252 [inline]
 validate_chain+0x18e0/0x5900 kernel/locking/lockdep.c:3868
 __lock_acquire+0x137a/0x2040 kernel/locking/lockdep.c:5142
 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5759
 __mutex_lock_common kernel/locking/mutex.c:608 [inline]
 __mutex_lock+0x136/0xd70 kernel/locking/mutex.c:752
 ni_lock fs/ntfs3/ntfs_fs.h:1110 [inline]
 attr_data_get_block+0x463/0x2ff0 fs/ntfs3/attrib.c:917
 ntfs_file_mmap+0x4f5/0x850 fs/ntfs3/file.c:360
 call_mmap include/linux/fs.h:2130 [inline]
 mmap_region+0xe8f/0x2090 mm/mmap.c:2957
 do_mmap+0x8f9/0x1010 mm/mmap.c:1468
 vm_mmap_pgoff+0x1dd/0x3d0 mm/util.c:588
 ksys_mmap_pgoff+0x4f1/0x720 mm/mmap.c:1514
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fb69bd39a39
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 61 17 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffca66800d8 EFLAGS: 00000246 ORIG_RAX: 0000000000000009
RAX: ffffffffffffffda RBX: 00007ffca66802b8 RCX: 00007fb69bd39a39
RDX: 00000000017ffff7 RSI: 0000000000600000 RDI: 0000000020000000
RBP: 00007fb69bdcc610 R08: 0000000000000005 R09: 0000000000000000
R10: 0000000004002011 R11: 0000000000000246 R12: 0000000000000001
R13: 00007ffca66802a8 R14: 0000000000000001 R15: 0000000000000001
 </TASK>

Crashes (1384):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/09/13 10:33 upstream fdf042df0463 73e8a465 .config strace log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-upstream-fs possible deadlock in attr_data_get_block
2024/08/28 04:07 upstream 3ec3f5fc4a91 6c853ff9 .config strace log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-upstream-fs possible deadlock in attr_data_get_block
2024/08/15 01:11 upstream 9d5906799f7d e6b88e20 .config strace log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-upstream-fs possible deadlock in attr_data_get_block
2024/08/28 02:49 upstream 3ec3f5fc4a91 6c853ff9 .config console log report syz / log [disk image] [vmlinux] [kernel image] [mounted in repro #1] [mounted in repro #2] ci2-upstream-fs possible deadlock in attr_data_get_block
2024/11/21 05:26 upstream 43fb83c17ba2 4b25d554 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in attr_data_get_block
2024/11/21 01:53 upstream 8f7c8b88bda4 4b25d554 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in attr_data_get_block
2024/11/20 23:53 upstream 8f7c8b88bda4 4fca1650 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in attr_data_get_block
2024/11/20 21:25 upstream 8f7c8b88bda4 4fca1650 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in attr_data_get_block
2024/11/20 20:13 upstream 8f7c8b88bda4 4fca1650 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in attr_data_get_block
2024/11/20 19:05 upstream bf9aa14fc523 4fca1650 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in attr_data_get_block
2024/11/20 13:19 upstream bf9aa14fc523 4fca1650 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in attr_data_get_block
2024/11/20 06:07 upstream a5c93bfec0be 7d02db5a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in attr_data_get_block
2024/11/20 04:11 upstream 158f238aa69d 7d02db5a .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in attr_data_get_block
2024/11/19 17:41 upstream 158f238aa69d 7d02db5a .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in attr_data_get_block
2024/11/19 13:47 upstream 158f238aa69d 571351cb .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in attr_data_get_block
2024/11/19 12:15 upstream 23acd177540d 571351cb .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in attr_data_get_block
2024/11/19 03:38 upstream c6d64479d609 571351cb .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in attr_data_get_block
2024/11/19 00:00 upstream 23acd177540d 571351cb .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in attr_data_get_block
2024/11/17 20:54 upstream f66d6acccbc0 cfe3a04a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in attr_data_get_block
2024/11/17 12:15 upstream 4a5df3796467 cfe3a04a .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in attr_data_get_block
2024/11/17 08:37 upstream b5a24181e461 cfe3a04a .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in attr_data_get_block
2024/11/17 04:47 upstream 4a5df3796467 cfe3a04a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in attr_data_get_block
2024/11/16 22:57 upstream b5a24181e461 cfe3a04a .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in attr_data_get_block
2024/11/16 17:50 upstream e8bdb3c8be08 cfe3a04a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root possible deadlock in attr_data_get_block
2024/11/16 17:48 upstream e8bdb3c8be08 cfe3a04a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root possible deadlock in attr_data_get_block
2024/11/16 14:44 upstream e8bdb3c8be08 cfe3a04a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root possible deadlock in attr_data_get_block
2024/11/16 09:44 upstream e8bdb3c8be08 cfe3a04a .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in attr_data_get_block
2024/11/16 08:36 upstream f868cd251776 cfe3a04a .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in attr_data_get_block
2024/11/16 00:03 upstream f868cd251776 cfe3a04a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in attr_data_get_block
2024/11/15 18:21 upstream cfaaa7d010d1 cfe3a04a .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in attr_data_get_block
2024/11/15 13:52 upstream cfaaa7d010d1 f6ede3a3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in attr_data_get_block
2024/11/15 12:45 upstream cfaaa7d010d1 f6ede3a3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in attr_data_get_block
2024/11/15 10:06 upstream cfaaa7d010d1 f6ede3a3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in attr_data_get_block
2024/11/15 08:47 upstream cfaaa7d010d1 f6ede3a3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in attr_data_get_block
2024/11/15 07:35 upstream cfaaa7d010d1 f6ede3a3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in attr_data_get_block
2024/11/15 02:42 upstream cfaaa7d010d1 77f3eeb7 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in attr_data_get_block
2024/11/15 00:54 upstream 0a9b9d17f3a7 77f3eeb7 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in attr_data_get_block
2024/11/14 21:48 upstream cfaaa7d010d1 a8c99394 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in attr_data_get_block
2024/11/14 09:55 upstream 0a9b9d17f3a7 a8c99394 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in attr_data_get_block
2024/11/14 08:36 upstream 0a9b9d17f3a7 a8c99394 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in attr_data_get_block
2024/11/14 07:17 upstream 0a9b9d17f3a7 a8c99394 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in attr_data_get_block
2024/11/13 21:52 upstream f1b785f4c787 bb3f8425 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in attr_data_get_block
2024/11/13 20:30 upstream f1b785f4c787 bb3f8425 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs possible deadlock in attr_data_get_block
2024/11/13 12:02 upstream 3022e9d00ebe 62026c85 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in attr_data_get_block
2024/11/18 20:17 upstream adc218676eef e7bb5d6e .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root possible deadlock in attr_data_get_block
2024/11/21 04:29 linux-next ac24e26aa08f 4b25d554 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in attr_data_get_block
2024/11/19 08:20 linux-next 414c97c966b6 571351cb .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in attr_data_get_block
2024/11/18 15:32 linux-next ae58226b89ac 571351cb .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in attr_data_get_block
2024/11/16 04:44 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 887407160d72 cfe3a04a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 possible deadlock in attr_data_get_block
2024/11/15 19:56 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 887407160d72 f6ede3a3 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 possible deadlock in attr_data_get_block
2024/11/13 18:30 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 8e9a54d7181b a8c99394 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 possible deadlock in attr_data_get_block
* Struck through repros no longer work on HEAD.