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: 337d, last: 26d
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 49 45d 335d 0/3 upstream: reported on 2023/03/29 04:32
upstream possible deadlock in attr_data_get_block ntfs3 C error 1758 17h19m 498d 0/26 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 (101):
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/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
2023/09/13 13:09 linux-5.15.y aff03380bda4 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in attr_data_get_block
2023/09/11 18:42 linux-5.15.y aff03380bda4 59da8366 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in attr_data_get_block
2023/09/02 12:25 linux-5.15.y 8f790700c974 696ea0d2 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in attr_data_get_block
2023/08/30 21:50 linux-5.15.y 9e43368a3393 84803932 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan 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/10/19 18:01 linux-5.15.y 02e21884dcf2 42e1d524 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in attr_data_get_block
2023/09/28 05:39 linux-5.15.y b911329317b4 c2ab1e5d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in attr_data_get_block
2023/09/11 15:52 linux-5.15.y aff03380bda4 59da8366 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in attr_data_get_block
2023/08/24 23:35 linux-5.15.y f6f7927ac664 49be837e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in attr_data_get_block
2023/08/22 04:18 linux-5.15.y f6f7927ac664 6b415825 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in attr_data_get_block
2023/08/19 08:56 linux-5.15.y f6f7927ac664 d216d8a0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in attr_data_get_block
2023/08/08 18:09 linux-5.15.y 38d4ca22a528 9552ae77 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in attr_data_get_block
2023/08/08 15:27 linux-5.15.y 38d4ca22a528 9552ae77 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in attr_data_get_block
2023/08/02 20:59 linux-5.15.y 09996673e313 b178af49 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in attr_data_get_block
2023/07/27 18:50 linux-5.15.y 09996673e313 92476829 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in attr_data_get_block
2023/07/24 10:07 linux-5.15.y cdd3cdb682f4 b03242d7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in attr_data_get_block
2023/07/23 16:15 linux-5.15.y cdd3cdb682f4 27cbe77f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in attr_data_get_block
2023/07/20 16:19 linux-5.15.y d54cfc420586 f49af159 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in attr_data_get_block
2023/07/18 16:10 linux-5.15.y d54cfc420586 022df2bb .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in attr_data_get_block
2023/07/11 05:09 linux-5.15.y d54cfc420586 52ae002a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in attr_data_get_block
2023/06/30 12:18 linux-5.15.y 4af60700a60c 01298212 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in attr_data_get_block
2023/06/21 03:36 linux-5.15.y 471e639e59d1 79782afc .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in attr_data_get_block
2023/06/20 09:12 linux-5.15.y 471e639e59d1 09ffe269 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in attr_data_get_block
2023/06/19 20:34 linux-5.15.y 471e639e59d1 d521bc56 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in attr_data_get_block
2023/06/19 13:17 linux-5.15.y 471e639e59d1 d521bc56 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in attr_data_get_block
2023/06/08 01:08 linux-5.15.y d7af3e5ba454 058b3a5a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in attr_data_get_block
2023/06/07 19:55 linux-5.15.y d7af3e5ba454 058b3a5a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan 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
2023/08/18 15:52 linux-5.15.y f6f7927ac664 acb1ba71 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in attr_data_get_block
2023/08/04 17:51 linux-5.15.y 38d4ca22a528 cdae481e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in attr_data_get_block
2023/07/07 17:43 linux-5.15.y d54cfc420586 668cb1fa .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in attr_data_get_block
2023/07/07 02:12 linux-5.15.y d54cfc420586 22ae5830 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in attr_data_get_block
2023/07/05 23:12 linux-5.15.y d54cfc420586 ba5dba36 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in attr_data_get_block
2023/06/30 01:03 linux-5.15.y 4af60700a60c 01298212 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in attr_data_get_block
2023/06/28 20:19 linux-5.15.y 4af60700a60c ca69c785 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in attr_data_get_block
* Struck through repros no longer work on HEAD.