syzbot


possible deadlock in attr_data_get_block

Status: upstream: reported C repro on 2023/03/27 15:11
Bug presence: origin:lts-only
[Documentation on labels]
Reported-by: syzbot+591c47e27ef4bfc0e409@syzkaller.appspotmail.com
First crash: 558d, last: 15d
Fix commit to backport (bisect log) :
tree: upstream
commit 267a36ba30a7425ad59d20e7e7e33bbdcc9cfb0a
Author: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Date: Mon Jan 16 08:52:10 2023 +0000

  fs/ntfs3: Remove noacsrules

  
Bug presence (2)
Date Name Commit Repro Result
2023/06/08 linux-5.15.y (ToT) d7af3e5ba454 C [report] possible deadlock in ni_fiemap
2023/06/08 upstream (ToT) 25041a4c02c7 C Didn't crash
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 126 9d03h 557d 0/3 upstream: reported C repro on 2023/03/29 04:32
upstream possible deadlock in attr_data_get_block ntfs3 C error 3111 53d 719d 27/28 fixed on 2024/08/14 03:44
upstream possible deadlock in attr_data_get_block (2) ntfs3 C error 794 5h57m 51d 0/28 upstream: reported C repro on 2024/08/15 10:46
Fix bisection attempts (2)
Created Duration User Patch Repo Result
2023/10/02 00:27 5h06m fix candidate upstream OK (1) job log
2023/08/18 10:00 12h08m fix candidate upstream error job log

Sample crash report:
======================================================
WARNING: possible circular locking dependency detected
5.15.138-syzkaller #0 Not tainted
------------------------------------------------------
syz-executor140/3526 is trying to acquire lock:
ffff888070cc9e80 (&ni->ni_lock/4){+.+.}-{3:3}, at: ni_lock fs/ntfs3/ntfs_fs.h:1110 [inline]
ffff888070cc9e80 (&ni->ni_lock/4){+.+.}-{3:3}, at: attr_data_get_block+0x41f/0x24e0 fs/ntfs3/attrib.c:846

but task is already holding lock:
ffff888078a00828 (&mm->mmap_lock){++++}-{3:3}, at: mmap_write_lock_killable include/linux/mmap_lock.h:87 [inline]
ffff888078a00828 (&mm->mmap_lock){++++}-{3:3}, at: vm_mmap_pgoff+0x175/0x2d0 mm/util.c:549

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #1 (&mm->mmap_lock){++++}-{3:3}:
       lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5622
       __might_fault+0xb4/0x110 mm/memory.c:5324
       _copy_to_user+0x28/0x130 lib/usercopy.c:35
       copy_to_user include/linux/uaccess.h:200 [inline]
       fiemap_fill_next_extent+0x231/0x410 fs/ioctl.c:144
       ni_fiemap+0x1007/0x1230 fs/ntfs3/frecord.c:1900
       ntfs_fiemap+0x12e/0x170 fs/ntfs3/file.c:1225
       ioctl_fiemap fs/ioctl.c:219 [inline]
       do_vfs_ioctl+0x1934/0x2b70 fs/ioctl.c:814
       __do_sys_ioctl fs/ioctl.c:872 [inline]
       __se_sys_ioctl+0x81/0x160 fs/ioctl.c:860
       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+0x61/0xcb

-> #0 (&ni->ni_lock/4){+.+.}-{3:3}:
       check_prev_add kernel/locking/lockdep.c:3053 [inline]
       check_prevs_add kernel/locking/lockdep.c:3172 [inline]
       validate_chain+0x1646/0x58b0 kernel/locking/lockdep.c:3787
       __lock_acquire+0x1295/0x1ff0 kernel/locking/lockdep.c:5011
       lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5622
       __mutex_lock_common+0x1da/0x25a0 kernel/locking/mutex.c:596
       __mutex_lock kernel/locking/mutex.c:729 [inline]
       mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743
       ni_lock fs/ntfs3/ntfs_fs.h:1110 [inline]
       attr_data_get_block+0x41f/0x24e0 fs/ntfs3/attrib.c:846
       ntfs_file_mmap+0x458/0x7e0 fs/ntfs3/file.c:389
       call_mmap include/linux/fs.h:2108 [inline]
       mmap_region+0x10e7/0x1670 mm/mmap.c:1791
       do_mmap+0x78d/0xe00 mm/mmap.c:1575
       vm_mmap_pgoff+0x1ca/0x2d0 mm/util.c:551
       ksys_mmap_pgoff+0x559/0x780 mm/mmap.c:1624
       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+0x61/0xcb

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-executor140/3526:
 #0: ffff888078a00828 (&mm->mmap_lock){++++}-{3:3}, at: mmap_write_lock_killable include/linux/mmap_lock.h:87 [inline]
 #0: ffff888078a00828 (&mm->mmap_lock){++++}-{3:3}, at: vm_mmap_pgoff+0x175/0x2d0 mm/util.c:549

stack backtrace:
CPU: 1 PID: 3526 Comm: syz-executor140 Not tainted 5.15.138-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/09/2023
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106
 check_noncircular+0x2f8/0x3b0 kernel/locking/lockdep.c:2133
 check_prev_add kernel/locking/lockdep.c:3053 [inline]
 check_prevs_add kernel/locking/lockdep.c:3172 [inline]
 validate_chain+0x1646/0x58b0 kernel/locking/lockdep.c:3787
 __lock_acquire+0x1295/0x1ff0 kernel/locking/lockdep.c:5011
 lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5622
 __mutex_lock_common+0x1da/0x25a0 kernel/locking/mutex.c:596
 __mutex_lock kernel/locking/mutex.c:729 [inline]
 mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743
 ni_lock fs/ntfs3/ntfs_fs.h:1110 [inline]
 attr_data_get_block+0x41f/0x24e0 fs/ntfs3/attrib.c:846
 ntfs_file_mmap+0x458/0x7e0 fs/ntfs3/file.c:389
 call_mmap include/linux/fs.h:2108 [inline]
 mmap_region+0x10e7/0x1670 mm/mmap.c:1791
 do_mmap+0x78d/0xe00 mm/mmap.c:1575
 vm_mmap_pgoff+0x1ca/0x2d0 mm/util.c:551
 ksys_mmap_pgoff+0x559/0x780 mm/mmap.c:1624
 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+0x61/0xcb
RIP: 0033:0x7f5821c42639
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 81 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:00007f5821bde208 EFLAGS: 00000246 ORIG_RAX: 0000000000000009
RAX: ffffffffffffffda RBX: 00007f5821ce9618 RCX: 00007f5821c42639
RDX: 00000000027fffff RSI: 0000000000600000 RDI: 0000000020000000
RBP: 00007f5821ce9610 R08: 0000000000000004 R09: 0000000000000000
R10: 0000000004002011 R11: 0000000000000246 R12: 00007f5821cb5b5c
R13: 00007f5821c960c0 R14: 6465646165726874 R15: 0030656c69662f2e
 </TASK>

Crashes (205):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/11/14 05:55 linux-5.15.y 80529b4968a8 cb976f63 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-5-15-kasan possible deadlock in attr_data_get_block
2023/06/08 19:04 linux-5.15.y d7af3e5ba454 058b3a5a .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-5-15-kasan possible deadlock in attr_data_get_block
2024/04/24 07:04 linux-5.15.y c52b9710c83d 21339d7b .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-5-15-kasan-arm64 possible deadlock in attr_data_get_block
2024/09/21 00:32 linux-5.15.y 3a5928702e71 6f888b75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in attr_data_get_block
2024/09/12 11:45 linux-5.15.y 3a5928702e71 60e1a995 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in attr_data_get_block
2024/09/11 12:19 linux-5.15.y 14e468424d3e 8ab55d0e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in attr_data_get_block
2024/09/09 21:32 linux-5.15.y 14e468424d3e 073f8be2 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in attr_data_get_block
2024/09/06 16:49 linux-5.15.y 14e468424d3e 9750182a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in attr_data_get_block
2024/09/04 07:28 linux-5.15.y fa93fa65db6e 9d47f20a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in attr_data_get_block
2024/08/26 15:36 linux-5.15.y fa93fa65db6e 9aee4e0b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in attr_data_get_block
2024/08/25 13:56 linux-5.15.y fa93fa65db6e d7d32352 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in attr_data_get_block
2024/08/23 00:38 linux-5.15.y fa93fa65db6e ce8a9099 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in attr_data_get_block
2024/08/19 06:50 linux-5.15.y fa93fa65db6e dbc93b08 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in attr_data_get_block
2024/08/06 03:40 linux-5.15.y 7e89efd3ae1c e1bdb00a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in attr_data_get_block
2024/07/29 16:26 linux-5.15.y 7e89efd3ae1c 5187fc86 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in attr_data_get_block
2024/07/19 05:44 linux-5.15.y 7c6d66f0266f ee4e11c8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in attr_data_get_block
2024/07/16 15:50 linux-5.15.y f45bea23c39c b66b37bd .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in attr_data_get_block
2024/07/15 09:44 linux-5.15.y f45bea23c39c c605e6a2 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in attr_data_get_block
2024/07/11 10:50 linux-5.15.y f45bea23c39c c699c2eb .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in attr_data_get_block
2024/07/11 07:43 linux-5.15.y f45bea23c39c c699c2eb .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in attr_data_get_block
2024/07/09 20:33 linux-5.15.y f45bea23c39c 79d68ada .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in attr_data_get_block
2024/07/09 18:27 linux-5.15.y f45bea23c39c 79d68ada .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in attr_data_get_block
2024/07/05 12:07 linux-5.15.y f45bea23c39c 2a40360c .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in attr_data_get_block
2024/07/03 22:26 linux-5.15.y 4878aadf2d15 f76a75f3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in attr_data_get_block
2024/06/20 14:41 linux-5.15.y 4878aadf2d15 dac2aa43 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in attr_data_get_block
2024/06/17 13:21 linux-5.15.y 4878aadf2d15 1f11cfd7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in attr_data_get_block
2024/06/03 22:26 linux-5.15.y c61bd26ae81a a1feae05 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in attr_data_get_block
2024/06/03 21:06 linux-5.15.y c61bd26ae81a a1feae05 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in attr_data_get_block
2024/06/01 00:16 linux-5.15.y c61bd26ae81a 3113787f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in attr_data_get_block
2024/09/16 16:33 linux-5.15.y 3a5928702e71 c673ca06 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in attr_data_get_block
2024/09/12 14:56 linux-5.15.y 3a5928702e71 60e1a995 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in attr_data_get_block
2024/09/12 12:43 linux-5.15.y 3a5928702e71 60e1a995 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in attr_data_get_block
2024/09/10 05:30 linux-5.15.y 14e468424d3e 784df80e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in attr_data_get_block
2024/09/06 19:22 linux-5.15.y 14e468424d3e 9750182a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in attr_data_get_block
2024/09/05 03:34 linux-5.15.y 14e468424d3e dfbe2ed4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in attr_data_get_block
2024/09/03 16:58 linux-5.15.y fa93fa65db6e 326f9c5a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in attr_data_get_block
2024/09/01 21:54 linux-5.15.y fa93fa65db6e 1eda0d14 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in attr_data_get_block
2024/08/22 05:31 linux-5.15.y fa93fa65db6e ca02180f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in attr_data_get_block
2024/08/18 14:48 linux-5.15.y 7e89efd3ae1c dbc93b08 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in attr_data_get_block
2024/08/17 03:33 linux-5.15.y 7e89efd3ae1c dbc93b08 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in attr_data_get_block
2024/08/16 12:14 linux-5.15.y 7e89efd3ae1c e1c76ab2 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in attr_data_get_block
2024/07/22 16:53 linux-5.15.y 7c6d66f0266f df655b64 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in attr_data_get_block
2024/07/18 13:10 linux-5.15.y 7c6d66f0266f 71884c12 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in attr_data_get_block
2024/07/12 18:46 linux-5.15.y f45bea23c39c eaeb5c15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in attr_data_get_block
2024/07/08 13:52 linux-5.15.y f45bea23c39c cde64f7d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in attr_data_get_block
2024/06/27 14:09 linux-5.15.y 4878aadf2d15 6ef39602 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in attr_data_get_block
2024/06/16 22:13 linux-5.15.y 4878aadf2d15 f429ab00 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in attr_data_get_block
2024/06/11 14:32 linux-5.15.y c61bd26ae81a b7d9eb04 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in attr_data_get_block
2024/06/05 05:23 linux-5.15.y c61bd26ae81a e1e2c66e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in attr_data_get_block
2023/03/27 15:11 linux-5.15.y 115472395b0a f8f96aa9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in attr_data_get_block
* Struck through repros no longer work on HEAD.