syzbot


KASAN: use-after-free Read in ntfs_attr_find (2)

Status: upstream: reported C repro on 2023/02/26 02:15
Reported-by: syzbot+06279e4367d430b2f626@syzkaller.appspotmail.com
First crash: 634d, last: 634d
Similar bugs (9)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-5.15 KASAN: use-after-free Read in ntfs_attr_find missing-backport origin:lts-only C done 5 41d 306d 0/3 upstream: reported C repro on 2024/01/20 12:39
upstream KASAN: use-after-free Read in ntfs_attr_find ntfs3 C done 74 652d 819d 22/28 fixed on 2023/02/24 13:50
linux-6.1 KASAN: use-after-free Read in ntfs_attr_find 3 578d 589d 0/3 auto-obsoleted due to no activity on 2023/08/21 05:46
linux-4.14 KASAN: slab-out-of-bounds Read in ntfs_attr_find (2) C 31 633d 819d 0/1 upstream: reported C repro on 2022/08/25 11:21
upstream KASAN: use-after-free Read in ntfs_attr_find (2) ntfs3 C error done 22 277d 630d 0/28 auto-obsoleted due to no activity on 2024/05/28 05:52
linux-4.14 KASAN: use-after-free Read in ntfs_attr_find C done 4 1501d 1520d 1/1 fixed on 2020/11/12 10:36
linux-4.19 KASAN: use-after-free Read in ntfs_attr_find C done 13 1485d 1516d 1/1 fixed on 2020/11/27 11:32
linux-6.1 KASAN: use-after-free Read in ntfs_attr_find (2) origin:upstream missing-backport C inconclusive 2 189d 335d 0/3 upstream: reported C repro on 2023/12/22 04:54
linux-5.15 KASAN: slab-out-of-bounds Read in ntfs_attr_find 1 577d 577d 0/3 auto-obsoleted due to no activity on 2023/08/22 04:27

Sample crash report:
loop0: rw=0, want=32776, limit=4096
ntfs: (device loop0): ntfs_end_buffer_async_read(): Buffer I/O error, logical block 0x4003.
ntfs: (device loop0): check_mft_mirror(): Failed to read $MFTMirr.
ntfs: (device loop0): load_system_files(): $MFTMirr does not match $MFT.  Will not be able to remount read-write.  Run ntfsfix and/or chkdsk.
==================================================================
BUG: KASAN: use-after-free in ntfs_attr_find+0x9db/0xb10 fs/ntfs/attrib.c:613
Read of size 4 at addr ffff88808bd69148 by task syz-executor164/8105

CPU: 0 PID: 8105 Comm: syz-executor164 Not tainted 4.19.211-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/16/2023
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x1fc/0x2ef lib/dump_stack.c:118
 print_address_description.cold+0x54/0x219 mm/kasan/report.c:256
 kasan_report_error.cold+0x8a/0x1b9 mm/kasan/report.c:354
 kasan_report mm/kasan/report.c:412 [inline]
 __asan_report_load_n_noabort+0x8b/0xa0 mm/kasan/report.c:443
 ntfs_attr_find+0x9db/0xb10 fs/ntfs/attrib.c:613
 ntfs_attr_lookup+0x1020/0x1f90 fs/ntfs/attrib.c:1203
 ntfs_read_locked_attr_inode fs/ntfs/inode.c:1264 [inline]
 ntfs_attr_iget+0x652/0x23a0 fs/ntfs/inode.c:251
 load_system_files fs/ntfs/super.c:1814 [inline]
 ntfs_fill_super+0xbf5/0x7e10 fs/ntfs/super.c:2908
 mount_bdev+0x2fc/0x3b0 fs/super.c:1158
 mount_fs+0xa3/0x310 fs/super.c:1261
 vfs_kern_mount.part.0+0x68/0x470 fs/namespace.c:961
 vfs_kern_mount fs/namespace.c:951 [inline]
 do_new_mount fs/namespace.c:2492 [inline]
 do_mount+0x115c/0x2f50 fs/namespace.c:2822
 ksys_mount+0xcf/0x130 fs/namespace.c:3038
 __do_sys_mount fs/namespace.c:3052 [inline]
 __se_sys_mount fs/namespace.c:3049 [inline]
 __x64_sys_mount+0xba/0x150 fs/namespace.c:3049
 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x7f62da2a0bda
Code: 48 c7 c2 c0 ff ff ff f7 d8 64 89 02 b8 ff ff ff ff eb d2 e8 08 01 00 00 0f 1f 84 00 00 00 00 00 49 89 ca b8 a5 00 00 00 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:00007ffff5362308 EFLAGS: 00000286 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007f62da2a0bda
RDX: 000000002001f6c0 RSI: 000000002001f640 RDI: 00007ffff5362310
RBP: 00007ffff5362310 R08: 00007ffff5362350 R09: 000000000001f61d
R10: 0000000000008703 R11: 0000000000000286 R12: 0000000000000004
R13: 0000555557271380 R14: 00007ffff5362350 R15: 0000000000000000

The buggy address belongs to the page:
page:ffffea00022f5a40 count:0 mapcount:0 mapping:0000000000000000 index:0x1
flags: 0xfff00000000000()
raw: 00fff00000000000 ffffea00022f5a88 ffffea000230c7c8 0000000000000000
raw: 0000000000000001 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff88808bd69000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff88808bd69080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff88808bd69100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
                                              ^
 ffff88808bd69180: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff88808bd69200: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/02/26 02:15 linux-4.19.y 3f8a27f9e27b ee50e71c .config console log report syz C [disk image] [vmlinux] [mounted in repro] ci2-linux-4-19 KASAN: use-after-free Read in ntfs_attr_find
* Struck through repros no longer work on HEAD.