CVE-2025-38502: bpf: Fix oob access in cgroup local storage
In the Linux kernel, the following vulnerability has been resolved:
bpf: Fix oob access in cgroup local storage
Lonial reported that an out-of-bounds access in cgroup local storage
can be crafted via tail calls. Given two programs each utilizing a
cgroup local storage with a different value size, and one program
doing a tail call into the other. The verifier will validate each of
the indivial programs just fine. However, in the runtime context
the bpf_cg_run_ctx holds an bpf_prog_array_item which contains the
BPF program as well as any cgroup local storage flavor the program
uses. Helpers such as bpf_get_local_storage() pick this up from the
runtime context:
ctx = container_of(current->bpf_ctx, struct bpf_cg_run_ctx, run_ctx);
storage = ctx->prog_item->cgroup_storage[stype];
if (stype == BPF_CGROUP_STORAGE_SHARED)
ptr = &READ_ONCE(storage->buf)->data[0];
else
ptr = this_cpu_ptr(storage->percpu_buf);
For the second program which was called from the originally attached
one, this means bpf_get_local_storage() will pick up the former
program's map, not its own. With mismatching sizes, this can result
in an unintended out-of-bounds access.
To fix this issue, we need to extend bpf_map_owner with an array of
storage_cookie[] to match on i) the exact maps from the original
program if the second program was using bpf_get_local_storage(), or
ii) allow the tail call combination if the second program was not
using any of the cgroup local storage maps.
Security readout for executives and security teams
Plain-English summary
A Linux kernel BPF flaw can make one program use another program’s differently sized cgroup storage after a tail call. The mismatch can access memory outside intended bounds. A local, low-privileged attacker reaching this BPF path could compromise confidentiality, integrity, or availability. The supplied CVSS score is 7.8.
Executive priority
Schedule expedited remediation where relevant BPF capability is reachable by local users. This is not remotely exploitable according to the supplied CVSS vector, but potential confidentiality, integrity, and availability impact is high. Use normal emergency-testing controls because kernel updates and reboots can affect service availability.
Technical view
During a BPF tail call, bpf_get_local_storage() can resolve storage from the original program instead of the callee’s map. Differing value sizes can cause out-of-bounds runtime access even though the verifier accepts both programs separately. Linux’s fix adds storage cookies to enforce compatible maps or permit callees using no cgroup local storage.
Likely exposure
The record identifies Linux 5.9, 5.15.192, 6.1.151, 6.6.105, 6.12.46, 6.16.1, and 6.17 as affected. Practical exposure requires local access to the relevant BPF and cgroup functionality. Distribution backports may change package-level status, so kernel version strings alone are insufficient.
Exploitation context
The supplied CVSS vector describes local access, low complexity, low privileges, and no user interaction. The bundle marks this CVE as absent from KEV and provides no evidence of active exploitation. It establishes a craftable condition but does not document public weaponization or attacks.
Researcher notes
The sources establish the root cause and upstream fixes but provide no observed-attack evidence or uniform package-level fixed versions. Distribution backports can make version-only checks unreliable. The anomalous “0” affected-version entry should not be interpreted without consulting the complete vendor record or applicable distribution advisory.
Mitigation direction
Upgrade to a vendor kernel release incorporating the applicable Linux stable fix, then reboot into that kernel.
Consult distribution or appliance vendor guidance to confirm fixed packages and backports for every deployed kernel branch.
Prioritize systems where local low-privileged users can access the relevant BPF and cgroup functionality.
If patching is delayed, restrict local and BPF access according to vendor-supported guidance.
Validation and detection
Inventory installed and running kernel versions across Linux systems.
Compare package versions with vendor advisories, accounting for distribution-maintained backports.
Confirm the running kernel contains the applicable upstream stable fix or documented vendor equivalent.
After rebooting, verify every remediated system is running the intended fixed kernel.
Review which local principals can access relevant BPF and cgroup functionality.
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-38502 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
2ADP providers
9Source 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.