# CVE-2025-38069: PCI: endpoint: pci-epf-test: Fix double free that causes kernel to oops

> 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, NVD) `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-26)
- **CWE:** CWE-415
- **Published:** 2025-06-18T09:33:46.711Z
- **Modified:** 2026-10-30T13:18:00.617Z

## Who should check

- Anyone running Linux \>= 349e7a85b25fa6ee82902d9be2cc5f3bec815120, \< e2e43854ab72a9d4908ac2bf6087f80aa138a8b5; \>= 349e7a85b25fa6ee82902d9be2cc5f3bec815120, \< 761db4ca3a469f2070757acd4e104dff5125ca99; \>= 349e7a85b25fa6ee82902d9be2cc5f3bec815120, \< fe2329eff5bee461ebcafadb6ca1df0cbf5945fd; \>= 349e7a85b25fa6ee82902d9be2cc5f3bec815120, \< 8b83893d1f6c6061a7d58169ecdf9d5ee9f306ee; \>= 349e7a85b25fa6ee82902d9be2cc5f3bec815120, \< 934e9d137d937706004c325fa1474f9e3f1ba10a
- Anyone running Linux 4.12

## Description

In the Linux kernel, the following vulnerability has been resolved:

PCI: endpoint: pci-epf-test: Fix double free that causes kernel to oops

Fix a kernel oops found while testing the stm32\_pcie Endpoint driver
with handling of PERST\# deassertion:

During EP initialization, pci\_epf\_test\_alloc\_space() allocates all BARs,
which are further freed if epc\_set\_bar() fails (for instance, due to no
free inbound window).

However, when pci\_epc\_set\_bar() fails, the error path:

  pci\_epc\_set\_bar() -\>
    pci\_epf\_free\_space()

does not clear the previous assignment to epf\_test-\>reg\[bar\].

Then, if the host reboots, the PERST\# deassertion restarts the BAR
allocation sequence with the same allocation failure (no free inbound
window), creating a double free situation since epf\_test-\>reg\[bar\] was
deallocated and is still non-NULL.

Thus, make sure that pci\_epf\_alloc\_space() and pci\_epf\_free\_space()
invocations are symmetric, and as such, set epf\_test-\>reg\[bar\] to NULL
when memory is freed.

\[kwilczynski: commit log\]

## Affected and fixed versions

- Linux: \>= 349e7a85b25fa6ee82902d9be2cc5f3bec815120, \< e2e43854ab72a9d4908ac2bf6087f80aa138a8b5; \>= 349e7a85b25fa6ee82902d9be2cc5f3bec815120, \< 761db4ca3a469f2070757acd4e104dff5125ca99; \>= 349e7a85b25fa6ee82902d9be2cc5f3bec815120, \< fe2329eff5bee461ebcafadb6ca1df0cbf5945fd; \>= 349e7a85b25fa6ee82902d9be2cc5f3bec815120, \< 8b83893d1f6c6061a7d58169ecdf9d5ee9f306ee; \>= 349e7a85b25fa6ee82902d9be2cc5f3bec815120, \< 934e9d137d937706004c325fa1474f9e3f1ba10a (cvelist)
- Linux: 4.12 (cvelist)

## Mitigation

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

Details: https://flawdb.com/CVE-2025-38069.md
Affected: Linux >= 349e7a85b25fa6ee82902d9be2cc5f3bec815120, < e2e43854ab72a9d4908ac2bf6087f80aa138a8b5; >= 349e7a85b25fa6ee82902d9be2cc5f3bec815120, < 761db4ca3a469f2070757acd4e104dff5125ca99; >= 349e7a85b25fa6ee82902d9be2cc5f3bec815120, < fe2329eff5bee461ebcafadb6ca1df0cbf5945fd; >= 349e7a85b25fa6ee82902d9…
Fixed in: Linux 761db4ca3a469f2070757acd4e104dff5125ca99, Linux 8b83893d1f6c6061a7d58169ecdf9d5ee9f306ee, Linux 934e9d137d937706004c325fa1474f9e3f1ba10a

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

There is no confirmed exploitation: CVE-2025-38069 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-26).

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

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

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

Linux \>= 349e7a85b25fa6ee82902d9be2cc5f3bec815120, \< e2e43854ab72a9d4908ac2bf6087f80aa138a8b5; \>= 349e7a85b25fa6ee82902d9be2cc5f3bec815120, \< 761db4ca3a469f2070757acd4e104dff5125ca99; \>= 349e7a85b25fa6ee82902d9be2cc5f3bec815120, \< fe2329eff5bee461ebcafadb6ca1df0cbf5945fd; \>= 349e7a85b25fa6ee82902d9be2cc5f3bec815120, \< 8b83893d1f6c6061a7d58169ecdf9d5ee9f306ee; \>= 349e7a85b25fa6ee82902d9be2cc5f3bec815120, \< 934e9d137d937706004c325fa1474f9e3f1ba10a; Linux 4.12.

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

Yes. Fixed in Linux 761db4ca3a469f2070757acd4e104dff5125ca99, Linux 8b83893d1f6c6061a7d58169ecdf9d5ee9f306ee, Linux 934e9d137d937706004c325fa1474f9e3f1ba10a. Upgrade Linux to 934e9d137d937706004c325fa1474f9e3f1ba10a or later.

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

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/fe2329eff5bee461ebcafadb6ca1df0cbf5945fd>
- patch: <https://git.kernel.org/stable/c/8b83893d1f6c6061a7d58169ecdf9d5ee9f306ee>
- patch: <https://git.kernel.org/stable/c/934e9d137d937706004c325fa1474f9e3f1ba10a>
- other: <https://git.kernel.org/stable/c/e2e43854ab72a9d4908ac2bf6087f80aa138a8b5>
- other: <https://git.kernel.org/stable/c/761db4ca3a469f2070757acd4e104dff5125ca99>

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

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