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

7 views
Skip to first unread message

syzbot

unread,
Apr 10, 2019, 8:00:23 PM4/10/19
to syzkaller-a...@googlegroups.com
Hello,

syzbot found the following crash on:

HEAD commit: 47350a9f ANDROID: x86_64_cuttlefish_defconfig: Enable lz4 ..
git tree: android-4.14
console output: https://syzkaller.appspot.com/x/log.txt?x=1129b696400000
kernel config: https://syzkaller.appspot.com/x/.config?x=10d236078f3378a3
dashboard link: https://syzkaller.appspot.com/bug?extid=18756312f2d82f808f44
compiler: gcc (GCC) 8.0.1 20180413 (experimental)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=12a60151400000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=13d58ab6400000

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

==================================================================
BUG: KASAN: slab-out-of-bounds in _decode_session6+0x124c/0x1370
net/ipv6/xfrm6_policy.c:159
Read of size 1 at addr ffff8801c25f7d87 by task syz-executor314/1914

CPU: 0 PID: 1914 Comm: syz-executor314 Not tainted 4.14.67+ #1
Call Trace:
__dump_stack lib/dump_stack.c:17 [inline]
dump_stack+0xb9/0x11b lib/dump_stack.c:53
print_address_description+0x60/0x22b mm/kasan/report.c:252
kasan_report_error mm/kasan/report.c:351 [inline]
kasan_report.cold.6+0x11b/0x2dd mm/kasan/report.c:409
_decode_session6+0x124c/0x1370 net/ipv6/xfrm6_policy.c:159
__xfrm_decode_session+0x64/0x100 net/xfrm/xfrm_policy.c:2366
xfrm_decode_session include/net/xfrm.h:1175 [inline]
vti6_tnl_xmit+0x31b/0x1550 net/ipv6/ip6_vti.c:549
__netdev_start_xmit include/linux/netdevice.h:4023 [inline]
netdev_start_xmit include/linux/netdevice.h:4032 [inline]
xmit_one net/core/dev.c:2987 [inline]
dev_hard_start_xmit+0x191/0x890 net/core/dev.c:3003
__dev_queue_xmit+0x13d9/0x1f40 net/core/dev.c:3503
__bpf_tx_skb net/core/filter.c:1708 [inline]
__bpf_redirect_common net/core/filter.c:1746 [inline]
__bpf_redirect+0x5b0/0x990 net/core/filter.c:1753
____bpf_clone_redirect net/core/filter.c:1786 [inline]
bpf_clone_redirect+0x1d4/0x2b0 net/core/filter.c:1758
___bpf_prog_run+0x248e/0x5c70 kernel/bpf/core.c:1012

Allocated by task 1914:
save_stack mm/kasan/kasan.c:447 [inline]
set_track mm/kasan/kasan.c:459 [inline]
kasan_kmalloc.part.1+0x4f/0xd0 mm/kasan/kasan.c:551
slab_post_alloc_hook mm/slab.h:442 [inline]
slab_alloc_node mm/slub.c:2723 [inline]
slab_alloc mm/slub.c:2731 [inline]
__kmalloc_track_caller+0x104/0x300 mm/slub.c:4288
__kmalloc_reserve.isra.8+0x2f/0xc0 net/core/skbuff.c:137
pskb_expand_head+0x117/0xb30 net/core/skbuff.c:1461
skb_ensure_writable+0x237/0x2e0 net/core/skbuff.c:5007
__bpf_try_make_writable net/core/filter.c:1403 [inline]
bpf_try_make_writable net/core/filter.c:1409 [inline]
bpf_try_make_head_writable net/core/filter.c:1417 [inline]
____bpf_clone_redirect net/core/filter.c:1780 [inline]
bpf_clone_redirect+0x119/0x2b0 net/core/filter.c:1758
___bpf_prog_run+0x248e/0x5c70 kernel/bpf/core.c:1012

Freed by task 616:
save_stack mm/kasan/kasan.c:447 [inline]
set_track mm/kasan/kasan.c:459 [inline]
kasan_slab_free+0xac/0x190 mm/kasan/kasan.c:524
slab_free_hook mm/slub.c:1389 [inline]
slab_free_freelist_hook mm/slub.c:1410 [inline]
slab_free mm/slub.c:2966 [inline]
kfree+0xf5/0x310 mm/slub.c:3897
load_elf_binary+0x1c56/0x4530 fs/binfmt_elf.c:1097
search_binary_handler+0x13f/0x6c0 fs/exec.c:1638
exec_binprm fs/exec.c:1680 [inline]
do_execveat_common.isra.14+0x1109/0x1d60 fs/exec.c:1802
do_execve fs/exec.c:1847 [inline]
SYSC_execve fs/exec.c:1928 [inline]
SyS_execve+0x34/0x40 fs/exec.c:1923
do_syscall_64+0x19b/0x4b0 arch/x86/entry/common.c:289
entry_SYSCALL_64_after_hwframe+0x42/0xb7

The buggy address belongs to the object at ffff8801c25f7b80
which belongs to the cache kmalloc-512 of size 512
The buggy address is located 7 bytes to the right of
512-byte region [ffff8801c25f7b80, ffff8801c25f7d80)
The buggy address belongs to the page:
page:ffffea0007097d80 count:1 mapcount:0 mapping: (null) index:0x0
compound_mapcount: 0
flags: 0x4000000000008100(slab|head)
raw: 4000000000008100 0000000000000000 0000000000000000 00000001800c000c
raw: ffffea0007095000 0000000900000009 ffff8801da802c00 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff8801c25f7c80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff8801c25f7d00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> ffff8801c25f7d80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
^
ffff8801c25f7e00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff8801c25f7e80: 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