syzbot


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

Status: fixed on 2020/08/18 12:30
Subsystems: kernel
[Documentation on labels]
Reported-by: syzbot+2990ca6e76c080858a9c@syzkaller.appspotmail.com
Fix commit: 4ee7c60de83a init, tracing: Add initcall trace events
First crash: 2314d, last: 1619d
Cause bisection: introduced by (bisect log) [merge commit]:
commit 2dcd9c71c1ffa9a036e09047f60e08383bb0abb6
Author: Linus Torvalds <torvalds@linux-foundation.org>
Date: Fri Nov 17 22:58:01 2017 +0000

  Merge tag 'trace-v4.15' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace

Crash: KASAN: stack-out-of-bounds Read in update_stack_state (log)
Repro: C syz .config
  
Fix bisection: fixed by (bisect log) :
commit 4ee7c60de83ac01fa4c33c55937357601631e8ad
Author: Steven Rostedt (VMware) <rostedt@goodmis.org>
Date: Fri Mar 23 14:18:03 2018 +0000

  init, tracing: Add initcall trace events

  
Discussions (3)
Title Replies (including bot) Last reply
KASAN: stack-out-of-bounds Read in update_stack_state 2 (4) 2019/12/21 07:41
Reminder: 19 open syzbot bugs in perf subsystem 2 (2) 2019/07/24 13:22
Reminder: 22 open syzbot bugs in perf subsystem 7 (7) 2019/07/03 11:34
Similar bugs (3)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-54 KASAN: stack-out-of-bounds Read in update_stack_state 2 1593d 1600d 0/2 auto-closed as invalid on 2020/06/10 22:34
linux-4.14 KASAN: stack-out-of-bounds Read in update_stack_state C inconclusive 11 1468d 1761d 0/1 upstream: reported C repro on 2019/08/27 12:47
android-5-10 KASAN: stack-out-of-bounds Read in update_stack_state 1 142d 142d 0/2 auto-obsoleted due to no activity on 2024/05/02 04:08

Sample crash report:
audit: type=1400 audit(1519168770.631:6): avc:  denied  { map } for  pid=4150 comm="bash" path="/bin/bash" dev="sda1" ino=1457 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=system_u:object_r:file_t:s0 tclass=file permissive=1
audit: type=1400 audit(1519168776.932:7): avc:  denied  { map } for  pid=4164 comm="syzkaller659137" path="/root/syzkaller659137685" dev="sda1" ino=16481 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: stack-out-of-bounds in __read_once_size include/linux/compiler.h:183 [inline]
BUG: KASAN: stack-out-of-bounds in update_stack_state+0x6ea/0x700 arch/x86/kernel/unwind_frame.c:270
Read of size 8 at addr ffff8801a9e57198 by task syzkaller659137/4164

CPU: 0 PID: 4164 Comm: syzkaller659137 Not tainted 4.16.0-rc1+ #14
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+0x194/0x257 lib/dump_stack.c:53
 print_address_description+0x73/0x250 mm/kasan/report.c:256
 kasan_report_error mm/kasan/report.c:354 [inline]
 kasan_report+0x23b/0x360 mm/kasan/report.c:412
 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:433
 __read_once_size include/linux/compiler.h:183 [inline]
 update_stack_state+0x6ea/0x700 arch/x86/kernel/unwind_frame.c:270
 __unwind_start+0xfd/0x330 arch/x86/kernel/unwind_frame.c:404
 unwind_start arch/x86/include/asm/unwind.h:54 [inline]
 perf_callchain_kernel+0x2fb/0x610 arch/x86/events/core.c:2350
 get_perf_callchain+0x48f/0xa50 kernel/events/callchain.c:205
 perf_callchain kernel/events/core.c:6003 [inline]
 perf_prepare_sample+0x118b/0x16f0 kernel/events/core.c:6029
 __perf_event_output kernel/events/core.c:6143 [inline]
 perf_event_output_forward+0xef/0x260 kernel/events/core.c:6161
 __perf_event_overflow+0x207/0x490 kernel/events/core.c:7397
 perf_swevent_overflow+0x20c/0x2c0 kernel/events/core.c:7473
 perf_swevent_event+0x10e/0x270 kernel/events/core.c:7506
 do_perf_sw_event kernel/events/core.c:7614 [inline]
 ___perf_sw_event+0x491/0x6d0 kernel/events/core.c:7645
 perf_sw_event_sched include/linux/perf_event.h:1044 [inline]
 perf_event_task_sched_out include/linux/perf_event.h:1082 [inline]
 prepare_task_switch kernel/sched/core.c:2638 [inline]
 context_switch kernel/sched/core.c:2815 [inline]
 __schedule+0xd53/0x2040 kernel/sched/core.c:3435
 schedule+0xf5/0x430 kernel/sched/core.c:3494
 exit_to_usermode_loop+0x1d1/0x2f0 arch/x86/entry/common.c:152
 prepare_exit_to_usermode arch/x86/entry/common.c:196 [inline]
 syscall_return_slowpath arch/x86/entry/common.c:265 [inline]
 do_syscall_64+0x6ed/0x940 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x26/0x9b
RIP: 0033:0x43fe99
RSP: 002b:00007ffed9993ee8 EFLAGS: 00000203 ORIG_RAX: 0000000000000001
RAX: 0000000000000012 RBX: 00000000ffffffff RCX: 000000000043fe99
RDX: 0000000000000012 RSI: 00000000004a1184 RDI: 0000000000000001
RBP: 00000000006ca018 R08: 00000000004002c8 R09: 00000000004002c8
R10: 0000000000000000 R11: 0000000000000203 R12: 00000000004017c0
R13: 0000000000401850 R14: 0000000000000000 R15: 0000000000000000

The buggy address belongs to the page:
page:ffffea0006a795c0 count:0 mapcount:0 mapping:          (null) index:0x0
flags: 0x2fffc0000000000()
raw: 02fffc0000000000 0000000000000000 0000000000000000 00000000ffffffff
raw: 0000000000000000 ffffea0006a70101 0000000000000000 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8801a9e57080: 00 f1 f1 f1 f1 00 00 00 00 00 00 00 00 00 00 00
 ffff8801a9e57100: f2 f3 f3 f3 f3 00 00 00 00 00 00 00 00 00 00 00
>ffff8801a9e57180: 00 00 f1 f1 f1 f1 04 f2 f2 f2 f2 f2 f2 f2 f8 f2
                            ^
 ffff8801a9e57200: f2 f2 f2 f2 f2 f2 00 00 00 f2 f3 f3 f3 f3 00 00
 ffff8801a9e57280: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1
==================================================================

Crashes (388):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2018/02/20 23:22 bpf-next 0b6b8a3dd86d 04cbdbd1 .config console log report syz C ci-upstream-bpf-next-kasan-gce
2020/01/17 04:04 upstream f5ae2ea6347a 3de7aabb .config console log report ci-upstream-kasan-gce-root
2019/11/16 18:36 upstream 6c9594bdd474 d5696d51 .config console log report ci-upstream-kasan-gce-root
2019/06/25 03:57 upstream 4b972a01a7da 82c13b6b .config console log report ci-upstream-kasan-gce-selinux-root
2019/05/03 09:52 upstream ea9866793d1e 1bfa09b9 .config console log report ci-upstream-kasan-gce-root
2019/04/21 02:16 upstream 9e5de623a0cb b0e8efcb .config console log report ci-upstream-kasan-gce-selinux-root
2019/03/20 02:56 upstream b7a42146dca3 2458c1c6 .config console log report ci-upstream-kasan-gce-selinux-root
2019/01/30 15:48 upstream 62967898789d aa432daf .config console log report ci-upstream-kasan-gce-smack-root
2018/05/13 07:57 upstream 427fbe89261d e726f42b .config console log report ci-upstream-kasan-gce-root
2018/05/10 20:33 upstream 008464a9360e 12c7428a .config console log report ci-upstream-kasan-gce-root
2018/05/10 00:27 upstream 008464a9360e 12c7428a .config console log report ci-upstream-kasan-gce-root
2018/05/09 17:14 upstream 036db8bd9637 12c7428a .config console log report ci-upstream-kasan-gce-root
2018/05/09 02:58 upstream 036db8bd9637 b88872ba .config console log report ci-upstream-kasan-gce-root
2018/05/08 22:56 upstream 036db8bd9637 b88872ba .config console log report ci-upstream-kasan-gce-root
2018/05/08 05:22 upstream f142f08bf7ec 045bbd4a .config console log report ci-upstream-kasan-gce-root
2018/05/06 01:27 upstream c1c07416cdd4 78b251cb .config console log report ci-upstream-kasan-gce-root
2018/05/05 17:32 upstream c1c07416cdd4 6a0382b5 .config console log report ci-upstream-kasan-gce-root
2018/05/05 11:25 upstream c1c07416cdd4 6a0382b5 .config console log report ci-upstream-kasan-gce-root
2018/05/04 16:36 upstream 150426981426 9ce14f4b .config console log report ci-upstream-kasan-gce-root
2018/05/04 08:48 upstream c15f6d8d4715 9ce14f4b .config console log report ci-upstream-kasan-gce-root
2018/05/03 21:28 upstream c15f6d8d4715 9ce14f4b .config console log report ci-upstream-kasan-gce-root
2018/05/02 18:39 upstream 2d618bdf7163 d5b114b4 .config console log report ci-upstream-kasan-gce-root
2018/05/01 11:19 upstream 8188fc8bef8c d5b114b4 .config console log report ci-upstream-kasan-gce-root
2018/04/30 16:51 upstream 6da6c0db5316 06db3cec .config console log report ci-upstream-kasan-gce-root
2018/04/30 04:07 upstream c61a56ababa4 bb79c6ab .config console log report ci-upstream-kasan-gce-root
2018/04/29 20:42 upstream c61a56ababa4 bb79c6ab .config console log report ci-upstream-kasan-gce-root
2018/04/29 18:56 upstream c61a56ababa4 bb79c6ab .config console log report ci-upstream-kasan-gce-root
2018/04/29 13:58 upstream cdface520934 d5a5d045 .config console log report ci-upstream-kasan-gce-root
2018/04/29 06:06 upstream bf8f5de17442 d5a5d045 .config console log report ci-upstream-kasan-gce-root
2018/04/29 03:51 upstream bf8f5de17442 d5a5d045 .config console log report ci-upstream-kasan-gce-root
2018/09/14 11:56 upstream a06b0c82a049 a343a400 .config console log report ci-upstream-kasan-gce-386
2018/05/20 01:43 upstream 0b449a441dac f48c20b8 .config console log report ci-upstream-kasan-gce-386
2019/02/14 04:19 bpf 1e405c1a3f66 6a46f448 .config console log report ci-upstream-bpf-kasan-gce
2019/02/03 08:24 bpf e7b816415e03 c198d5dd .config console log report ci-upstream-bpf-kasan-gce
2018/11/25 02:17 bpf 1efb6ee3edea ecc7c870 .config console log report ci-upstream-bpf-kasan-gce
2018/11/21 03:21 bpf 569a933b03f3 9aca6b52 .config console log report ci-upstream-bpf-kasan-gce
2018/05/14 06:10 bpf-next a84880ef4352 481f030c .config console log report ci-upstream-bpf-next-kasan-gce
2018/05/08 01:24 bpf-next e94fa1d93117 9e0846e8 .config console log report ci-upstream-bpf-next-kasan-gce
2018/05/07 20:52 bpf-next e94fa1d93117 9e0846e8 .config console log report ci-upstream-bpf-next-kasan-gce
2018/05/07 19:39 bpf-next e94fa1d93117 9e0846e8 .config console log report ci-upstream-bpf-next-kasan-gce
2018/05/07 15:46 bpf-next e94fa1d93117 a211da1a .config console log report ci-upstream-bpf-next-kasan-gce
2018/05/07 14:34 bpf-next e94fa1d93117 a211da1a .config console log report ci-upstream-bpf-next-kasan-gce
2018/05/07 12:47 bpf-next e94fa1d93117 a211da1a .config console log report ci-upstream-bpf-next-kasan-gce
2018/05/07 10:58 bpf-next e94fa1d93117 a211da1a .config console log report ci-upstream-bpf-next-kasan-gce
2018/05/07 09:11 bpf-next e94fa1d93117 a211da1a .config console log report ci-upstream-bpf-next-kasan-gce
2018/05/07 05:47 bpf-next e94fa1d93117 a211da1a .config console log report ci-upstream-bpf-next-kasan-gce
2018/05/07 00:20 bpf-next e94fa1d93117 a211da1a .config console log report ci-upstream-bpf-next-kasan-gce
2018/05/06 18:23 bpf-next e94fa1d93117 6c18ddb0 .config console log report ci-upstream-bpf-next-kasan-gce
2018/05/06 14:36 bpf-next e94fa1d93117 6c18ddb0 .config console log report ci-upstream-bpf-next-kasan-gce
2018/05/06 12:59 bpf-next e94fa1d93117 6c18ddb0 .config console log report ci-upstream-bpf-next-kasan-gce
2018/05/06 11:03 bpf-next e94fa1d93117 6c18ddb0 .config console log report ci-upstream-bpf-next-kasan-gce
2018/04/27 14:14 bpf-next 79741a38b4a2 7785e404 .config console log report ci-upstream-bpf-next-kasan-gce
2018/04/26 17:51 bpf-next af487c577770 73417389 .config console log report ci-upstream-bpf-next-kasan-gce
2018/02/20 23:05 bpf-next 0b6b8a3dd86d 04cbdbd1 .config console log report ci-upstream-bpf-next-kasan-gce
* Struck through repros no longer work on HEAD.