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

8 views
Skip to first unread message

syzbot

unread,
Aug 9, 2019, 6:42:05 PM8/9/19
to syzkaller...@googlegroups.com
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=10b38402600000
kernel config: https://syzkaller.appspot.com/x/.config?x=978e269523a888e8
dashboard link: https://syzkaller.appspot.com/bug?extid=d8532c325bf5c40a1b85
compiler: gcc (GCC) 9.0.0 20181231 (experimental)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=13fd626a600000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1478459a600000

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

random: sshd: uninitialized urandom read (32 bytes read)
audit: type=1400 audit(1565386695.424:36): avc: denied { map } for
pid=7035 comm="syz-executor139" path="/root/syz-executor139391520"
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_proto_xlat net/core/filter.c:2151
[inline]
BUG: KASAN: slab-out-of-bounds in ____bpf_skb_change_proto
net/core/filter.c:2189 [inline]
BUG: KASAN: slab-out-of-bounds in bpf_skb_change_proto+0xdbc/0x10f0
net/core/filter.c:2164
Read of size 2 at addr ffff888091537d40 by task syz-executor139/7035

CPU: 0 PID: 7035 Comm: syz-executor139 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_load2_noabort+0x14/0x20 mm/kasan/report.c:428
bpf_skb_proto_xlat net/core/filter.c:2151 [inline]
____bpf_skb_change_proto net/core/filter.c:2189 [inline]
bpf_skb_change_proto+0xdbc/0x10f0 net/core/filter.c:2164
bpf_prog_0a61b7f223ef83f3+0xdfd/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 ffff888091537d40
which belongs to the cache skbuff_head_cache of size 232
The buggy address is located 0 bytes inside of
232-byte region [ffff888091537d40, ffff888091537e28)
The buggy address belongs to the page:
page:ffffea0002454dc0 count:1 mapcount:0 mapping:ffff8880915370c0 index:0x0
flags: 0x1fffc0000000100(slab)
raw: 01fffc0000000100 ffff8880915370c0 0000000000000000 000000010000000c
raw: ffffea0002361f60 ffff8880a9dcc248 ffff88821b719240 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff888091537c00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888091537c80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
> ffff888091537d00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
^
ffff888091537d80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888091537e00: 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

syzbot

unread,
Feb 2, 2020, 9:52:02 PM2/2/20
to syzkaller...@googlegroups.com
syzbot suspects this bug was fixed by commit:

commit 7fed98f4a1e6eb77a5d66ecfdf9345e21df6ac82
Author: Daniel Borkmann <dan...@iogearbox.net>
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=178e88a1e00000
start commit: 01fd1694 Linux 4.14.141
git tree: linux-4.14.y
kernel config: https://syzkaller.appspot.com/x/.config?x=62c9b69e1b2adda9
dashboard link: https://syzkaller.appspot.com/bug?extid=d8532c325bf5c40a1b85
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=10f22d8e600000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=137c5251600000

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