# CVE-2025-38060: bpf: copy\_verifier\_state() should copy 'loop\_entry' field

> 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.30% (percentile 15, 2026-11-28)
- **Published:** 2025-06-18T09:33:39.610Z
- **Modified:** 2026-10-21T13:18:08.210Z

## Who should check

- Anyone running Linux \>= c8f6d285825f61d619c4c2509bfd75eb366db900, \< b7867e55cbcbaed8498b6b96855371eb9afebdc7; \>= 2a0992829ea3864939d917a5c7b48be6629c6217, \< 46ba5757a7a4714e7d3f68cfe118208822cb3d78; \>= 2a0992829ea3864939d917a5c7b48be6629c6217, \< 8b4afd89fa75f738a80ca849126fd3cad77bcbf1; \>= 2a0992829ea3864939d917a5c7b48be6629c6217, \< bbbc02b7445ebfda13e4847f4f1413c6480a85a9; \>= 6.6.15, \< 6.6.160
- Anyone running Linux 6.7

## Description

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

## Affected and fixed versions

- Linux: \>= c8f6d285825f61d619c4c2509bfd75eb366db900, \< b7867e55cbcbaed8498b6b96855371eb9afebdc7; \>= 2a0992829ea3864939d917a5c7b48be6629c6217, \< 46ba5757a7a4714e7d3f68cfe118208822cb3d78; \>= 2a0992829ea3864939d917a5c7b48be6629c6217, \< 8b4afd89fa75f738a80ca849126fd3cad77bcbf1; \>= 2a0992829ea3864939d917a5c7b48be6629c6217, \< bbbc02b7445ebfda13e4847f4f1413c6480a85a9; \>= 6.6.15, \< 6.6.160 (cvelist)
- Linux: 6.7 (cvelist)

## Mitigation

- Upgrade Linux to 6.6.160 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-38060. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2025-38060.md
Affected: Linux >= c8f6d285825f61d619c4c2509bfd75eb366db900, < b7867e55cbcbaed8498b6b96855371eb9afebdc7; >= 2a0992829ea3864939d917a5c7b48be6629c6217, < 46ba5757a7a4714e7d3f68cfe118208822cb3d78; >= 2a0992829ea3864939d917a5c7b48be6629c6217, < 8b4afd89fa75f738a80ca849126fd3cad77bcbf1; >= 2a0992829ea3864939d917a…
Fixed in: Linux 46ba5757a7a4714e7d3f68cfe118208822cb3d78, Linux 8b4afd89fa75f738a80ca849126fd3cad77bcbf1, Linux 6.6.160

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-38060 being exploited?

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

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

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

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

Linux \>= c8f6d285825f61d619c4c2509bfd75eb366db900, \< b7867e55cbcbaed8498b6b96855371eb9afebdc7; \>= 2a0992829ea3864939d917a5c7b48be6629c6217, \< 46ba5757a7a4714e7d3f68cfe118208822cb3d78; \>= 2a0992829ea3864939d917a5c7b48be6629c6217, \< 8b4afd89fa75f738a80ca849126fd3cad77bcbf1; \>= 2a0992829ea3864939d917a5c7b48be6629c6217, \< bbbc02b7445ebfda13e4847f4f1413c6480a85a9; \>= 6.6.15, \< 6.6.160; Linux 6.7.

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

Yes. Fixed in Linux 46ba5757a7a4714e7d3f68cfe118208822cb3d78, Linux 8b4afd89fa75f738a80ca849126fd3cad77bcbf1, Linux 6.6.160. Upgrade Linux to 6.6.160 or later.

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

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/46ba5757a7a4714e7d3f68cfe118208822cb3d78>
- patch: <https://git.kernel.org/stable/c/8b4afd89fa75f738a80ca849126fd3cad77bcbf1>
- patch: <https://git.kernel.org/stable/c/bbbc02b7445ebfda13e4847f4f1413c6480a85a9>
- other: <https://git.kernel.org/stable/c/b7867e55cbcbaed8498b6b96855371eb9afebdc7>

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

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