[reiserfs?] KASAN: use-after-free Read in reiserfs_find_entry

4 views
Skip to first unread message

syzbot

unread,
Feb 15, 2023, 10:16:54 PM2/15/23
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: a8ad60f2af58 Linux 4.14.305
git tree: linux-4.14.y
console output: https://syzkaller.appspot.com/x/log.txt?x=16af275f480000
kernel config: https://syzkaller.appspot.com/x/.config?x=2f23dc9802022031
dashboard link: https://syzkaller.appspot.com/bug?extid=0de9a97f56ec4f3cfc58
compiler: gcc version 10.2.1 20210110 (Debian 10.2.1-6)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1031d28b480000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=15c3c427480000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/c38348fd389d/disk-a8ad60f2.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/3a775d221689/vmlinux-a8ad60f2.xz
kernel image: https://storage.googleapis.com/syzbot-assets/32e71e04d2b4/bzImage-a8ad60f2.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/d8778db5c47a/mount_0.gz

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

reiserfs: using flush barriers
REISERFS (device loop0): journal params: device loop0, size 512, journal first block 18, max trans len 256, max batch 225, max commit age 30, max trans age 30
REISERFS (device loop0): checking transaction log (loop0)
REISERFS (device loop0): Using r5 hash to sort names
==================================================================
BUG: KASAN: use-after-free in strlen+0x79/0x90 lib/string.c:539
Read of size 1 at addr ffff88808e4460c4 by task syz-executor347/7973

CPU: 0 PID: 7973 Comm: syz-executor347 Not tainted 4.14.305-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/21/2023
Call Trace:
__dump_stack lib/dump_stack.c:17 [inline]
dump_stack+0x1b2/0x281 lib/dump_stack.c:58
print_address_description.cold+0x54/0x1d3 mm/kasan/report.c:251
kasan_report_error.cold+0x8a/0x191 mm/kasan/report.c:350
kasan_report mm/kasan/report.c:408 [inline]
__asan_report_load1_noabort+0x68/0x70 mm/kasan/report.c:426
strlen+0x79/0x90 lib/string.c:539
strlen include/linux/string.h:298 [inline]
set_de_name_and_namelen fs/reiserfs/namei.c:82 [inline]
linear_search_in_dir_item fs/reiserfs/namei.c:261 [inline]
reiserfs_find_entry.part.0+0x4ae/0x11e0 fs/reiserfs/namei.c:330
reiserfs_find_entry fs/reiserfs/namei.c:367 [inline]
reiserfs_lookup+0x1fd/0x400 fs/reiserfs/namei.c:367
lookup_real fs/namei.c:1555 [inline]
__lookup_hash fs/namei.c:1575 [inline]
__lookup_hash+0x1bb/0x270 fs/namei.c:1563
lookup_one_len+0x279/0x3a0 fs/namei.c:2539
reiserfs_lookup_privroot+0x92/0x270 fs/reiserfs/xattr.c:970
reiserfs_fill_super+0x1772/0x2990 fs/reiserfs/super.c:2199
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:2572 [inline]
do_mount+0xe65/0x2a30 fs/namespace.c:2905
SYSC_mount fs/namespace.c:3121 [inline]
SyS_mount+0xa8/0x120 fs/namespace.c:3098
do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x5e/0xd3
RIP: 0033:0x7f6d5c9c9d2a
RSP: 002b:00007ffce29fd7f8 EFLAGS: 00000286 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00005555563062c0 RCX: 00007f6d5c9c9d2a
RDX: 00000000200000c0 RSI: 0000000020000040 RDI: 00007ffce29fd840
RBP: 0000000000000000 R08: 00007ffce29fd880 R09: 0000000000000030
R10: 0000000000008001 R11: 0000000000000286 R12: 0000000000000004
R13: 00007ffce29fd880 R14: 0000000000000003 R15: 00007ffce29fd840

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

Memory state around the buggy address:
ffff88808e445f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff88808e446000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff88808e446080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff88808e446100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff88808e446180: 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