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: 444d, last: 2d01h
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 (2)
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 88 2d10h 442d 0/3 upstream: reported C repro on 2023/03/29 04:32
upstream possible deadlock in attr_data_get_block ntfs3 C error 2624 52m 605d 0/28 upstream: reported C repro on 2022/10/17 07:43
Fix bisection attempts (2)
Created Duration User Patch Repo Result
2023/10/02 00:27 5h06m fix candidate upstream job log (1)
2023/08/18 10:00 12h08m fix candidate upstream error job log (0)

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 (149):
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/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/05/31 22:58 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/05/15 03:05 linux-5.15.y 284087d4f7d5 fdb4c10c .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in attr_data_get_block
2024/05/14 01:02 linux-5.15.y 284087d4f7d5 fdb4c10c .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in attr_data_get_block
2024/05/13 00:17 linux-5.15.y 284087d4f7d5 9026e142 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in attr_data_get_block
2024/05/08 11:50 linux-5.15.y 284087d4f7d5 4cf3f9b3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in attr_data_get_block
2024/04/29 21:42 linux-5.15.y b925f60c6ee7 f10afd69 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in attr_data_get_block
2024/04/23 11:19 linux-5.15.y c52b9710c83d 21339d7b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in attr_data_get_block
2024/04/16 19:08 linux-5.15.y fa3df276cd36 18f6e127 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in attr_data_get_block
2024/04/07 14:15 linux-5.15.y 9465fef4ae35 ca620dd8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in attr_data_get_block
2024/04/04 10:04 linux-5.15.y 9465fef4ae35 0ee3535e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in attr_data_get_block
2024/01/25 19:29 linux-5.15.y ddcaf4999061 cc4a4020 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in attr_data_get_block
2024/01/16 05:01 linux-5.15.y ddcaf4999061 2a7bcc7f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in attr_data_get_block
2023/12/21 07:17 linux-5.15.y 1d146b1875fc de21eb89 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in attr_data_get_block
2023/12/13 20:25 linux-5.15.y d0fc081c6241 3222d10c .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in attr_data_get_block
2023/11/25 07:45 linux-5.15.y 2a910f4af54d 5b429f39 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in attr_data_get_block
2023/11/09 19:34 linux-5.15.y 80529b4968a8 56230772 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan 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
2024/05/31 03:21 linux-5.15.y c61bd26ae81a 34889ee3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in attr_data_get_block
2024/05/21 11:46 linux-5.15.y 83655231580b 4c0d3ee3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in attr_data_get_block
2024/05/18 05:30 linux-5.15.y 83655231580b c0f1611a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in attr_data_get_block
2024/05/16 20:50 linux-5.15.y 284087d4f7d5 c2e07261 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in attr_data_get_block
2024/05/16 03:46 linux-5.15.y 284087d4f7d5 ef5d53ed .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in attr_data_get_block
2024/05/14 21:18 linux-5.15.y 284087d4f7d5 fdb4c10c .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in attr_data_get_block
2024/05/14 02:46 linux-5.15.y 284087d4f7d5 fdb4c10c .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in attr_data_get_block
2024/05/11 11:11 linux-5.15.y 284087d4f7d5 9026e142 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in attr_data_get_block
2024/05/10 18:08 linux-5.15.y 284087d4f7d5 f7c35481 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in attr_data_get_block
2024/05/09 11:42 linux-5.15.y 284087d4f7d5 05079661 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in attr_data_get_block
2024/05/02 21:28 linux-5.15.y 284087d4f7d5 ddfc15a1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in attr_data_get_block
2024/04/30 11:06 linux-5.15.y b925f60c6ee7 f10afd69 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in attr_data_get_block
2024/04/29 23:51 linux-5.15.y b925f60c6ee7 f10afd69 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in attr_data_get_block
2024/04/26 04:29 linux-5.15.y c52b9710c83d 8bdc0f22 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in attr_data_get_block
2024/04/25 05:59 linux-5.15.y c52b9710c83d 8bdc0f22 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in attr_data_get_block
2024/04/10 14:36 linux-5.15.y 9465fef4ae35 4320ec32 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in attr_data_get_block
2024/04/10 07:15 linux-5.15.y 9465fef4ae35 171ec371 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in attr_data_get_block
2024/04/08 15:15 linux-5.15.y 9465fef4ae35 53df08b6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in attr_data_get_block
2024/03/13 19:52 linux-5.15.y 574362648507 f919f202 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in attr_data_get_block
2024/03/09 08:04 linux-5.15.y 574362648507 6ee49f2e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in attr_data_get_block
2024/03/04 12:49 linux-5.15.y 80efc6265290 3717835d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in attr_data_get_block
2024/02/29 03:17 linux-5.15.y 458ce51d0356 352ab904 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in attr_data_get_block
2024/02/01 17:15 linux-5.15.y 6139f2a02fe0 81024119 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in attr_data_get_block
2023/11/23 22:42 linux-5.15.y 2a910f4af54d 5b429f39 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in attr_data_get_block
2023/11/11 04:31 linux-5.15.y 80529b4968a8 d80eec66 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in attr_data_get_block
2023/11/08 22:22 linux-5.15.y 80529b4968a8 b93f63e8 .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.