CVE-2025-38060: bpf: copy_verifier_state() should copy 'loop_entry' field
In the Linux kernel, the following vulnerability has been resolved:
bpf: copy_verifier_state() should copy 'loop_entry' field
The bpf_verifier_state.loop_entry state should be copied by
copy_verifier_state(). Otherwise, .loop_entry values from unrelated
states would poison env->cur_state.
Additionally, env->stack should not contain any states with
.loop_entry != NULL. The states in env->stack are yet to be verified,
while .loop_entry is set for states that reached an equivalent state.
This means that env->cur_state->loop_entry should always be NULL after
pop_stack().
See the selftest in the next commit for an example of the program that
is not safe yet is accepted by verifier w/o this fix.
This change has some verification performance impact for selftests:
File Program Insns (A) Insns (B) Insns (DIFF) States (A) States (B) States (DIFF)
---------------------------------- ---------------------------- --------- --------- -------------- ---------- ---------- -------------
arena_htab.bpf.o arena_htab_llvm 717 426 -291 (-40.59%) 57 37 -20 (-35.09%)
arena_htab_asm.bpf.o arena_htab_asm 597 445 -152 (-25.46%) 47 37 -10 (-21.28%)
arena_list.bpf.o arena_list_del 309 279 -30 (-9.71%) 23 14 -9 (-39.13%)
iters.bpf.o iter_subprog_check_stacksafe 155 141 -14 (-9.03%) 15 14 -1 (-6.67%)
iters.bpf.o iter_subprog_iters 1094 1003 -91 (-8.32%) 88 83 -5 (-5.68%)
iters.bpf.o loop_state_deps2 479 725 +246 (+51.36%) 46 63 +17 (+36.96%)
kmem_cache_iter.bpf.o open_coded_iter 63 59 -4 (-6.35%) 7 6 -1 (-14.29%)
verifier_bits_iter.bpf.o max_words 92 84 -8 (-8.70%) 8 7 -1 (-12.50%)
verifier_iterating_callbacks.bpf.o cond_break2 113 107 -6 (-5.31%) 12 12 +0 (+0.00%)
And significant negative impact for sched_ext:
File Program Insns (A) Insns (B) Insns (DIFF) States (A) States (B) States (DIFF)
----------------- ---------------------- --------- --------- -------------------- ---------- ---------- ------------------
bpf.bpf.o lavd_init 7039 14723 +7684 (+109.16%) 490 1139 +649 (+132.45%)
bpf.bpf.o layered_dispatch 11485 10548 -937 (-8.16%) 848 762 -86 (-10.14%)
bpf.bpf.o layered_dump 7422 1000001 +992579 (+13373.47%) 681 31178 +30497 (+4478.27%)
bpf.bpf.o layered_enqueue 16854 71127 +54273 (+322.02%) 1611 6450 +4839 (+300.37%)
bpf.bpf.o p2dq_dispatch 665 791 +126 (+18.95%) 68 78 +10 (+14.71%)
bpf.bpf.o p2dq_init 2343 2980 +637 (+27.19%) 201 237 +36 (+17.91%)
bpf.bpf.o refresh_layer_cpumasks 16487 674760 +658273 (+3992.68%) 1770 65370 +63600 (+3593.22%)
bpf.bpf.o rusty_select_cpu 1937 40872 +38935 (+2010.07%) 177 3210 +3033 (+1713.56%)
scx_central.bpf.o central_dispatch 636 2687 +2051 (+322.48%) 63 227 +164 (+260.32%)
scx_nest.bpf.o nest_init 636 815 +179 (+28.14%) 60 73 +13 (+21.67%)
scx_qmap.bpf.o qmap_dispatch
---truncated---
Security readout for executives and security teams
Plain-English summary
A Linux eBPF safety-checking flaw can allow an unsafe program to pass verification. Exploitation requires local, low-privileged access according to the CVSS vector; it is not directly remote. Successful abuse could seriously affect system confidentiality, integrity, and availability, but the supplied sources do not demonstrate exploitation.
Executive priority
Treat this as an accelerated patching item, prioritizing shared Linux systems where less-trusted local users may access eBPF capabilities. It is high severity but not evidenced as actively exploited or remotely reachable. Require distribution confirmation because the supplied version mapping is incomplete and inconsistent.
Technical view
copy_verifier_state() failed to copy bpf_verifier_state.loop_entry, allowing values from unrelated states to contaminate env->cur_state. This state-tracking error could cause the eBPF verifier to accept an unsafe program. The referenced Linux stable commits correct the verifier logic; the bundle does not establish the subsequent exploitation mechanism.
Likely exposure
Exposure is limited to Linux kernels containing the vulnerable verifier code and users able to reach the affected eBPF path. The bundle names 6.7, 6.12.31, 6.14.9, and 6.15 as affected, but its version data is inconsistent. Confirm distribution backports rather than relying solely on version strings.
Exploitation context
CISA KEV status is false, and the supplied sources provide no evidence of active exploitation or a public working exploit. The CVSS vector indicates a local attacker with low privileges, low attack complexity, and no user interaction. Actual reachability depends on whether the attacker can submit programs to the vulnerable eBPF verifier.
Researcher notes
The fix copies loop_entry during verifier-state cloning and expects loop_entry to be null after pop_stack(). The source reports substantial verification-performance regressions for some sched_ext programs and describes follow-on scalability changes. Exact affected and fixed release boundaries, exploit reliability, and post-verifier primitives are not established by the supplied bundle.
Mitigation direction
Obtain a distribution-supported kernel containing the referenced Linux stable fix or an equivalent backport.
Apply the approved kernel update using the distribution's documented process.
Reboot affected systems so they run the corrected kernel.
Consult Linux and distribution advisories for temporary controls if immediate updating is impossible.
Validation and detection
Inventory running kernels and identify systems matching the vendor's affected release or package guidance.
Confirm the installed kernel package contains one referenced fix or a documented equivalent backport.
Verify the corrected kernel is running after reboot, not merely installed.
Use vendor-supported verifier regression tests where available and monitor for operational performance changes.
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-38060 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
4Source 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.