CVE-2025-38069
PCI: endpoint: pci-epf-test: Fix double free that causes kernel to oops
Check your servers for CVE-2025-38069
The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2025-38069 affects the running kernel, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.
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]
Exploitation
EPSS 0.24%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 16.3% of all scored CVEs. Scores of 1 Dec 2026.
Affected products
As the CNA lists them.
| Product | Versions |
|---|---|
| Linux |
affected from 349e7a85b25fa6ee82902d9be2cc5f3bec815120, before e2e43854ab72a9d4908ac2bf6087f80aa138a8b5 affected from 349e7a85b25fa6ee82902d9be2cc5f3bec815120, before 761db4ca3a469f2070757acd4e104dff5125ca99 affected from 349e7a85b25fa6ee82902d9be2cc5f3bec815120, before fe2329eff5bee461ebcafadb6ca1df0cbf5945fd affected from 349e7a85b25fa6ee82902d9be2cc5f3bec815120, before 8b83893d1f6c6061a7d58169ecdf9d5ee9f306ee affected from 349e7a85b25fa6ee82902d9be2cc5f3bec815120, before 934e9d137d937706004c325fa1474f9e3f1ba10a
Other versions: unaffected
|
| Linux |
affected 4.12 unaffected before 4.12 unaffected from 6.1.191 up to and including 6.1.* unaffected from 6.6.160 up to and including 6.6.* unaffected from 6.12.31 up to and including 6.12.* unaffected from 6.14.9 up to and including 6.14.* unaffected 6.15 and later
Other versions: affected
|
Is my server affected?
This CVE is in the Linux kernel. Compare the running kernel with the fixed kernel version of your distribution, and reboot after a kernel update:
uname -r
# Debian, Ubuntu: does the changelog of the running kernel name the CVE?
zgrep -l CVE-2025-38069 /usr/share/doc/linux-image-$(uname -r)/changelog.Debian.gz
# RHEL, Rocky, Alma
rpm -q --changelog kernel | grep CVE-2025-38069
With Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:
trivy rootfs --scanners vuln / | grep CVE-2025-38069
trivy image --scanners vuln IMAGE | grep CVE-2025-38069
Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.
References
Other references
- https://git.kernel.org/stable/c/e2e43854ab72a9d4908ac2bf6087f80aa138a8b5 git.kernel.org
- https://git.kernel.org/stable/c/761db4ca3a469f2070757acd4e104dff5125ca99 git.kernel.org
- https://git.kernel.org/stable/c/fe2329eff5bee461ebcafadb6ca1df0cbf5945fd git.kernel.org
- https://git.kernel.org/stable/c/8b83893d1f6c6061a7d58169ecdf9d5ee9f306ee git.kernel.org
- https://git.kernel.org/stable/c/934e9d137d937706004c325fa1474f9e3f1ba10a git.kernel.org
Source: the record CVE-2025-38069 of the CVE List (CVE Program), CVE Terms of Use; EPSS of FIRST. The text of the record is shown as published. Data sources and licences.
Vulnpocalypse