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
Fix commit: bpf: Fix array bounds error with may_goto
Patched on: [ci-upstream-bpf-next-kasan-gce ci-upstream-linux-next-kasan-gce-root], missing on: [ci-qemu-gce-upstream-auto ci-qemu-native-arm64-kvm ci-qemu-upstream ci-qemu-upstream-386 ci-qemu2-arm32 ci-qemu2-arm64 ci-qemu2-arm64-compat ci-qemu2-arm64-mte ci-qemu2-riscv64 ci-snapshot-upstream-root ci-upstream-bpf-kasan-gce ci-upstream-gce-arm64 ci-upstream-gce-leak ci-upstream-kasan-badwrites-root ci-upstream-kasan-gce ci-upstream-kasan-gce-386 ci-upstream-kasan-gce-root ci-upstream-kasan-gce-selinux-root ci-upstream-kasan-gce-smack-root ci-upstream-kmsan-gce-386-root ci-upstream-kmsan-gce-root ci-upstream-net-kasan-gce ci-upstream-net-this-kasan-gce ci2-upstream-fs ci2-upstream-kcsan-gce ci2-upstream-usb]
First crash: 379d, last: 1h05m
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 (15)
Title Replies (including bot) Last reply
[PATCH bpf-next v3 1/3] bpf: Fix array bounds error with may_goto 1 (1) 2025/02/14 09:18
[PATCH bpf-next v2 1/3] bpf: Fix array bounds error with may_goto 4 (4) 2025/02/14 00:51
[PATCH bpf-next v1 1/2] bpf: Fix array bounds error with may_goto 2 (2) 2025/02/12 15:52
[PATCH bpf-next v1 0/2] bpf: Fix array bounds error with may_goto and add selftest 1 (1) 2025/02/12 13:52
[syzbot] Monthly bpf report (Jan 2025) 0 (1) 2025/01/20 08:14
[syzbot] Monthly bpf report (Dec 2024) 0 (1) 2024/12/19 21:40
[PATCH] fix array-index-out-of-bounds in bpf_prog_select_runtime 4 (4) 2024/05/06 23:35
Re: [syzbot] [PATCH] fix array-index-out-of-bounds in bpf_prog_select_runtime 0 (1) 2024/05/05 00:03
[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 (9)
Created Duration User Patch Repo Result
2024/10/06 21:09 41m retest repro upstream report log
2024/07/03 05:26 15m retest repro upstream report log
2024/05/05 00:03 27m cam.alvarez.i@gmail.com patch upstream OK log
2024/04/23 22:05 16m retest repro upstream report log
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
2024/03/24 13:38 23m cam.alvarez.i@gmail.com patch upstream error
2024/03/23 22:54 22m cam.alvarez.i@gmail.com patch upstream error
2024/03/23 21:22 22m cam.alvarez.i@gmail.com patch upstream error
Fix bisection attempts (3)
Created Duration User Patch Repo Result
2024/09/04 03:04 1h18m bisect fix upstream OK (0) job log log
2024/08/04 23:48 1h47m bisect fix upstream OK (0) job log log
2024/07/03 03:12 2h16m bisect fix upstream OK (0) job log log

Sample crash report:
------------[ cut here ]------------
UBSAN: array-index-out-of-bounds in ./kernel/bpf/core.c:2364:29
index 16 is out of range for type '<unknown> *[16]'
CPU: 1 UID: 0 PID: 5234 Comm: syz-executor176 Not tainted 6.11.0-syzkaller-02574-ga430d95c5efa #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:93 [inline]
 dump_stack_lvl+0x16c/0x1f0 lib/dump_stack.c:119
 ubsan_epilogue lib/ubsan.c:231 [inline]
 __ubsan_handle_out_of_bounds+0x110/0x150 lib/ubsan.c:429
 bpf_prog_select_func kernel/bpf/core.c:2364 [inline]
 bpf_prog_select_runtime+0x665/0x6f0 kernel/bpf/core.c:2395
 bpf_prog_load+0xf0f/0x2660 kernel/bpf/syscall.c:2912
 __sys_bpf+0x8e3/0x49c0 kernel/bpf/syscall.c:5710
 __do_sys_bpf kernel/bpf/syscall.c:5817 [inline]
 __se_sys_bpf kernel/bpf/syscall.c:5815 [inline]
 __x64_sys_bpf+0x78/0xc0 kernel/bpf/syscall.c:5815
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fcbd98783e9
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:00007fff8b407468 EFLAGS: 00000246 ORIG_RAX: 0000000000000141
RAX: ffffffffffffffda RBX: 00007fff8b407648 RCX: 00007fcbd98783e9
RDX: 0000000000000048 RSI: 00000000200017c0 RDI: 0000000000000005
RBP: 00007fcbd98eb610 R08: 0000000000000000 R09: 0000000000000000
R10: 00000000ffffffff R11: 0000000000000246 R12: 0000000000000001
R13: 00007fff8b407638 R14: 0000000000000001 R15: 0000000000000001
 </TASK>
---[ end trace ]---

Crashes (1117):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/09/18 12:17 upstream a430d95c5efa c673ca06 .config strace log report syz / log C [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 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/11/23 08:12 upstream 06afb0f36106 68da6d95 .config console log report syz / log C [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream UBSAN: array-index-out-of-bounds in bpf_prog_select_runtime
2025/03/28 08:13 upstream acb4f33713b9 6c09fb82 .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
2025/03/27 18:04 upstream 1a9239bb4253 6c09fb82 .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
2025/03/27 11:07 upstream 1e1ba8d23dae 20510e88 .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
2025/03/27 05:40 upstream 1e1ba8d23dae 20510e88 .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
2025/03/26 23:11 upstream 2df0c02dab82 89d30d73 .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
2025/03/26 15:52 upstream 2df0c02dab82 89d30d73 .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
2025/03/26 13:09 upstream 2df0c02dab82 89d30d73 .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
2025/03/26 11:51 upstream 2df0c02dab82 89d30d73 .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
2025/03/25 23:02 upstream 2df0c02dab82 89d30d73 .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
2025/03/25 13:48 upstream 327ecdbc0fda 875573af .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
2025/03/25 01:12 upstream 38fec10eb60d 875573af .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
2025/03/24 18:25 upstream 38fec10eb60d 875573af .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
2025/03/24 14:48 upstream 586de92313fc 875573af .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
2025/03/24 13:38 upstream 586de92313fc 875573af .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
2025/03/23 17:59 upstream 586de92313fc 4e8d3850 .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
2025/03/22 23:56 upstream 88d324e69ea9 c6512ef7 .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
2025/03/22 23:56 upstream 88d324e69ea9 c6512ef7 .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
2025/03/22 17:57 upstream 88d324e69ea9 c6512ef7 .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
2025/03/22 16:56 upstream 88d324e69ea9 c6512ef7 .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
2025/03/22 14:05 upstream 88d324e69ea9 c6512ef7 .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
2025/03/22 01:28 upstream d07de43e3f05 62330552 .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
2025/03/22 01:27 upstream d07de43e3f05 62330552 .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
2025/03/21 11:35 upstream b3ee1e460951 62330552 .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
2025/03/20 21:35 upstream 5fc319360819 62330552 .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
2025/03/20 20:45 upstream 5fc319360819 62330552 .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
2025/03/20 20:15 upstream 5fc319360819 62330552 .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
2025/03/20 02:41 upstream a7f2e10ecd8f 3b7445cf .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
2025/03/19 19:04 upstream 81e4f8d68c66 8d0a2921 .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
2025/03/19 17:59 upstream 81e4f8d68c66 8d0a2921 .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
2025/03/19 12:38 upstream 81e4f8d68c66 8d0a2921 .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
2025/03/19 06:51 upstream 81e4f8d68c66 22a6c2b1 .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
2025/03/19 06:51 upstream 81e4f8d68c66 22a6c2b1 .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
2025/03/18 21:16 upstream fc444ada1310 22a6c2b1 .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
2025/03/18 09:29 upstream fc444ada1310 ce3352cd .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
2025/03/16 23:57 upstream d1275e99d1c4 e2826670 .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
2025/03/27 03:40 upstream f6e0150b2003 20510e88 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream UBSAN: array-index-out-of-bounds in bpf_prog_select_runtime
2025/03/25 21:50 upstream 2df0c02dab82 89d30d73 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream UBSAN: array-index-out-of-bounds in bpf_prog_select_runtime
2025/03/25 06:09 upstream 3ba7dfb8da62 875573af .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream UBSAN: array-index-out-of-bounds in bpf_prog_select_runtime
2025/03/24 16:48 upstream 38fec10eb60d 875573af .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream UBSAN: array-index-out-of-bounds in bpf_prog_select_runtime
2025/03/23 03:23 upstream 183601b78a9b 4e8d3850 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream UBSAN: array-index-out-of-bounds in bpf_prog_select_runtime
2025/03/22 00:02 upstream d07de43e3f05 c6512ef7 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream UBSAN: array-index-out-of-bounds in bpf_prog_select_runtime
2025/03/20 15:54 upstream a7f2e10ecd8f 9209bc22 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream UBSAN: array-index-out-of-bounds in bpf_prog_select_runtime
2025/03/18 17:51 upstream 76b6905c11fd 22a6c2b1 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream UBSAN: array-index-out-of-bounds in bpf_prog_select_runtime
2025/03/17 06:17 upstream 4701f33a1070 948c34e4 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream UBSAN: array-index-out-of-bounds in bpf_prog_select_runtime
2025/03/16 23:08 upstream cb82ca153949 e2826670 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream UBSAN: array-index-out-of-bounds in bpf_prog_select_runtime
2025/03/16 16:46 upstream cb82ca153949 e2826670 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream UBSAN: array-index-out-of-bounds in bpf_prog_select_runtime
2024/11/23 13:13 upstream 28eb75e178d3 4dfba277 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-arm64 UBSAN: array-index-out-of-bounds in bpf_prog_select_runtime
2024/11/23 11:00 upstream 28eb75e178d3 4dfba277 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-arm64-compat UBSAN: array-index-out-of-bounds in bpf_prog_select_runtime
* Struck through repros no longer work on HEAD.