syzbot


KASAN: use-after-free Read in ntfs_are_names_equal

Status: upstream: reported C repro on 2020/10/11 09:28
Reported-by: syzbot+7b92dfc4a9061e53985b@syzkaller.appspotmail.com
First crash: 780d, last: 436d

Fix bisection: failed (bisect log)
similar bugs (2):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: use-after-free Read in ntfs_are_names_equal C error error 1 779d 777d 0/24 auto-obsoleted due to no activity on 2022/09/21 05:34
linux-4.14 KASAN: use-after-free Read in ntfs_are_names_equal C error 1 278d 792d 0/1 upstream: reported C repro on 2020/09/29 06:04

Sample crash report:
ntfs: (device loop0): ntfs_read_locked_inode(): Failed with error code -5.  Marking corrupt inode 0xa as bad.  Run chkdsk.
ntfs: (device loop0): load_and_init_upcase(): Failed to load $UpCase from the volume. Using default.
ntfs: volume version 3.1.
ntfs: volume version 3.1.
==================================================================
BUG: KASAN: use-after-free in ntfs_ucsncmp fs/ntfs/unistr.c:156 [inline]
BUG: KASAN: use-after-free in ntfs_are_names_equal+0x196/0x1a0 fs/ntfs/unistr.c:75
Read of size 2 at addr ffff88808d64fee8 by task syz-executor251/6511

CPU: 0 PID: 6511 Comm: syz-executor251 Not tainted 4.19.150-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x22c/0x33e lib/dump_stack.c:118
 print_address_description.cold+0x56/0x25c mm/kasan/report.c:256
 kasan_report_error.cold+0x66/0xb9 mm/kasan/report.c:354
 kasan_report mm/kasan/report.c:412 [inline]
 __asan_report_load2_noabort+0x88/0x90 mm/kasan/report.c:431
 ntfs_ucsncmp fs/ntfs/unistr.c:156 [inline]
 ntfs_are_names_equal+0x196/0x1a0 fs/ntfs/unistr.c:75
 ntfs_attr_find+0x436/0xb70 fs/ntfs/attrib.c:628
 ntfs_attr_lookup+0x1087/0x2060 fs/ntfs/attrib.c:1203
 ntfs_read_locked_attr_inode fs/ntfs/inode.c:1258 [inline]
 ntfs_attr_iget+0x652/0x2430 fs/ntfs/inode.c:251
 ntfs_read_locked_inode+0x27c1/0x5490 fs/ntfs/inode.c:979
 ntfs_iget+0x12d/0x180 fs/ntfs/inode.c:190
 load_system_files fs/ntfs/super.c:1988 [inline]
 ntfs_fill_super+0x552c/0x89d2 fs/ntfs/super.c:2908
 mount_bdev+0x2fc/0x3b0 fs/super.c:1158
 mount_fs+0xa3/0x318 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:2469 [inline]
 do_mount+0x51c/0x2f10 fs/namespace.c:2799
 ksys_mount+0xcf/0x130 fs/namespace.c:3015
 __do_sys_mount fs/namespace.c:3029 [inline]
 __se_sys_mount fs/namespace.c:3026 [inline]
 __x64_sys_mount+0xba/0x150 fs/namespace.c:3026
 do_syscall_64+0xf9/0x670 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x44955a
Code: b8 08 00 00 00 0f 05 48 3d 01 f0 ff ff 0f 83 7d a3 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 0f 83 5a a3 fb ff c3 66 0f 1f 84 00 00 00 00 00
RSP: 002b:00007ffca5b3c378 EFLAGS: 00000287 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007ffca5b3c3d0 RCX: 000000000044955a
RDX: 0000000020000000 RSI: 0000000020000100 RDI: 00007ffca5b3c390
RBP: 00007ffca5b3c390 R08: 00007ffca5b3c3d0 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000287 R12: 00000000000000ab
R13: 0000000000000004 R14: 0000000000000003 R15: 0000000000000003

The buggy address belongs to the page:
page:ffffea00023593c0 count:1 mapcount:0 mapping:ffff8880a4214308 index:0x80d0
flags: 0xfffe000004003c(referenced|uptodate|dirty|lru|swapbacked)
raw: 00fffe000004003c ffffea00020f1448 ffffea00021d0708 ffff8880a4214308
raw: 00000000000080d0 0000000000000000 00000001ffffffff ffff88821b6e4b40
page dumped because: kasan: bad access detected
page->mem_cgroup:ffff88821b6e4b40

Memory state around the buggy address:
 ffff88808d64fd80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff88808d64fe00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff88808d64fe80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                                                          ^
 ffff88808d64ff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff88808d64ff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================

Crashes (1):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci2-linux-4-19 2020/10/11 09:27 linux-4.19.y a1b977b49b66 4a77ae0b .config log report syz C
* Struck through repros no longer work on HEAD.