KASAN: use-after-free Read in ntfs_collate_names

5 views
Skip to first unread message

syzbot

unread,
Feb 26, 2023, 5:39:51 AM2/26/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=1065d902c80000
kernel config: https://syzkaller.appspot.com/x/.config?x=9b9277b418617afe
dashboard link: https://syzkaller.appspot.com/bug?extid=028a20987560ec9a96dd
compiler: gcc version 10.2.1 20210110 (Debian 10.2.1-6)

Unfortunately, I don't have any reproducer for this issue yet.

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

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

xt_TCPMSS: path-MTU clamping only supported in FORWARD, OUTPUT and POSTROUTING hooks
ntfs: volume version 3.1.
==================================================================
BUG: KASAN: use-after-free in ntfs_collate_names+0x329/0x380 fs/ntfs/unistr.c:110
Read of size 2 at addr ffff888059d8a92f by task syz-executor.4/16680

CPU: 1 PID: 16680 Comm: syz-executor.4 Not tainted 4.19.211-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/16/2023
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_load2_noabort+0x88/0x90 mm/kasan/report.c:431
ntfs_collate_names+0x329/0x380 fs/ntfs/unistr.c:110
ntfs_attr_find+0x7e5/0xb10 fs/ntfs/attrib.c:633
ntfs_attr_lookup+0x1020/0x1f90 fs/ntfs/attrib.c:1203
ntfs_read_locked_inode+0x1cbf/0x56e0 fs/ntfs/inode.c:793
ntfs_iget+0x12d/0x180 fs/ntfs/inode.c:190
load_system_files fs/ntfs/super.c:1988 [inline]
ntfs_fill_super+0x5851/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:0x7fb4dbb4062a
Code: 48 c7 c2 b8 ff ff ff f7 d8 64 89 02 b8 ff ff ff ff eb d2 e8 b8 04 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fb4da08ff88 EFLAGS: 00000206 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 000000000001ee60 RCX: 00007fb4dbb4062a
RDX: 0000000020000040 RSI: 000000002001ee80 RDI: 00007fb4da08ffe0
RBP: 00007fb4da090020 R08: 00007fb4da090020 R09: 0000000000a00c9a
R10: 0000000000a00c9a R11: 0000000000000206 R12: 0000000020000040
R13: 000000002001ee80 R14: 00007fb4da08ffe0 R15: 0000000020000080

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

Memory state around the buggy address:
ffff888059d8a800: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff888059d8a880: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff888059d8a900: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff888059d8a980: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff888059d8aa00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================
XFS (loop5): Mounting V4 Filesystem
XFS (loop5): Ending clean mount
XFS (loop5): Quotacheck needed: Please wait.
XFS (loop5): Quotacheck: Done.


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

unread,
Feb 26, 2023, 5:58:47 AM2/26/23
to syzkaller...@googlegroups.com
syzbot has found a reproducer for 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=158099a8c80000
kernel config: https://syzkaller.appspot.com/x/.config?x=9b9277b418617afe
dashboard link: https://syzkaller.appspot.com/bug?extid=028a20987560ec9a96dd
compiler: gcc version 10.2.1 20210110 (Debian 10.2.1-6)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=17426960c80000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=141adbf0c80000
mounted in repro: https://storage.googleapis.com/syzbot-assets/6162cc663424/mount_0.gz

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

IPv6: ADDRCONF(NETDEV_CHANGE): macvtap0: link becomes ready
batman_adv: batadv0: Interface activated: batadv_slave_1
IPv6: ADDRCONF(NETDEV_CHANGE): veth1_to_batadv: link becomes ready
ntfs: volume version 3.1.
==================================================================
BUG: KASAN: use-after-free in ntfs_collate_names+0x329/0x380 fs/ntfs/unistr.c:110
Read of size 2 at addr ffff888090a7c92f by task syz-executor120/8112

CPU: 0 PID: 8112 Comm: syz-executor120 Not tainted 4.19.211-syzkaller #0
RIP: 0033:0x7f434928c49a
Code: 48 c7 c2 b8 ff ff ff f7 d8 64 89 02 b8 ff ff ff ff eb d2 e8 08 01 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffe11c0ae68 EFLAGS: 00000286 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007f434928c49a
RDX: 0000000020000040 RSI: 000000002001ee80 RDI: 00007ffe11c0ae80
RBP: 00007ffe11c0ae80 R08: 00007ffe11c0aec0 R09: 000000000001ee5a
R10: 0000000000a00c9a R11: 0000000000000286 R12: 0000000000000004
R13: 00005555559e12b8 R14: 0000000000a00c9a R15: 00007ffe11c0aec0

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

Memory state around the buggy address:
ffff888090a7c800: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff888090a7c880: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff888090a7c900: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff888090a7c980: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff888090a7ca00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================

Reply all
Reply to author
Forward
0 new messages