# CVE-2025-22087: bpf: Fix array bounds error with may_goto

- Severity: High 7.8 (CVSS:3.1, scored by Linux) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.24%, higher than 16% of CVEs (2026-12-01)
- Published: 2025-04-16T14:12:35.359Z
- Modified: 2026-08-05T11:56:41.027Z
- Weaknesses: CWE-125
- Assigned by: Linux

## Description

In the Linux kernel, the following vulnerability has been resolved:

bpf: Fix array bounds error with may_goto

may_goto uses an additional 8 bytes on the stack, which causes the
interpreters[] array to go out of bounds when calculating index by
stack_size.

1. If a BPF program is rewritten, re-evaluate the stack size. For non-JIT
cases, reject loading directly.

2. For non-JIT cases, calculating interpreters[idx] may still cause
out-of-bounds array access, and just warn about it.

3. For jit_requested cases, the execution of bpf_func also needs to be
warned. So move the definition of function __bpf_prog_ret0_warn out of
the macro definition CONFIG_BPF_JIT_ALWAYS_ON.

(As written by CVE List.)

## Affected

- Linux Linux: from 011832b97b311bb9e3c27945bc0d1089a14209c9 before 19e6817f84000d0b06f09fd69ebd56217842c122; from 011832b97b311bb9e3c27945bc0d1089a14209c9 before 4524b7febdd55fb99ae2e1f48db64019fa69e643; from 011832b97b311bb9e3c27945bc0d1089a14209c9 before 1a86ae57b2600e5749f5f674e9d4296ac00c69a8; from 011832b97b311bb9e3c27945bc0d1089a14209c9 before 6ebc5030e0c5a698f1dd9a6684cddf6ccaed64a0; 6.9 (not affected: before 6.9; from 6.12.23 up to 6.12.*; from 6.13.11 up to 6.13.*; from 6.14.2 up to 6.14.*; from 6.15 up to *)
- linux linux_kernel: from 6.9 before 6.12.23; from 6.13 before 6.13.11; from 6.14 before 6.14.2

## Every score

- Linux: CVSS:3.1 7.8 High `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- NVD: CVSS:3.1 7.1 High `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H`

## References

- <https://git.kernel.org/stable/c/19e6817f84000d0b06f09fd69ebd56217842c122> (patch)
- <https://git.kernel.org/stable/c/4524b7febdd55fb99ae2e1f48db64019fa69e643> (patch)
- <https://git.kernel.org/stable/c/1a86ae57b2600e5749f5f674e9d4296ac00c69a8> (patch)
- <https://git.kernel.org/stable/c/6ebc5030e0c5a698f1dd9a6684cddf6ccaed64a0> (patch)

## Sources

- CVE List: [CVE-2025-22087](https://www.cve.org/CVERecord?id=CVE-2025-22087), CVE Terms of Use, modified 2026-08-05
- NVD: [CVE-2025-22087](https://nvd.nist.gov/vuln/detail/CVE-2025-22087), Public domain, modified 2026-07-30

---

Page: https://cve.day/CVE-2025-22087 · Whole record: https://cve.day/CVE-2025-22087.json · Rebuilt by cve.day 2026-11-25T22:58:56.603Z
