CVE-2025-38681
JSON

4.7medium

mm/ptdump: take the memory hotplug lock inside ptdump_walk_pgd()

Severity
4.7medium CVSS:3.1 by NVD
Exploit likelihood
0.17% (higher than 6% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
Linux

Description

In the Linux kernel, the following vulnerability has been resolved: mm/ptdump: take the memory hotplug lock inside ptdump_walk_pgd() Memory hot remove unmaps and tears down various kernel page table regions as required. The ptdump code can race with concurrent modifications of the kernel page tables. When leaf entries are modified concurrently, the dump code may log stale or inconsistent information for a VA range, but this is otherwise not harmful. But when intermediate levels of kernel page table are freed, the dump code will continue to use memory that has been freed and potentially reallocated for another purpose. In such cases, the ptdump code may dereference bogus addresses, leading to a number of potential problems. To avoid the above mentioned race condition, platforms such as arm64, riscv and s390 take memory hotplug lock, while dumping kernel page table via the sysfs interface /sys/kernel/debug/kernel_page_tables. Similar race condition exists while checking for pages that might have been marked W+X via /sys/kernel/debug/kernel_page_tables/check_wx_pages which in turn calls ptdump_check_wx(). Instead of solving this race condition again, let's just move the memory hotplug lock inside generic ptdump_check_wx() which will benefit both the scenarios. Drop get_online_mems() and put_online_mems() combination from all existing platform ptdump code paths.

Affected

Product or packageVersionsReported by
Linux Linuxfrom bbd6ec605c0fc286c3f8ce60b4ed44635361d58b before 3ee9a8c27bfd72c3f465004fa8455785d61be5e8, from bbd6ec605c0fc286c3f8ce60b4ed44635361d58b before 69bea84b06b5e779627e7afdbf4b60a7d231c76f, from bbd6ec605c0fc286c3f8ce60b4ed44635361d58b before ac25ec5fa2bf6e606dc7954488e4dded272fa9cd, from bbd6ec605c0fc286c3f8ce60b4ed44635361d58b before 1636b5e9c3543b87d673e32a47e7c18698882425, from bbd6ec605c0fc286c3f8ce60b4ed44635361d58b before ff40839e018b82c4d756d035f34a63aa2d93be83, from bbd6ec605c0fc286c3f8ce60b4ed44635361d58b before 67995d4244694928ce701928e530b5b4adeb17b4, from bbd6ec605c0fc286c3f8ce60b4ed44635361d58b before ca8c414499f2e5337a95a76be0d21b728ee31c6b, from bbd6ec605c0fc286c3f8ce60b4ed44635361d58b before 59305202c67fea50378dcad0cc199dbc13a0e99a and 1 more
Not affected: before 5.7, from 5.10.241 up to 5.10.*, from 5.15.190 up to 5.15.*, from 6.1.149 up to 6.1.*, from 6.6.103 up to 6.6.*, from 6.12.43 up to 6.12.*
CVE List
linux linux_kernelfrom 5.7 before 5.10.241, from 5.11 before 5.15.190, from 5.16 before 6.1.149, from 6.2 before 6.6.103, from 6.7 before 6.12.43, from 6.13 before 6.15.11, from 6.16 before 6.16.2NVD
debian debian_linux11.0NVD

Classification

CWE-362

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

In the Linux kernel, the following vulnerability has been resolved: mm/ptdump: take the memory hotplug lock inside ptdump_walk_pgd() Memory hot remove unmaps and tears down various kernel page table regions as required. The ptdump code can race with concurrent modifications of the kernel page tables. When leaf entries are modified concurrently, the dump code may log stale or inconsistent information for a VA range, but this is otherwise not harmful. But when intermediate levels of kernel page table are freed, the dump code will continue to use memory that has been freed and potentially reallocated for another purpose. In such cases, the ptdump code may dereference bogus addresses, leading to a number of potential problems. To avoid the above mentioned race condition, platforms such as arm64, riscv and s390 take memory hotplug lock, while dumping kernel page table via the sysfs interface /sys/kernel/debug/kernel_page_tables. Similar race condition exists while checking for pages that might have been marked W+X via /sys/kernel/debug/kernel_page_tables/check_wx_pages which in turn calls ptdump_check_wx(). Instead of solving this race condition again, let's just move the memory hotplug lock inside generic ptdump_check_wx() which will benefit both the scenarios. Drop get_online_mems() and put_online_mems() combination from all existing platform ptdump code paths.

NVD (es)

En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta: mm/ptdump: tomar el bloqueo de hotplug de memoria dentro de ptdump_walk_pgd() La eliminación en caliente de memoria desmapea y desmantela varias regiones de la tabla de páginas del kernel según sea necesario. El código ptdump puede entrar en condición de carrera con modificaciones concurrentes de las tablas de páginas del kernel. Cuando las entradas hoja se modifican concurrentemente, el código de volcado puede registrar información obsoleta o inconsistente para un rango de VA, pero esto no es perjudicial de otra manera. Pero cuando se liberan niveles intermedios de la tabla de páginas del kernel, el código de volcado continuará usando memoria que ha sido liberada y potencialmente reasignada para otro propósito. En tales casos, el código ptdump puede desreferenciar direcciones erróneas, lo que lleva a una serie de problemas potenciales. Para evitar la condición de carrera mencionada anteriormente, plataformas como arm64, riscv y s390 toman el bloqueo de hotplug de memoria, mientras vuelcan la tabla de páginas del kernel a través de la interfaz sysfs /sys/kernel/debug/kernel_page_tables. Existe una condición de carrera similar al verificar páginas que podrían haber sido marcadas como W+X a través de /sys/kernel/debug/kernel_page_tables/check_wx_pages, que a su vez llama a ptdump_check_wx(). En lugar de resolver esta condición de carrera de nuevo, simplemente movamos el bloqueo de hotplug de memoria dentro de ptdump_check_wx() genérico, lo que beneficiará a ambos escenarios. Eliminar la combinación de get_online_mems() y put_online_mems() de todas las rutas de código ptdump de plataforma existentes.

References

https://git.kernel.org/stable/c/3ee9a8c27bfd72c3f465004fa8455785d61be5e8patch
https://git.kernel.org/stable/c/69bea84b06b5e779627e7afdbf4b60a7d231c76fpatch
https://git.kernel.org/stable/c/ac25ec5fa2bf6e606dc7954488e4dded272fa9cdpatch
https://git.kernel.org/stable/c/1636b5e9c3543b87d673e32a47e7c18698882425patch
https://git.kernel.org/stable/c/ff40839e018b82c4d756d035f34a63aa2d93be83patch
https://git.kernel.org/stable/c/67995d4244694928ce701928e530b5b4adeb17b4patch
https://git.kernel.org/stable/c/ca8c414499f2e5337a95a76be0d21b728ee31c6bpatch
https://git.kernel.org/stable/c/59305202c67fea50378dcad0cc199dbc13a0e99apatch
https://lists.debian.org/debian-lts-announce/2025/10/msg00008.htmlthird-party-advisory
https://lists.debian.org/debian-lts-announce/2025/10/msg00007.htmlthird-party-advisory
https://cert-portal.siemens.com/productcert/html/ssa-032379.html
https://cert-portal.siemens.com/productcert/html/ssa-019113.html

Sources

SourceRecordLicence
CVE ListCVE-2025-38681 changed 2026-11-10CVE Terms of Use
NVDCVE-2025-38681 changed 2026-11-10Public domain