# CVE-2025-22087: bpf: Fix array bounds error with may\_goto

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 7.8
- **CVSS:** 7.8 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.34% (percentile 20, 2026-11-26)
- **CWE:** CWE-125
- **Published:** 2025-04-16T14:12:35.359Z
- **Modified:** 2026-08-05T11:56:41.027Z

## Who should check

- Anyone running Linux \>= 011832b97b311bb9e3c27945bc0d1089a14209c9, \< 19e6817f84000d0b06f09fd69ebd56217842c122; \>= 011832b97b311bb9e3c27945bc0d1089a14209c9, \< 4524b7febdd55fb99ae2e1f48db64019fa69e643; \>= 011832b97b311bb9e3c27945bc0d1089a14209c9, \< 1a86ae57b2600e5749f5f674e9d4296ac00c69a8; \>= 011832b97b311bb9e3c27945bc0d1089a14209c9, \< 6ebc5030e0c5a698f1dd9a6684cddf6ccaed64a0
- Anyone running Linux 6.9

## 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.

## Affected and fixed versions

- Linux: \>= 011832b97b311bb9e3c27945bc0d1089a14209c9, \< 19e6817f84000d0b06f09fd69ebd56217842c122; \>= 011832b97b311bb9e3c27945bc0d1089a14209c9, \< 4524b7febdd55fb99ae2e1f48db64019fa69e643; \>= 011832b97b311bb9e3c27945bc0d1089a14209c9, \< 1a86ae57b2600e5749f5f674e9d4296ac00c69a8; \>= 011832b97b311bb9e3c27945bc0d1089a14209c9, \< 6ebc5030e0c5a698f1dd9a6684cddf6ccaed64a0 (cvelist)
- Linux: 6.9 (cvelist)

## Mitigation

- Upgrade Linux to 6ebc5030e0c5a698f1dd9a6684cddf6ccaed64a0 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2025-22087. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2025-22087.md
Affected: Linux >= 011832b97b311bb9e3c27945bc0d1089a14209c9, < 19e6817f84000d0b06f09fd69ebd56217842c122; >= 011832b97b311bb9e3c27945bc0d1089a14209c9, < 4524b7febdd55fb99ae2e1f48db64019fa69e643; >= 011832b97b311bb9e3c27945bc0d1089a14209c9, < 1a86ae57b2600e5749f5f674e9d4296ac00c69a8; >= 011832b97b311bb9e3c2794…
Fixed in: Linux 19e6817f84000d0b06f09fd69ebd56217842c122, Linux 4524b7febdd55fb99ae2e1f48db64019fa69e643, Linux 1a86ae57b2600e5749f5f674e9d4296ac00c69a8, Linux 6ebc5030e0c5a698f1dd9a6684cddf6ccaed64a0

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2025-22087 being exploited?

There is no confirmed exploitation: CVE-2025-22087 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.34% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2025-22087?

High: CVSS 7.8 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2025-22087?

Linux \>= 011832b97b311bb9e3c27945bc0d1089a14209c9, \< 19e6817f84000d0b06f09fd69ebd56217842c122; \>= 011832b97b311bb9e3c27945bc0d1089a14209c9, \< 4524b7febdd55fb99ae2e1f48db64019fa69e643; \>= 011832b97b311bb9e3c27945bc0d1089a14209c9, \< 1a86ae57b2600e5749f5f674e9d4296ac00c69a8; \>= 011832b97b311bb9e3c27945bc0d1089a14209c9, \< 6ebc5030e0c5a698f1dd9a6684cddf6ccaed64a0; Linux 6.9.

### Is there a fix for CVE-2025-22087?

Yes. Fixed in Linux 19e6817f84000d0b06f09fd69ebd56217842c122, Linux 4524b7febdd55fb99ae2e1f48db64019fa69e643, Linux 1a86ae57b2600e5749f5f674e9d4296ac00c69a8, Linux 6ebc5030e0c5a698f1dd9a6684cddf6ccaed64a0. Upgrade Linux to 6ebc5030e0c5a698f1dd9a6684cddf6ccaed64a0 or later.

### How do I check if I'm affected by CVE-2025-22087?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <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>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2025-22087>

HTML: <https://flawdb.com/CVE-2025-22087> · JSON: <https://flawdb.com/api/v1/entries/CVE-2025-22087>
