{"id":"CVE-2025-38069","aliases":["CVE-2025-38069"],"related":[],"kind":"vulnerability","state":"published","title":"PCI: endpoint: pci-epf-test: Fix double free that causes kernel to oops","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nPCI: endpoint: pci-epf-test: Fix double free that causes kernel to oops\n\nFix a kernel oops found while testing the stm32_pcie Endpoint driver\nwith handling of PERST# deassertion:\n\nDuring EP initialization, pci_epf_test_alloc_space() allocates all BARs,\nwhich are further freed if epc_set_bar() fails (for instance, due to no\nfree inbound window).\n\nHowever, when pci_epc_set_bar() fails, the error path:\n\n  pci_epc_set_bar() ->\n    pci_epf_free_space()\n\ndoes not clear the previous assignment to epf_test->reg[bar].\n\nThen, if the host reboots, the PERST# deassertion restarts the BAR\nallocation sequence with the same allocation failure (no free inbound\nwindow), creating a double free situation since epf_test->reg[bar] was\ndeallocated and is still non-NULL.\n\nThus, make sure that pci_epf_alloc_space() and pci_epf_free_space()\ninvocations are symmetric, and as such, set epf_test->reg[bar] to NULL\nwhen memory is freed.\n\n[kwilczynski: commit log]","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nPCI: endpoint: pci-epf-test: Fix double free that causes kernel to oops\n\nFix a kernel oops found while testing the stm32_pcie Endpoint driver\nwith handling of PERST# deassertion:\n\nDuring EP initialization, pci_epf_test_alloc_space() allocates all BARs,\nwhich are further freed if epc_set_bar() fails (for instance, due to no\nfree inbound window).\n\nHowever, when pci_epc_set_bar() fails, the error path:\n\n  pci_epc_set_bar() ->\n    pci_epf_free_space()\n\ndoes not clear the previous assignment to epf_test->reg[bar].\n\nThen, if the host reboots, the PERST# deassertion restarts the BAR\nallocation sequence with the same allocation failure (no free inbound\nwindow), creating a double free situation since epf_test->reg[bar] was\ndeallocated and is still non-NULL.\n\nThus, make sure that pci_epf_alloc_space() and pci_epf_free_space()\ninvocations are symmetric, and as such, set epf_test->reg[bar] to NULL\nwhen memory is freed.\n\n[kwilczynski: commit log]","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: PCI: endpoint: pci-epf-test: Se corrige la doble liberación que provoca un error en el kernel. Se corrige un error en el kernel detectado al probar el controlador de endpoint stm32_pcie con el manejo de la deaserción PERST#: Durante la inicialización de EP, pci_epf_test_alloc_space() asigna todos los BAR, que se liberan aún más si epc_set_bar() falla (por ejemplo, debido a que no hay una ventana de entrada libre). Sin embargo, cuando pci_epc_set_bar() falla, la ruta de error: pci_epc_set_bar() -&gt; pci_epf_free_space() no borra la asignación previa a epf_test-&gt;reg[bar]. Luego, si el host se reinicia, la desasignación PERST# reinicia la secuencia de asignación de BAR con el mismo fallo de asignación (sin ventana de entrada libre), lo que crea una situación de doble liberación, ya que epf_test-&gt;reg[bar] se desasignó y sigue siendo distinto de NULL. Por lo tanto, asegúrese de que las invocaciones de pci_epf_alloc_space() y pci_epf_free_space() sean simétricas y, por lo tanto, establezca epf_test-&gt;reg[bar] en NULL cuando se libere memoria. [kwilczynski: registro de confirmaciones]","source":"nvd"}],"published":"2025-06-18T09:33:46.711Z","modified":"2026-10-30T13:18:00.617Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"},"severities":[{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"}],"cwes":["CWE-415"],"affected":[{"ranges":[{"type":"git","introduced":"349e7a85b25fa6ee82902d9be2cc5f3bec815120","fixed":"e2e43854ab72a9d4908ac2bf6087f80aa138a8b5","status":"affected"},{"type":"git","introduced":"349e7a85b25fa6ee82902d9be2cc5f3bec815120","fixed":"761db4ca3a469f2070757acd4e104dff5125ca99","status":"affected"},{"type":"git","introduced":"349e7a85b25fa6ee82902d9be2cc5f3bec815120","fixed":"fe2329eff5bee461ebcafadb6ca1df0cbf5945fd","status":"affected"},{"type":"git","introduced":"349e7a85b25fa6ee82902d9be2cc5f3bec815120","fixed":"8b83893d1f6c6061a7d58169ecdf9d5ee9f306ee","status":"affected"},{"type":"git","introduced":"349e7a85b25fa6ee82902d9be2cc5f3bec815120","fixed":"934e9d137d937706004c325fa1474f9e3f1ba10a","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"4.12","status":"affected"},{"type":"semver","introduced":"0","fixed":"4.12","status":"unaffected"},{"type":"semver","introduced":"6.1.191","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.6.160","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.12.31","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.14.9","lastAffected":"6.14.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"6.15","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"status":"affected","fixed":"6.12.31"},{"status":"affected","introduced":"6.13","fixed":"6.14.9"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/e2e43854ab72a9d4908ac2bf6087f80aa138a8b5","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/761db4ca3a469f2070757acd4e104dff5125ca99","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/fe2329eff5bee461ebcafadb6ca1df0cbf5945fd","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/8b83893d1f6c6061a7d58169ecdf9d5ee9f306ee","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/934e9d137d937706004c325fa1474f9e3f1ba10a","tags":["patch"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-38069","url":"https://www.cve.org/CVERecord?id=CVE-2025-38069","licence":"CVE Terms of Use","modified":"2026-10-30T12:21:39.173Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-38069","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-38069","licence":"Public domain","modified":"2026-10-30T13:18:00.617Z"}],"updatedAt":"2026-11-25T22:58:59.370Z","epss":{"score":0.00241,"percentile":0.16355,"date":"2026-12-01T12:00:22.000Z"}}