[ntfs?] KASAN: use-after-free Read in ntfs_lookup_inode_by_name

6 views
Skip to first unread message

syzbot

unread,
Jan 6, 2023, 10:24:43 PM1/6/23
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 3f8a27f9e27b Linux 4.19.211
git tree: linux-4.19.y
console output: https://syzkaller.appspot.com/x/log.txt?x=17d81426480000
kernel config: https://syzkaller.appspot.com/x/.config?x=9b9277b418617afe
dashboard link: https://syzkaller.appspot.com/bug?extid=67f827314d821a8dad9a
compiler: gcc version 10.2.1 20210110 (Debian 10.2.1-6)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1395a59a480000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1239d4d2480000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/98c0bdb4abb3/disk-3f8a27f9.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/ea228ff02669/vmlinux-3f8a27f9.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/9995aed81458/mount_0.gz

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

ntfs: (device loop0): load_system_files(): $MFTMirr does not match $MFT. Mounting read-only. Run ntfsfix and/or chkdsk.
ntfs: volume version 3.1.
==================================================================
BUG: KASAN: use-after-free in sle64_to_cpup fs/ntfs/endian.h:60 [inline]
BUG: KASAN: use-after-free in ntfs_lookup_inode_by_name+0x36c0/0x3bd0 fs/ntfs/dir.c:305
Read of size 8 at addr ffff88808bb47b80 by task syz-executor549/8104

CPU: 0 PID: 8104 Comm: syz-executor549 Not tainted 4.19.211-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
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_load8_noabort+0x88/0x90 mm/kasan/report.c:433
sle64_to_cpup fs/ntfs/endian.h:60 [inline]
ntfs_lookup_inode_by_name+0x36c0/0x3bd0 fs/ntfs/dir.c:305
check_windows_hibernation_status+0xd9/0xb10 fs/ntfs/super.c:1288
load_system_files fs/ntfs/super.c:2003 [inline]
ntfs_fill_super+0x58be/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:0x7f9bd63bed2a
Code: 48 c7 c2 c0 ff ff ff f7 d8 64 89 02 b8 ff ff ff ff eb d2 e8 a8 00 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:00007ffca25ef3f8 EFLAGS: 00000286 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 000055555651b2c0 RCX: 00007f9bd63bed2a
RDX: 0000000020000000 RSI: 000000002001ee80 RDI: 00007ffca25ef440
RBP: 0000000000000000 R08: 00007ffca25ef480 R09: 0000000000000000
R10: 0000000000004010 R11: 0000000000000286 R12: 0000000000000004
R13: 00007ffca25ef480 R14: 0000000000000003 R15: 00007ffca25ef440

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

Memory state around the buggy address:
ffff88808bb47a80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff88808bb47b00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff88808bb47b80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff88808bb47c00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff88808bb47c80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================


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