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

6 views
Skip to first unread message

syzbot

unread,
Apr 14, 2019, 4:51:29 AM4/14/19
to syzkaller-a...@googlegroups.com
Hello,

syzbot found the following crash on:

HEAD commit: 9dc978d4 ANDROID: AVB error handler to invalidate vbmeta p..
git tree: android-4.9
console output: https://syzkaller.appspot.com/x/log.txt?x=167a2028400000
kernel config: https://syzkaller.appspot.com/x/.config?x=153989988cab1d8e
dashboard link: https://syzkaller.appspot.com/bug?extid=a8301a34c4e4b180ae62
compiler: gcc (GCC) 8.0.1 20180413 (experimental)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=16fd52d2400000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=12ba9202400000

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

random: sshd: uninitialized urandom read (32 bytes read)
random: sshd: uninitialized urandom read (32 bytes read)
random: sshd: uninitialized urandom read (32 bytes read)
random: sshd: uninitialized urandom read (32 bytes read)
==================================================================
BUG: KASAN: slab-out-of-bounds in _autofs_dev_ioctl+0x687/0x690
fs/autofs4/dev-ioctl.c:681
Read of size 4 at addr ffff8801b78a8948 by task syz-executor567/3799

CPU: 0 PID: 3799 Comm: syz-executor567 Not tainted 4.9.119-g9dc978d #23
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
ffff8801b6d5fba0 ffffffff81eb4be9 ffffea0006de2a00 ffff8801b78a8948
0000000000000000 ffff8801b78a8948 ffff8801b78a8948 ffff8801b6d5fbd8
ffffffff81567f89 ffff8801b78a8948 0000000000000004 0000000000000000
Call Trace:
[<ffffffff81eb4be9>] __dump_stack lib/dump_stack.c:15 [inline]
[<ffffffff81eb4be9>] dump_stack+0xc1/0x128 lib/dump_stack.c:51
[<ffffffff81567f89>] print_address_description+0x6c/0x234
mm/kasan/report.c:256
[<ffffffff81568393>] kasan_report_error mm/kasan/report.c:355 [inline]
[<ffffffff81568393>] kasan_report.cold.6+0x242/0x2fe mm/kasan/report.c:412
[<ffffffff8153bef4>] __asan_report_load4_noabort+0x14/0x20
mm/kasan/report.c:432
[<ffffffff81905967>] _autofs_dev_ioctl+0x687/0x690
fs/autofs4/dev-ioctl.c:681
[<ffffffff8190598b>] autofs_dev_ioctl+0x1b/0x30 fs/autofs4/dev-ioctl.c:714
[<ffffffff815b309c>] vfs_ioctl fs/ioctl.c:43 [inline]
[<ffffffff815b309c>] file_ioctl fs/ioctl.c:493 [inline]
[<ffffffff815b309c>] do_vfs_ioctl+0x1ac/0x11a0 fs/ioctl.c:677
[<ffffffff815b411f>] SYSC_ioctl fs/ioctl.c:694 [inline]
[<ffffffff815b411f>] SyS_ioctl+0x8f/0xc0 fs/ioctl.c:685
[<ffffffff81006316>] do_syscall_64+0x1a6/0x490 arch/x86/entry/common.c:282
[<ffffffff839fccd3>] entry_SYSCALL_64_after_swapgs+0x5d/0xdb

Allocated by task 3799:
save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:57
save_stack+0x43/0xd0 mm/kasan/kasan.c:505
set_track mm/kasan/kasan.c:517 [inline]
kasan_kmalloc+0xc7/0xe0 mm/kasan/kasan.c:609
kmem_cache_alloc_trace+0xfd/0x2b0 mm/slub.c:2742
kmalloc include/linux/slab.h:490 [inline]
kzalloc include/linux/slab.h:636 [inline]
ramfs_fill_super+0xcc/0x490 fs/ramfs/inode.c:216
mount_nodev+0x5b/0x100 fs/super.c:1146
ramfs_mount+0x2c/0x40 fs/ramfs/inode.c:243
mount_fs+0x28c/0x370 fs/super.c:1206
vfs_kern_mount.part.29+0xd1/0x3d0 fs/namespace.c:991
vfs_kern_mount fs/namespace.c:973 [inline]
do_new_mount fs/namespace.c:2513 [inline]
do_mount+0x3c9/0x2740 fs/namespace.c:2835
SYSC_mount fs/namespace.c:3051 [inline]
SyS_mount+0xfe/0x110 fs/namespace.c:3028
do_syscall_64+0x1a6/0x490 arch/x86/entry/common.c:282
entry_SYSCALL_64_after_swapgs+0x5d/0xdb

Freed by task 0:
(stack is not available)

The buggy address belongs to the object at ffff8801b78a8948
which belongs to the cache kmalloc-8 of size 8
The buggy address is located 0 bytes inside of
8-byte region [ffff8801b78a8948, ffff8801b78a8950)
The buggy address belongs to the page:
page:ffffea0006de2a00 count:1 mapcount:0 mapping: (null)
index:0xffff8801b78a82a0
flags: 0x8000000000000080(slab)
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff8801b78a8800: fc fc fb fc fc fb fc fc fb fc fc fb fc fc fb fc
ffff8801b78a8880: fc fb fc fc fb fc fc fb fc fc fb fc fc fb fc fc
> ffff8801b78a8900: 00 fc fc 00 fc fc 00 fc fc 02 fc fc fc fc fc fc
^
ffff8801b78a8980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff8801b78a8a00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================


---
This bug 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 bug report. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
syzbot can test patches for this bug, for details see:
https://goo.gl/tpsmEJ#testing-patches
Reply all
Reply to author
Forward
0 new messages