syzbot


UBSAN: array-index-out-of-bounds in bpf_prog_select_runtime

Status: upstream: reported C repro on 2024/03/14 14:25
Subsystems: bpf
[Documentation on labels]
Reported-by: syzbot+d2a2c639d03ac200a4f1@syzkaller.appspotmail.com
First crash: 38d, last: 13d
Cause bisection: introduced by (bisect log) :
commit 011832b97b311bb9e3c27945bc0d1089a14209c9
Author: Alexei Starovoitov <ast@kernel.org>
Date: Wed Mar 6 03:19:26 2024 +0000

  bpf: Introduce may_goto instruction

Crash: UBSAN: array-index-out-of-bounds in bpf_prog_select_runtime (log)
Repro: C syz .config
  
Discussions (7)
Title Replies (including bot) Last reply
[PATCH] fix array-index-out-of-bounds in bpf_prog_select_runtime 2 (2) 2024/03/27 22:14
Re: [syzbot] [PATCH] fix array-index-out-of-bounds in bpf_prog_select_runtime 0 (1) 2024/03/24 23:12
Re: [syzbot] [PATCH] fix array-index-out-of-bounds in bpf_prog_select_runtime 0 (1) 2024/03/24 14:30
Re: [syzbot] [PATCH] fix array-index-out-of-bounds in bpf_prog_select_runtime 0 (1) 2024/03/24 13:38
Re: [syzbot] [PATCH] fix array-index-out-of-bounds in bpf_prog_select_runtime 0 (1) 2024/03/23 22:54
Re: [syzbot] [PATCH] fix array-index-out-of-bounds in bpf_prog_select_runtime 0 (1) 2024/03/23 21:22
[syzbot] [bpf?] UBSAN: array-index-out-of-bounds in bpf_prog_select_runtime 0 (1) 2024/03/14 14:25
Last patch testing requests (5)
Created Duration User Patch Repo Result
2024/03/24 23:12 4h35m cam.alvarez.i@gmail.com patch https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 9187210eee7d OK log
2024/03/24 14:30 22m cam.alvarez.i@gmail.com patch https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master error OK
2024/03/24 13:38 23m cam.alvarez.i@gmail.com patch upstream error OK
2024/03/23 22:54 22m cam.alvarez.i@gmail.com patch upstream error OK
2024/03/23 21:22 22m cam.alvarez.i@gmail.com patch upstream error OK

Sample crash report:
------------[ cut here ]------------
UBSAN: array-index-out-of-bounds in kernel/bpf/core.c:2349:29
index 16 is out of range for type '<unknown> *[16]'
CPU: 1 PID: 5060 Comm: syz-executor255 Not tainted 6.8.0-syzkaller-05202-g9187210eee7d #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/29/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x125/0x1b0 lib/dump_stack.c:106
 ubsan_epilogue lib/ubsan.c:217 [inline]
 __ubsan_handle_out_of_bounds+0x110/0x150 lib/ubsan.c:415
 bpf_prog_select_func kernel/bpf/core.c:2349 [inline]
 bpf_prog_select_runtime+0x5aa/0x640 kernel/bpf/core.c:2380
 bpf_prog_load+0xf0f/0x2660 kernel/bpf/syscall.c:2899
 __sys_bpf+0x9b4/0x4b40 kernel/bpf/syscall.c:5631
 __do_sys_bpf kernel/bpf/syscall.c:5738 [inline]
 __se_sys_bpf kernel/bpf/syscall.c:5736 [inline]
 __x64_sys_bpf+0x78/0xc0 kernel/bpf/syscall.c:5736
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xd2/0x260 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x6d/0x75
RIP: 0033:0x7fa2a0fe73e9
Code: 48 83 c4 28 c3 e8 37 17 00 00 0f 1f 80 00 00 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffdd829a698 EFLAGS: 00000246 ORIG_RAX: 0000000000000141
RAX: ffffffffffffffda RBX: 00007ffdd829a878 RCX: 00007fa2a0fe73e9
RDX: 0000000000000048 RSI: 00000000200017c0 RDI: 0000000000000005
RBP: 00007fa2a105a610 R08: 0000000000000000 R09: 0000000000000000
R10: 00000000ffffffff R11: 0000000000000246 R12: 0000000000000001
R13: 00007ffdd829a868 R14: 0000000000000001 R15: 0000000000000001
 </TASK>
---[ end trace ]---

Crashes (5):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/03/13 16:07 upstream 9187210eee7d db5b7ff0 .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root UBSAN: array-index-out-of-bounds in bpf_prog_select_runtime
2024/04/07 18:01 upstream fe46a7dd189e ca620dd8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root UBSAN: array-index-out-of-bounds in bpf_prog_select_runtime
2024/04/02 14:50 upstream fe46a7dd189e 6baf5069 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root UBSAN: array-index-out-of-bounds in bpf_prog_select_runtime
2024/03/30 07:56 upstream fe46a7dd189e c52bcb23 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root UBSAN: array-index-out-of-bounds in bpf_prog_select_runtime
2024/03/13 15:46 upstream 9187210eee7d db5b7ff0 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root UBSAN: array-index-out-of-bounds in bpf_prog_select_runtime
* Struck through repros no longer work on HEAD.