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

6 views
Skip to first unread message

syzbot

unread,
Jul 19, 2019, 9:06:07 AM7/19/19
to syzkaller...@googlegroups.com
Hello,

syzbot found the following crash on:

HEAD commit: aea8526e Linux 4.14.133
git tree: linux-4.14.y
console output: https://syzkaller.appspot.com/x/log.txt?x=17f90a34600000
kernel config: https://syzkaller.appspot.com/x/.config?x=5dfccef5a159766b
dashboard link: https://syzkaller.appspot.com/bug?extid=24bc05f38b3e3dda58ea
compiler: gcc (GCC) 9.0.0 20181231 (experimental)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=16f88fe0600000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=125fafe0600000

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

random: sshd: uninitialized urandom read (32 bytes read)
audit: type=1400 audit(1563539022.366:36): avc: denied { map } for
pid=7055 comm="syz-executor320" path="/root/syz-executor320046933"
dev="sda1" ino=16484 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_clone_redirect
/net/core/filter.c:1768 [inline]
BUG: KASAN: slab-out-of-bounds in bpf_clone_redirect+0x2de/0x2f0
/net/core/filter.c:1759
Read of size 8 at addr ffff888097382110 by task syz-executor320/7055

CPU: 1 PID: 7055 Comm: syz-executor320 Not tainted 4.14.133 #28
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_clone_redirect /net/core/filter.c:1768 [inline]
bpf_clone_redirect+0x2de/0x2f0 /net/core/filter.c:1759
bpf_prog_952a9deb36fe58b9+0x4c8/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 ffff888097382080
which belongs to the cache skbuff_head_cache of size 232
The buggy address is located 144 bytes inside of
232-byte region [ffff888097382080, ffff888097382168)
The buggy address belongs to the page:
page:ffffea00025ce080 count:1 mapcount:0 mapping:ffff888097382080 index:0x0
flags: 0x1fffc0000000100(slab)
raw: 01fffc0000000100 ffff888097382080 0000000000000000 000000010000000c
raw: ffffea00024b86e0 ffffea00024a9260 ffff88821b719240 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff888097382000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888097382080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
> ffff888097382100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
^
ffff888097382180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888097382200: 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,
Jan 28, 2020, 4:17:01 AM1/28/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=15304b35e00000
start commit: f56f3d0e Linux 4.14.155
git tree: linux-4.14.y
kernel config: https://syzkaller.appspot.com/x/.config?x=67c576af752ad9
dashboard link: https://syzkaller.appspot.com/bug?extid=24bc05f38b3e3dda58ea
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=171ffbace00000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=17c33212e00000

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