KASAN: out-of-bounds Read in ext4_xattr_set_entry

9 views
Skip to first unread message

syzbot

unread,
Apr 12, 2021, 10:20:23 AM4/12/21
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 958e517f Linux 4.14.230
git tree: linux-4.14.y
console output: https://syzkaller.appspot.com/x/log.txt?x=11ea3891d00000
kernel config: https://syzkaller.appspot.com/x/.config?x=cdbb0f19434a286f
dashboard link: https://syzkaller.appspot.com/bug?extid=97177fd4bf74cef7673e
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=12be2d6ed00000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=12e8c77ed00000

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

EXT4-fs (loop0): mounted filesystem without journal. Opts: ,errors=continue
EXT4-fs error (device loop0): ext4_mb_generate_buddy:754: group 0, block bitmap and bg descriptor inconsistent: 50 vs 25 free clusters
==================================================================
BUG: KASAN: out-of-bounds in memmove include/linux/string.h:391 [inline]
BUG: KASAN: out-of-bounds in ext4_xattr_set_entry+0x1787/0x3180 fs/ext4/xattr.c:1732
Read of size 18446744073709551600 at addr ffff88809aa150d4 by task syz-executor500/7976

CPU: 1 PID: 7976 Comm: syz-executor500 Not tainted 4.14.230-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/0x281 lib/dump_stack.c:58
print_address_description.cold+0x54/0x1d3 mm/kasan/report.c:252
kasan_report_error.cold+0x8a/0x191 mm/kasan/report.c:351
kasan_report+0x6f/0x80 mm/kasan/report.c:409
memmove+0x20/0x50 mm/kasan/kasan.c:293
memmove include/linux/string.h:391 [inline]
ext4_xattr_set_entry+0x1787/0x3180 fs/ext4/xattr.c:1732
ext4_xattr_ibody_inline_set+0x73/0x280 fs/ext4/xattr.c:2221
ext4_destroy_inline_data_nolock+0x1cb/0x440 fs/ext4/inline.c:440
ext4_convert_inline_data_nolock+0x115/0xb40 fs/ext4/inline.c:1213
ext4_convert_inline_data+0x2ae/0x300 fs/ext4/inline.c:2001
ext4_fallocate+0x106/0x1d80 fs/ext4/extents.c:4964
vfs_fallocate+0x346/0x790 fs/open.c:319
SYSC_fallocate fs/open.c:342 [inline]
SyS_fallocate+0x4a/0x80 fs/open.c:336
do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x46/0xbb
RIP: 0033:0x449d49
RSP: 002b:00007f01896c72f8 EFLAGS: 00000246 ORIG_RAX: 000000000000011d
RAX: ffffffffffffffda RBX: 00000000004cc4d0 RCX: 0000000000449d49
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000007
RBP: 000000000049c064 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000010000101 R11: 0000000000000246 R12: 000000000049b060
R13: 0030656c69662f2e R14: e5d26e84aa4cf3c6 R15: 00000000004cc4d8

The buggy address belongs to the page:
page:ffffea00026a8540 count:2 mapcount:0 mapping:ffff8880b1d7ea68 index:0x8
flags: 0xfff0000001107c(referenced|uptodate|dirty|lru|active|private|mappedtodisk)
raw: 00fff0000001107c ffff8880b1d7ea68 0000000000000008 00000002ffffffff
raw: ffffea00026af960 ffffea00027724a0 ffff888090694000 ffff88823b320880
page dumped because: kasan: bad access detected
page->mem_cgroup:ffff88823b320880

Memory state around the buggy address:
ffff88809aa14f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88809aa15000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff88809aa15080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
^
ffff88809aa15100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff88809aa15180: 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