syzbot


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

Status: fixed on 2018/07/09 18:05
Subsystems: bpf net
[Documentation on labels]
Reported-by: syzbot+e5190cb881d8660fb1a3@syzkaller.appspotmail.com
Fix commit: 58990d1ff3f7 bpf: reject passing modified ctx to helper functions
First crash: 2148d, last: 2137d
Discussions (4)
Title Replies (including bot) Last reply
[PATCH 4.14 00/62] 4.14.164-stable review 66 (66) 2020/01/13 15:47
[PATCH 4.17 00/67] 4.17.7-stable review 74 (74) 2018/07/17 09:41
KASAN: slab-out-of-bounds Read in skb_ensure_writable 1 (2) 2018/06/08 09:54
[PATCH bpf] bpf: reject passing modified ctx to helper functions 4 (4) 2018/06/07 19:43
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-414 KASAN: slab-out-of-bounds Read in skb_ensure_writable C 10 1923d 1834d 0/1 public: reported C repro on 2019/04/12 00: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 pskb_may_pull include/linux/skbuff.h:2104 [inline]
BUG: KASAN: slab-out-of-bounds in skb_ensure_writable+0x554/0x620 net/core/skbuff.c:5101
Read of size 4 at addr ffff8801aefc1780 by task syz-executor159/4509

CPU: 0 PID: 4509 Comm: syz-executor159 Not tainted 4.17.0-rc7+ #78
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
 pskb_may_pull include/linux/skbuff.h:2104 [inline]
 skb_ensure_writable+0x554/0x620 net/core/skbuff.c:5101
 __bpf_try_make_writable net/core/filter.c:1419 [inline]
 bpf_try_make_writable net/core/filter.c:1425 [inline]
 ____bpf_l3_csum_replace net/core/filter.c:1546 [inline]
 bpf_l3_csum_replace+0x8c/0x4d0 net/core/filter.c:1537

Allocated by task 0:
(stack is not available)

Freed by task 0:
(stack is not available)

The buggy address belongs to the object at ffff8801aefc1680
 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 [ffff8801aefc1680, ffff8801aefc1768)
The buggy address belongs to the page:
page:ffffea0006bbf040 count:1 mapcount:0 mapping:ffff8801aefc1040 index:0x0
flags: 0x2fffc0000000100(slab)
raw: 02fffc0000000100 ffff8801aefc1040 0000000000000000 000000010000000c
raw: ffffea0006b61060 ffffea0006bd69e0 ffff8801d9bdd6c0 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8801aefc1680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff8801aefc1700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff8801aefc1780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
                   ^
 ffff8801aefc1800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff8801aefc1880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================

Crashes (9):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2018/06/02 06:19 upstream 0512e0134582 2f93b54f .config console log report syz C ci-upstream-kasan-gce-root
2018/06/10 22:55 upstream 3ca24ce9ff76 866118af .config console log report ci-upstream-kasan-gce-root
2018/06/13 05:51 bpf-next 75d4e704fa8d 6dcbc435 .config console log report ci-upstream-bpf-next-kasan-gce
2018/06/13 03:16 bpf-next 75d4e704fa8d 6dcbc435 .config console log report ci-upstream-bpf-next-kasan-gce
2018/06/10 02:42 bpf-next 75d4e704fa8d 866118af .config console log report ci-upstream-bpf-next-kasan-gce
2018/06/07 00:01 bpf-next 75d4e704fa8d e0e534c6 .config console log report ci-upstream-bpf-next-kasan-gce
2018/06/04 23:44 bpf-next 34ea38ca2799 a50d873b .config console log report ci-upstream-bpf-next-kasan-gce
2018/06/04 11:11 bpf-next bd3a08aaa9a3 6cbe7c26 .config console log report ci-upstream-bpf-next-kasan-gce
2018/06/02 04:34 bpf-next bcece5dc40b9 2f93b54f .config console log report ci-upstream-bpf-next-kasan-gce
* Struck through repros no longer work on HEAD.