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

5 views
Skip to first unread message

syzbot

unread,
Apr 11, 2019, 8:01:02 PM4/11/19
to syzkaller-a...@googlegroups.com
Hello,

syzbot found the following crash on:

HEAD commit: ff9973a5 ANDROID: arm64: kbuild: only specify code model w..
git tree: android-4.14
console output: https://syzkaller.appspot.com/x/log.txt?x=1228ca3a400000
kernel config: https://syzkaller.appspot.com/x/.config?x=9b3b342f97278cde
dashboard link: https://syzkaller.appspot.com/bug?extid=cf4ff5c6bd791f6563e0
compiler: gcc (GCC) 8.0.1 20180413 (experimental)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=10adf1c9400000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=10d0e891400000

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

random: sshd: uninitialized urandom read (32 bytes read)
audit: type=1400 audit(1538537154.149:7): avc: denied { map } for
pid=1794 comm="syz-executor525" path="/root/syz-executor525565252"
dev="sda1" ino=16481 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023
tcontext=unconfined_u:object_r:user_home_t:s0 tclass=file permissive=1
audit: type=1400 audit(1538537154.169:8): avc: denied { prog_load } for
pid=1794 comm="syz-executor525"
scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023
tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=bpf
permissive=1
audit: type=1400 audit(1538537154.199:9): avc: denied { prog_run } for
pid=1794 comm="syz-executor525"
scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023
tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=bpf
permissive=1
==================================================================
BUG: KASAN: slab-out-of-bounds in skb_at_tc_ingress
include/net/sch_generic.h:452 [inline]
BUG: KASAN: slab-out-of-bounds in bpf_push_mac_rcsum net/core/filter.c:1422
[inline]
BUG: KASAN: slab-out-of-bounds in ____bpf_skb_vlan_push
net/core/filter.c:1969 [inline]
BUG: KASAN: slab-out-of-bounds in bpf_skb_vlan_push+0x45e/0x540
net/core/filter.c:1960
Read of size 4 at addr ffff8801d0ef0c48 by task syz-executor525/1794

CPU: 1 PID: 1794 Comm: syz-executor525 Not tainted 4.14.73+ #14
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
skb_at_tc_ingress include/net/sch_generic.h:452 [inline]
bpf_push_mac_rcsum net/core/filter.c:1422 [inline]
____bpf_skb_vlan_push net/core/filter.c:1969 [inline]
bpf_skb_vlan_push+0x45e/0x540 net/core/filter.c:1960
___bpf_prog_run+0x248e/0x5c70 kernel/bpf/core.c:1012

Allocated by task 230:
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]
kmem_cache_alloc+0xe4/0x2b0 mm/slub.c:2736
kmem_cache_alloc_node include/linux/slab.h:361 [inline]
__alloc_skb+0xd8/0x550 net/core/skbuff.c:193
alloc_skb include/linux/skbuff.h:980 [inline]
alloc_skb_with_frags+0xab/0x500 net/core/skbuff.c:5167
sock_alloc_send_pskb+0x55e/0x6e0 net/core/sock.c:2075
unix_dgram_sendmsg+0x37b/0xf50 net/unix/af_unix.c:1681
sock_sendmsg_nosec net/socket.c:645 [inline]
sock_sendmsg+0xb5/0x100 net/socket.c:655
SYSC_sendto net/socket.c:1762 [inline]
SyS_sendto+0x211/0x340 net/socket.c:1730
do_syscall_64+0x19b/0x4b0 arch/x86/entry/common.c:289
entry_SYSCALL_64_after_hwframe+0x42/0xb7

Freed by task 191:
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]
kmem_cache_free+0x12d/0x350 mm/slub.c:2988
kfree_skbmem+0x9e/0x100 net/core/skbuff.c:582
__kfree_skb net/core/skbuff.c:642 [inline]
consume_skb+0xc9/0x330 net/core/skbuff.c:701
skb_free_datagram+0x15/0xd0 net/core/datagram.c:331
unix_dgram_recvmsg+0x762/0xd20 net/unix/af_unix.c:2183
sock_recvmsg_nosec net/socket.c:818 [inline]
sock_recvmsg+0xc0/0x100 net/socket.c:825
SYSC_recvfrom net/socket.c:1814 [inline]
SyS_recvfrom+0x1d2/0x310 net/socket.c:1786
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 ffff8801d0ef0b40
which belongs to the cache skbuff_head_cache of size 224
The buggy address is located 40 bytes to the right of
224-byte region [ffff8801d0ef0b40, ffff8801d0ef0c20)
The buggy address belongs to the page:
page:ffffea000743bc00 count:1 mapcount:0 mapping: (null) index:0x0
flags: 0x4000000000000100(slab)
raw: 4000000000000100 0000000000000000 0000000000000000 00000001800c000c
raw: 0000000000000000 0000000100000001 ffff8801dab70200 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff8801d0ef0b00: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb
ffff8801d0ef0b80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
> ffff8801d0ef0c00: fb fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc
^
ffff8801d0ef0c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8801d0ef0d00: fb fb fb fb fb fb fb fb fb fb fb fb 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