syzbot


KASAN: use-after-free Read in ntfs_are_names_equal

Status: upstream: reported C repro on 2020/09/29 06:04
Reported-by: syzbot+457dc47bd878ce9b2f2f@syzkaller.appspotmail.com
First crash: 792d, last: 278d

Fix bisection: failed (bisect log)
similar bugs (2):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.19 KASAN: use-after-free Read in ntfs_are_names_equal C error 1 436d 780d 0/1 upstream: reported C repro on 2020/10/11 09:28
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
Patch testing requests:
Created Duration User Patch Repo Result
2022/10/03 07:30 11m linux-4.14.y report log

Sample crash report:
ntfs: volume version 3.1.
ntfs: volume version 3.1.
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+0x143/0x150 fs/ntfs/unistr.c:75
Read of size 2 at addr ffff888080ff6ee8 by task syz-executor300/6360

CPU: 1 PID: 6360 Comm: syz-executor300 Not tainted 4.14.198-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x1b2/0x283 lib/dump_stack.c:58
 print_address_description.cold+0x54/0x1d3 mm/kasan/report.c:252
 kasan_report_error.cold+0x8a/0x194 mm/kasan/report.c:351
 kasan_report mm/kasan/report.c:409 [inline]
 __asan_report_load2_noabort+0x68/0x70 mm/kasan/report.c:428
 ntfs_ucsncmp fs/ntfs/unistr.c:156 [inline]
 ntfs_are_names_equal+0x143/0x150 fs/ntfs/unistr.c:75
 ntfs_attr_find+0x36f/0xa10 fs/ntfs/attrib.c:628
 ntfs_attr_lookup+0xeca/0x1f30 fs/ntfs/attrib.c:1203
 ntfs_read_locked_attr_inode fs/ntfs/inode.c:1266 [inline]
 ntfs_attr_iget+0x641/0x2180 fs/ntfs/inode.c:251
 ntfs_read_locked_inode+0x24a2/0x5000 fs/ntfs/inode.c:986
 ntfs_iget+0xfa/0x130 fs/ntfs/inode.c:190
 load_system_files fs/ntfs/super.c:1988 [inline]
 ntfs_fill_super+0x4caf/0x7170 fs/ntfs/super.c:2908
 mount_bdev+0x2b3/0x360 fs/super.c:1134
 mount_fs+0x92/0x2a0 fs/super.c:1237
 vfs_kern_mount.part.0+0x5b/0x470 fs/namespace.c:1046
 vfs_kern_mount fs/namespace.c:1036 [inline]
 do_new_mount fs/namespace.c:2549 [inline]
 do_mount+0xe53/0x2a00 fs/namespace.c:2879
 SYSC_mount fs/namespace.c:3095 [inline]
 SyS_mount+0xa8/0x120 fs/namespace.c:3072
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x46/0xbb
RIP: 0033:0x44955a
RSP: 002b:00007fff358d5f58 EFLAGS: 00000287 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007fff358d5fb0 RCX: 000000000044955a
RDX: 0000000020000000 RSI: 0000000020000100 RDI: 00007fff358d5f70
RBP: 00007fff358d5f70 R08: 00007fff358d5fb0 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000287 R12: 00000000000000ab
R13: 0000000000000004 R14: 0000000000000003 R15: 0000000000000003

The buggy address belongs to the page:
page:ffffea000203fd80 count:1 mapcount:0 mapping:ffff888094cfd848 index:0x7f7e
flags: 0xfffe000004003c(referenced|uptodate|dirty|lru|swapbacked)
raw: 00fffe000004003c ffff888094cfd848 0000000000007f7e 00000001ffffffff
raw: ffffea00020f74a0 ffffea00020e7720 0000000000000000 ffff8880aa3f6a40
page dumped because: kasan: bad access detected
page->mem_cgroup:ffff8880aa3f6a40

Memory state around the buggy address:
 ffff888080ff6d80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff888080ff6e00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff888080ff6e80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                                                          ^
 ffff888080ff6f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff888080ff6f80: 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-14 2020/09/29 06:03 linux-4.14.y cbfa1702aaf6 1b88c6d5 .config log report syz C
* Struck through repros no longer work on HEAD.