KASAN: stack-out-of-bounds Read in update_blocked_averages

Status: fixed on 2018/08/07 13:43
Subsystems: cgroups
[Documentation on labels]
Fix commit: 99ba2b5aba24 bpf: sockhash, disallow bpf_tcp_close and update in parallel
First crash: 2140d, last: 2140d

Sample crash report:
BUG: KASAN: stack-out-of-bounds in update_blocked_averages+0x148c/0x1770 kernel/sched/fair.c:7657
Read of size 8 at addr ffff8801add9cc00 by task syz-executor0/26705

CPU: 0 PID: 26705 Comm: syz-executor0 Not tainted 4.18.0-rc3+ #51
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+0x1c9/0x2b4 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_load8_noabort+0x14/0x20 mm/kasan/report.c:433
 update_blocked_averages+0x148c/0x1770 kernel/sched/fair.c:7657
 run_rebalance_domains+0x350/0x4c0 kernel/sched/fair.c:9883
 __do_softirq+0x2e8/0xb17 kernel/softirq.c:288
 invoke_softirq kernel/softirq.c:368 [inline]
 irq_exit+0x1d1/0x200 kernel/softirq.c:408
 exiting_irq arch/x86/include/asm/apic.h:527 [inline]
 smp_apic_timer_interrupt+0x186/0x730 arch/x86/kernel/apic/apic.c:1052
 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:863

Allocated by task 4484:
 save_stack+0x43/0xd0 mm/kasan/kasan.c:448
 set_track mm/kasan/kasan.c:460 [inline]
 kasan_kmalloc+0xc4/0xe0 mm/kasan/kasan.c:553
 kmem_cache_alloc_node_trace+0x150/0x770 mm/slab.c:3663
 kmalloc_node include/linux/slab.h:551 [inline]
 kzalloc_node include/linux/slab.h:718 [inline]
 alloc_fair_sched_group+0x1da/0x500 kernel/sched/fair.c:10230
 sched_create_group+0x35/0x70 kernel/sched/core.c:6304
 cpu_cgroup_css_alloc+0xe/0x30 kernel/sched/core.c:6434
 css_create kernel/cgroup/cgroup.c:4765 [inline]
 cgroup_apply_control_enable+0x558/0xe90 kernel/cgroup/cgroup.c:2934
 cgroup_mkdir+0x88a/0x1170 kernel/cgroup/cgroup.c:4976
 kernfs_iop_mkdir+0x159/0x1e0 fs/kernfs/dir.c:1099
 vfs_mkdir+0x42e/0x6b0 fs/namei.c:3827
 do_mkdirat+0x27b/0x310 fs/namei.c:3850
 __do_sys_mkdir fs/namei.c:3866 [inline]
 __se_sys_mkdir fs/namei.c:3864 [inline]
 __x64_sys_mkdir+0x5c/0x80 fs/namei.c:3864
 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290

Freed by task 642:
(stack is not available)

The buggy address belongs to the object at ffff8801add9ca80
 which belongs to the cache kmalloc-512 of size 512
The buggy address is located 384 bytes inside of
 512-byte region [ffff8801add9ca80, ffff8801add9cc80)
The buggy address belongs to the page:
page:ffffea0006b76700 count:1 mapcount:0 mapping:ffff8801da800940 index:0xffff8801add9c580
flags: 0x2fffc0000000100(slab)
raw: 02fffc0000000100 ffffea00072b64c8 ffffea0007046388 ffff8801da800940
raw: ffff8801add9c580 ffff8801add9c080 0000000100000004 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8801add9cb00: f2 f2 f2 f2 00 f2 f2 f2 00 00 00 00 00 00 00 00
 ffff8801add9cb80: 00 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1 f1
>ffff8801add9cc00: f1 00 f2 f2 f2 f2 f2 f2 f2 00 f2 f2 f2 f2 f2 f2
 ffff8801add9cc80: f2 00 f2 f2 f2 f2 f2 f2 f2 f8 f2 f2 f2 f2 f2 f2
 ffff8801add9cd00: f2 00 f2 f2 f2 00 00 00 00 00 00 00 00 00 00 00

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2018/07/13 08:58 bpf-next 6fd066604123 06c33b3a .config console log report ci-upstream-bpf-next-kasan-gce
* Struck through repros no longer work on HEAD.