KASAN: slab-out-of-bounds Read in build_segment_manager

6 views
Skip to first unread message

syzbot

unread,
Oct 5, 2020, 4:04:41 AM10/5/20
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: cbfa1702 Linux 4.14.198
git tree: linux-4.14.y
console output: https://syzkaller.appspot.com/x/log.txt?x=1404723f900000
kernel config: https://syzkaller.appspot.com/x/.config?x=3990958d85b55e59
dashboard link: https://syzkaller.appspot.com/bug?extid=9dbc2a111dea6d6ddde3
compiler: gcc (GCC) 10.1.0-syz 20200507
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=118b6b50500000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1176c7a3900000

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

F2FS-fs (loop0): Magic Mismatch, valid(0xf2f52010) - read(0x0)
F2FS-fs (loop0): Can't find valid F2FS filesystem in 1th superblock
F2FS-fs (loop0): Fix alignment : done, start(4096) end(147456) block(12288)
F2FS-fs (loop0): invalid crc value
==================================================================
BUG: KASAN: slab-out-of-bounds in init_min_max_mtime fs/f2fs/segment.c:3497 [inline]
BUG: KASAN: slab-out-of-bounds in build_segment_manager+0x6464/0x7f40 fs/f2fs/segment.c:3577
Read of size 8 at addr ffff88809773b728 by task syz-executor579/6353

CPU: 0 PID: 6353 Comm: syz-executor579 Not tainted 4.14.198-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/0x283 lib/dump_stack.c:58
print_address_description.cold+0x54/0x1d3 mm/kasan/report.c:252
kasan_report_error.cold+0x8a/0x194 mm/kasan/report.c:351
kasan_report mm/kasan/report.c:409 [inline]
__asan_report_load8_noabort+0x68/0x70 mm/kasan/report.c:430
init_min_max_mtime fs/f2fs/segment.c:3497 [inline]
build_segment_manager+0x6464/0x7f40 fs/f2fs/segment.c:3577
f2fs_fill_super+0x2e21/0x56a0 fs/f2fs/super.c:2581
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:2549 [inline]
do_mount+0xe53/0x2a00 fs/namespace.c:2879
SYSC_mount fs/namespace.c:3095 [inline]
SyS_mount+0xa8/0x120 fs/namespace.c:3072
do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x46/0xbb
RIP: 0033:0x446ffa
RSP: 002b:00007ffc64fb47a8 EFLAGS: 00000297 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007ffc64fb4800 RCX: 0000000000446ffa
RDX: 0000000020000000 RSI: 0000000020000100 RDI: 00007ffc64fb47c0
RBP: 00007ffc64fb47c0 R08: 00007ffc64fb4800 R09: 00007ffc00000015
R10: 0000000000000000 R11: 0000000000000297 R12: 0000000000000008
R13: 0000000000000004 R14: 0000000000000003 R15: 0000000000000003

Allocated by task 6353:
save_stack mm/kasan/kasan.c:447 [inline]
set_track mm/kasan/kasan.c:459 [inline]
kasan_kmalloc+0xeb/0x160 mm/kasan/kasan.c:551
__do_kmalloc_node mm/slab.c:3682 [inline]
__kmalloc_node+0x4c/0x70 mm/slab.c:3689
kmalloc_node include/linux/slab.h:530 [inline]
kvmalloc_node+0x46/0xd0 mm/util.c:397
kvmalloc include/linux/mm.h:531 [inline]
kvzalloc include/linux/mm.h:539 [inline]
build_sit_info fs/f2fs/segment.c:3108 [inline]
build_segment_manager+0x935/0x7f40 fs/f2fs/segment.c:3553
f2fs_fill_super+0x2e21/0x56a0 fs/f2fs/super.c:2581
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:2549 [inline]
do_mount+0xe53/0x2a00 fs/namespace.c:2879
SYSC_mount fs/namespace.c:3095 [inline]
SyS_mount+0xa8/0x120 fs/namespace.c:3072
do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x46/0xbb

Freed by task 0:
(stack is not available)

The buggy address belongs to the object at ffff88809773b280
which belongs to the cache kmalloc-2048 of size 2048
The buggy address is located 1192 bytes inside of
2048-byte region [ffff88809773b280, ffff88809773ba80)
The buggy address belongs to the page:
page:ffffea00025dce80 count:1 mapcount:0 mapping:ffff88809773a180 index:0x0 compound_mapcount: 0
flags: 0xfffe0000008100(slab|head)
raw: 00fffe0000008100 ffff88809773a180 0000000000000000 0000000100000003
raw: ffffea00025dc320 ffff88812fe51948 ffff88812fe50c40 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff88809773b600: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff88809773b680: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff88809773b700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
^
ffff88809773b780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88809773b800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================


---
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,
Oct 5, 2020, 4:06:17 AM10/5/20
to syzkaller...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages