syzbot


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

Status: fixed on 2018/08/07 13:43
Subsystems: kernel
[Documentation on labels]
Reported-by: syzbot+df1a417b3485bed2c190@syzkaller.appspotmail.com
Fix commit: 99ba2b5aba24 bpf: sockhash, disallow bpf_tcp_close and update in parallel
First crash: 2202d, last: 2195d
Discussions (1)
Title Replies (including bot) Last reply
KASAN: stack-out-of-bounds Read in account_system_index_time 1 (2) 2018/07/09 05:43

Sample crash report:
==================================================================
BUG: KASAN: stack-out-of-bounds in __read_once_size include/linux/compiler.h:188 [inline]
BUG: KASAN: stack-out-of-bounds in get_running_cputimer include/linux/sched/cputime.h:85 [inline]
BUG: KASAN: stack-out-of-bounds in account_group_system_time include/linux/sched/cputime.h:149 [inline]
BUG: KASAN: stack-out-of-bounds in account_system_index_time+0x512/0x5c0 kernel/sched/cputime.c:168
Read of size 1 at addr ffff8801afffc278 by task syz-executor708/17155

CPU: 1 PID: 17155 Comm: syz-executor708 Not tainted 4.18.0-rc3+ #137
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 <IRQ>
 __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_load1_noabort+0x14/0x20 mm/kasan/report.c:430
 __read_once_size include/linux/compiler.h:188 [inline]
 get_running_cputimer include/linux/sched/cputime.h:85 [inline]
 account_group_system_time include/linux/sched/cputime.h:149 [inline]
 account_system_index_time+0x512/0x5c0 kernel/sched/cputime.c:168
 account_system_time+0x7f/0xb0 kernel/sched/cputime.c:199
 account_process_tick+0x76/0x240 kernel/sched/cputime.c:498
 update_process_times+0x21/0x70 kernel/time/timer.c:1634
 tick_sched_handle+0x9f/0x180 kernel/time/tick-sched.c:164
 tick_sched_timer+0x45/0x130 kernel/time/tick-sched.c:1274
 __run_hrtimer kernel/time/hrtimer.c:1398 [inline]
 __hrtimer_run_queues+0x3eb/0x10c0 kernel/time/hrtimer.c:1460
 hrtimer_interrupt+0x2f3/0x750 kernel/time/hrtimer.c:1518
 local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1025 [inline]
 smp_apic_timer_interrupt+0x165/0x730 arch/x86/kernel/apic/apic.c:1050
 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:863
 </IRQ>

Allocated by task 905967825:
BUG: unable to handle kernel paging request at ffffffff8c42a180
PGD 8e6d067 P4D 8e6d067 PUD 8e6e063 PMD 0 
Thread overran stack, or stack corrupted
Oops: 0000 [#1] SMP KASAN
CPU: 1 PID: 17155 Comm: syz-executor708 Not tainted 4.18.0-rc3+ #137
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:depot_fetch_stack+0x10/0x30 lib/stackdepot.c:201
Code: e8 65 1b 47 fe e9 b3 fd ff ff e8 5b 1b 47 fe e9 55 fd ff ff 90 90 90 90 90 90 89 f8 c1 ef 11 25 ff ff 1f 00 81 e7 f0 3f 00 00 <48> 03 3c c5 80 19 43 8b 8b 47 0c 48 83 c7 18 c7 46 10 00 00 00 00 
RSP: 0018:ffff8801daf078b8 EFLAGS: 00010006
RAX: 00000000001ff100 RBX: ffff8801afffc654 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffff8801daf078c0 RDI: 0000000000000ff0
RBP: ffff8801daf078e8 R08: ffff8801adacc6c0 R09: ffffed003b5e3ec2
R10: ffffed003b5e3ec2 R11: ffff8801daf1f617 R12: ffff8801afffc140
R13: ffff8801afffc278 R14: ffff8801da97be40 R15: ffff8801afffc650
FS:  0000000000c14940(0000) GS:ffff8801daf00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffff8c42a180 CR3: 00000001ae362000 CR4: 00000000001406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <IRQ>
 describe_object mm/kasan/report.c:243 [inline]
 print_address_description+0xfb/0x20b mm/kasan/report.c:263
 kasan_report_error mm/kasan/report.c:354 [inline]
 kasan_report.cold.7+0x242/0x2fe mm/kasan/report.c:412
 __asan_report_load1_noabort+0x14/0x20 mm/kasan/report.c:430
 __read_once_size include/linux/compiler.h:188 [inline]
 get_running_cputimer include/linux/sched/cputime.h:85 [inline]
 account_group_system_time include/linux/sched/cputime.h:149 [inline]
 account_system_index_time+0x512/0x5c0 kernel/sched/cputime.c:168
 account_system_time+0x7f/0xb0 kernel/sched/cputime.c:199
 account_process_tick+0x76/0x240 kernel/sched/cputime.c:498
 update_process_times+0x21/0x70 kernel/time/timer.c:1634
 tick_sched_handle+0x9f/0x180 kernel/time/tick-sched.c:164
 tick_sched_timer+0x45/0x130 kernel/time/tick-sched.c:1274
 __run_hrtimer kernel/time/hrtimer.c:1398 [inline]
 __hrtimer_run_queues+0x3eb/0x10c0 kernel/time/hrtimer.c:1460
 hrtimer_interrupt+0x2f3/0x750 kernel/time/hrtimer.c:1518
 local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1025 [inline]
 smp_apic_timer_interrupt+0x165/0x730 arch/x86/kernel/apic/apic.c:1050
 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:863
 </IRQ>
Modules linked in:
Dumping ftrace buffer:
   (ftrace buffer empty)
CR2: ffffffff8c42a180
---[ end trace 9194b6f505fa64d0 ]---
RIP: 0010:depot_fetch_stack+0x10/0x30 lib/stackdepot.c:201
Code: e8 65 1b 47 fe e9 b3 fd ff ff e8 5b 1b 47 fe e9 55 fd ff ff 90 90 90 90 90 90 89 f8 c1 ef 11 25 ff ff 1f 00 81 e7 f0 3f 00 00 <48> 03 3c c5 80 19 43 8b 8b 47 0c 48 83 c7 18 c7 46 10 00 00 00 00 
RSP: 0018:ffff8801daf078b8 EFLAGS: 00010006
RAX: 00000000001ff100 RBX: ffff8801afffc654 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffff8801daf078c0 RDI: 0000000000000ff0
RBP: ffff8801daf078e8 R08: ffff8801adacc6c0 R09: ffffed003b5e3ec2
R10: ffffed003b5e3ec2 R11: ffff8801daf1f617 R12: ffff8801afffc140
R13: ffff8801afffc278 R14: ffff8801da97be40 R15: ffff8801afffc650
FS:  0000000000c14940(0000) GS:ffff8801daf00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffff8c42a180 CR3: 00000001ae362000 CR4: 00000000001406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2018/07/09 00:17 upstream ca04b3cca11a f25e5770 .config console log report syz C ci-upstream-kasan-gce-root
2018/07/16 03:24 bpf-next 13f7432bdd8e 92a49505 .config console log report ci-upstream-bpf-next-kasan-gce
* Struck through repros no longer work on HEAD.