syzbot


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

Status: fixed on 2018/07/09 18:05
Subsystems: bpf net
[Documentation on labels]
Reported-by: syzbot+567faa843005dda30737@syzkaller.appspotmail.com
Fix commit: 58990d1ff3f7 bpf: reject passing modified ctx to helper functions
First crash: 2115d, last: 2115d
Discussions (1)
Title Replies (including bot) Last reply
KASAN: slab-out-of-bounds Read in bpf_skb_change_head 1 (2) 2018/06/13 23:01
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-414 KASAN: slab-out-of-bounds Read in bpf_skb_change_head C 8 1602d 1812d 0/1 public: reported C repro on 2019/04/12 00:01
linux-4.14 KASAN: slab-out-of-bounds Read in bpf_skb_change_head C done 2 1555d 1624d 1/1 fixed on 2020/01/25 22:00

Sample crash report:
random: sshd: uninitialized urandom read (32 bytes read)
random: sshd: uninitialized urandom read (32 bytes read)
random: sshd: uninitialized urandom read (32 bytes read)
random: sshd: uninitialized urandom read (32 bytes read)
==================================================================
BUG: KASAN: slab-out-of-bounds in ____bpf_skb_change_head net/core/filter.c:2921 [inline]
BUG: KASAN: slab-out-of-bounds in bpf_skb_change_head+0x80c/0x9d0 net/core/filter.c:2917
Read of size 4 at addr ffff8801d94ea680 by task syz-executor991/4551

CPU: 0 PID: 4551 Comm: syz-executor991 Not tainted 4.17.0-rc7+ #38
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x1b9/0x294 lib/dump_stack.c:113
 print_address_description+0x6c/0x20b mm/kasan/report.c:256
 kasan_report_error mm/kasan/report.c:354 [inline]
 kasan_report.cold.7+0x242/0x2fe mm/kasan/report.c:412
 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report.c:432
 ____bpf_skb_change_head net/core/filter.c:2921 [inline]
 bpf_skb_change_head+0x80c/0x9d0 net/core/filter.c:2917

Allocated by task 0:
(stack is not available)

Freed by task 0:
(stack is not available)

The buggy address belongs to the object at ffff8801d94ea580
 which belongs to the cache skbuff_head_cache of size 232
The buggy address is located 24 bytes to the right of
 232-byte region [ffff8801d94ea580, ffff8801d94ea668)
The buggy address belongs to the page:
page:ffffea0007653a80 count:1 mapcount:0 mapping:ffff8801d94ea080 index:0x0
flags: 0x2fffc0000000100(slab)
raw: 02fffc0000000100 ffff8801d94ea080 0000000000000000 000000010000000c
raw: ffffea0006b2e720 ffffea00076595e0 ffff8801d9450e40 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8801d94ea580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff8801d94ea600: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff8801d94ea680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
                   ^
 ffff8801d94ea700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff8801d94ea780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2018/06/13 20:34 bpf-next 75d4e704fa8d 27c5f59f .config console log report syz C ci-upstream-bpf-next-kasan-gce
2018/06/13 18:31 bpf-next 75d4e704fa8d 27c5f59f .config console log report ci-upstream-bpf-next-kasan-gce
* Struck through repros no longer work on HEAD.