CVE-2025-22087: bpf: Fix array bounds error with may_goto
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.
Security readout for executives and security teams
Plain-English summary
A local, low-privileged user may be able to trigger an out-of-bounds Linux kernel access through BPF program handling. Successful exploitation could compromise confidentiality, integrity, and availability. The supplied CVSS score is 7.8, making this a high-severity issue, but the sources do not establish remote exploitation or attacks in the wild.
Executive priority
Treat as a high-priority kernel maintenance issue, especially on shared Linux systems with untrusted local users. Schedule vendor-approved updates promptly after compatibility testing. Emergency internet-facing remediation is not supported by the supplied evidence because the attack vector is local and active exploitation is unconfirmed.
Technical view
The BPF may_goto operation consumes eight additional stack bytes. After program rewriting, stale stack-size accounting can produce an out-of-range interpreters[] index. The correction re-evaluates stack size, rejects affected non-JIT loading paths, and adds warnings around unsafe interpreter or JIT execution conditions.
Likely exposure
Exposure is limited to Linux systems running an affected kernel and permitting a local, low-privileged actor to reach BPF program-loading paths. The bundle identifies 6.9, 6.12.23, 6.13.11, 6.14.2, and 6.15 as affected, but its version data is ambiguous and should be verified against distribution guidance.
Exploitation context
The CVSS vector requires local access and low privileges, with no user interaction. Potential impact is high across confidentiality, integrity, and availability. The CVE is not listed as KEV in the supplied bundle, and no cited source reports active exploitation or provides evidence of a public exploit.
Researcher notes
The core defect is inconsistent stack-size accounting after BPF rewriting involving may_goto. Configuration-specific handling covers non-JIT indexing and JIT-requested execution warnings. The source bundle supplies multiple stable-tree commits but does not map each commit to an exact corrected release, so branch-specific ancestry and distribution backports require verification.
Mitigation direction
Update to a vendor-supported kernel containing the applicable upstream stable fix.
Check Linux distribution advisories for corrected package versions and required reboot guidance.
Until updated, restrict BPF program loading to trusted administrators where operationally feasible.
Prioritize shared or multi-user systems where untrusted local users can access BPF functionality.
Validation and detection
Inventory kernel versions across Linux hosts and compare them with distribution security advisories.
Verify the installed kernel source or package includes the applicable referenced stable fix.
Confirm updated hosts rebooted into the corrected kernel rather than retaining the vulnerable kernel.
Review kernel diagnostics for BPF interpreter or execution warnings described by the correction.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cve · low confidence lookup
CVE-2025-22087 mapping review
Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
1CVSS vectors
3Timeline events
0ADP providers
5Source links
CVSS vector scores
1 official score
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.