KASAN: use-after-free Read in ntfs_are_names_equal

7 views
Skip to first unread message

syzbot

unread,
Sep 29, 2020, 2:04:13 AM9/29/20
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: cbfa1702 Linux 4.14.198
git tree: linux-4.14.y
console output: https://syzkaller.appspot.com/x/log.txt?x=1796685b900000
kernel config: https://syzkaller.appspot.com/x/.config?x=3990958d85b55e59
dashboard link: https://syzkaller.appspot.com/bug?extid=457dc47bd878ce9b2f2f
compiler: gcc (GCC) 10.1.0-syz 20200507
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=128fbb3d900000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1512ea37900000

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+457dc4...@syzkaller.appspotmail.com

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
==================================================================


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
syzbot can test patches for this issue, for details see:
https://goo.gl/tpsmEJ#testing-patches
Reply all
Reply to author
Forward
0 new messages