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

8 views
Skip to first unread message

syzbot

unread,
Aug 10, 2019, 3:09:06 PM8/10/19
Hello,

syzbot found the following crash on:

HEAD commit: 3ffe1e79 Linux 4.14.138
git tree: linux-4.14.y
console output: https://syzkaller.appspot.com/x/log.txt?x=13836402600000
kernel config: https://syzkaller.appspot.com/x/.config?x=978e269523a888e8
dashboard link: https://syzkaller.appspot.com/bug?extid=75bc540c9480645ad6f1
compiler: gcc (GCC) 9.0.0 20181231 (experimental)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1666f18c600000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=173bf2ee600000

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: [email protected]

random: sshd: uninitialized urandom read (32 bytes read)
random: sshd: uninitialized urandom read (32 bytes read)
random: sshd: uninitialized urandom read (32 bytes read)
audit: type=1400 audit(1565435127.224:36): avc: denied { map } for
pid=7021 comm="syz-executor517" path="/root/syz-executor517345867"
dev="sda1" ino=16483 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023
tcontext=unconfined_u:object_r:user_home_t:s0 tclass=file permissive=1
==================================================================
BUG: KASAN: slab-out-of-bounds in ____bpf_skb_change_tail
net/core/filter.c:2371 [inline]
BUG: KASAN: slab-out-of-bounds in bpf_skb_change_tail+0xa7f/0xba0
net/core/filter.c:2368
Read of size 8 at addr ffff88809a6cd390 by task syz-executor517/7021

CPU: 0 PID: 7021 Comm: syz-executor517 Not tainted 4.14.138 #34
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+0x138/0x19c lib/dump_stack.c:53
print_address_description.cold+0x7c/0x1dc mm/kasan/report.c:252
kasan_report_error mm/kasan/report.c:351 [inline]
kasan_report mm/kasan/report.c:409 [inline]
kasan_report.cold+0xa9/0x2af mm/kasan/report.c:393
__asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:430
____bpf_skb_change_tail net/core/filter.c:2371 [inline]
bpf_skb_change_tail+0xa7f/0xba0 net/core/filter.c:2368
bpf_prog_6b83fbf63565f5a7+0xf6b/0x1000

Allocated by task 0:
(stack is not available)

Freed by task 0:
(stack is not available)

The buggy address belongs to the object at ffff88809a6cd300
which belongs to the cache skbuff_head_cache of size 232
The buggy address is located 144 bytes inside of
232-byte region [ffff88809a6cd300, ffff88809a6cd3e8)
The buggy address belongs to the page:
page:ffffea000269b340 count:1 mapcount:0 mapping:ffff88809a6cd080 index:0x0
flags: 0x1fffc0000000100(slab)
raw: 01fffc0000000100 ffff88809a6cd080 0000000000000000 000000010000000c
raw: ffffea000200dea0 ffff8880a9e67648 ffff88821b75f240 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff88809a6cd280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88809a6cd300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
> ffff88809a6cd380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
^
ffff88809a6cd400: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88809a6cd480: 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 [email protected].

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

syzbot

unread,
Feb 2, 2020, 10:14:03 PM2/2/20
syzbot suspects this bug was fixed by commit:

commit 7fed98f4a1e6eb77a5d66ecfdf9345e21df6ac82
Author: Daniel Borkmann <[email protected]>
Date: Thu Jun 7 15:40:03 2018 +0000

bpf: reject passing modified ctx to helper functions

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=14dbd0e6e00000
start commit: 3ffe1e79 Linux 4.14.138
git tree: linux-4.14.y
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=107fdb36600000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=13b53372600000

If the result looks correct, please mark the bug fixed by replying with:

#syz fix: bpf: reject passing modified ctx to helper functions

For information about bisection process see: https://goo.gl/tpsmEJ#bisection
Reply all
Reply to author
Forward
0 new messages