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

6 views
Skip to first unread message

syzbot

unread,
Jun 22, 2021, 10:17:24 AM6/22/21
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: eb575cd5 Linux 4.19.195
git tree: linux-4.19.y
console output: https://syzkaller.appspot.com/x/log.txt?x=15316449d00000
kernel config: https://syzkaller.appspot.com/x/.config?x=5506475cccaff975
dashboard link: https://syzkaller.appspot.com/bug?extid=bbeaffed0e2a019f22af
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=135901b8300000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=153f31e8300000

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

==================================================================
BUG: KASAN: use-after-free in ntfs_is_extended_system_file fs/ntfs/inode.c:509 [inline]
BUG: KASAN: use-after-free in ntfs_read_locked_inode+0x5268/0x56f0 fs/ntfs/inode.c:1048
Read of size 8 at addr ffff88808cfc5db8 by task syz-executor175/8194

CPU: 1 PID: 8194 Comm: syz-executor175 Not tainted 4.19.195-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+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_is_extended_system_file fs/ntfs/inode.c:509 [inline]
ntfs_read_locked_inode+0x5268/0x56f0 fs/ntfs/inode.c:1048
ntfs_iget+0x12d/0x180 fs/ntfs/inode.c:190
load_and_init_upcase fs/ntfs/super.c:1669 [inline]
load_system_files fs/ntfs/super.c:1824 [inline]
ntfs_fill_super+0xcd3/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:2469 [inline]
do_mount+0x113c/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/0x620 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x44876a
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:00007ffcc012e498 EFLAGS: 00000286 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007ffcc012e4f0 RCX: 000000000044876a
RDX: 0000000020000000 RSI: 0000000020000100 RDI: 00007ffcc012e4b0
RBP: 00007ffcc012e4b0 R08: 00007ffcc012e4f0 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000286 R12: 0000000020001fa0
R13: 0000000000000003 R14: 0000000000000004 R15: 000000000000013c

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

Memory state around the buggy address:
ffff88808cfc5c80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff88808cfc5d00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff88808cfc5d80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff88808cfc5e00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff88808cfc5e80: 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

syzbot

unread,
Jul 22, 2021, 3:55:06 PM7/22/21
to syzkaller...@googlegroups.com
syzbot suspects this issue was fixed by commit:

commit 00f00f5db888e9f8dfaaa2e6b8d6cf5a6c28753b
Author: Desmond Cheong Zhi Xi <desmond...@gmail.com>
Date: Tue Jun 29 02:33:52 2021 +0000

ntfs: fix validity check for file name attribute

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=12851e46300000
start commit: eb575cd5d7f6 Linux 4.19.195
git tree: linux-4.19.y
If the result looks correct, please mark the issue as fixed by replying with:

#syz fix: ntfs: fix validity check for file name attribute

For information about bisection process see: https://goo.gl/tpsmEJ#bisection
Reply all
Reply to author
Forward
0 new messages