CVE-2025-39844

In the Linux kernel, the following vulnerability has been resolved: mm: move page table sync declarations to linux/pgtable.h During our internal testing, we started observing intermittent boot failures when the machine uses 4-level paging and has a large amount of persistent memory: BUG: unable to handle page fault for address: ffffe70000000034 #PF: supervisor write access in kernel mode #PF: error_code(0x0002) - not-present page PGD 0 P4D 0 Oops: 0002 [#1] SMP NOPTI RIP: 0010:__init_single_page+0x9/0x6d Call Trace: <TASK> __init_zone_device_page+0x17/0x5d memmap_init_zone_device+0x154/0x1bb pagemap_range+0x2e0/0x40f memremap_pages+0x10b/0x2f0 devm_memremap_pages+0x1e/0x60 dev_dax_probe+0xce/0x2ec [device_dax] dax_bus_probe+0x6d/0xc9 [... snip ...] </TASK> It turns out that the kernel panics while initializing vmemmap (struct page array) when the vmemmap region spans two PGD entries, because the new PGD entry is only installed in init_mm.pgd, but not in the page tables of other tasks. And looking at __populate_section_memmap(): if (vmemmap_can_optimize(altmap, pgmap)) // does not sync top level page tables r = vmemmap_populate_compound_pages(pfn, start, end, nid, pgmap); else // sync top level page tables in x86 r = vmemmap_populate(start, end, nid, altmap); In the normal path, vmemmap_populate() in arch/x86/mm/init_64.c synchronizes the top level page table (See commit 9b861528a801 ("x86-64, mem: Update all PGDs for direct mapping and vmemmap mapping changes")) so that all tasks in the system can see the new vmemmap area. However, when vmemmap_can_optimize() returns true, the optimized path skips synchronization of top-level page tables. This is because vmemmap_populate_compound_pages() is implemented in core MM code, which does not handle synchronization of the top-level page tables. Instead, the core MM has historically relied on each architecture to perform this synchronization manually. We're not the first party to encounter a crash caused by not-sync'd top level page tables: earlier this year, Gwan-gyeong Mun attempted to address the issue [1] [2] after hitting a kernel panic when x86 code accessed the vmemmap area before the corresponding top-level entries were synced. At that time, the issue was believed to be triggered only when struct page was enlarged for debugging purposes, and the patch did not get further updates. It turns out that current approach of relying on each arch to handle the page table sync manually is fragile because 1) it's easy to forget to sync the top level page table, and 2) it's also easy to overlook that the kernel should not access the vmemmap and direct mapping areas before the sync. # The solution: Make page table sync more code robust and harder to miss To address this, Dave Hansen suggested [3] [4] introducing {pgd,p4d}_populate_kernel() for updating kernel portion of the page tables and allow each architecture to explicitly perform synchronization when installing top-level entries. With this approach, we no longer need to worry about missing the sync step, reducing the risk of future regressions. The new interface reuses existing ARCH_PAGE_TABLE_SYNC_MASK, PGTBL_P*D_MODIFIED and arch_sync_kernel_mappings() facility used by vmalloc and ioremap to synchronize page tables. pgd_populate_kernel() looks like this: static inline void pgd_populate_kernel(unsigned long addr, pgd_t *pgd, p4d_t *p4d) { pgd_populate(&init_mm, pgd, p4d); if (ARCH_PAGE_TABLE_SYNC_MASK & PGTBL_PGD_MODIFIED) arch_sync_kernel_mappings(addr, addr); } It is worth noting that vmalloc() and apply_to_range() carefully synchronizes page tables by calling p*d_alloc_track() and arch_sync_kernel_mappings(), and thus they are not affected by ---truncated---
Configurations

Configuration 1 (hide)

OR cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.17:rc1:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.17:rc2:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.17:rc3:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.17:rc4:*:*:*:*:*:*

Configuration 2 (hide)

cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:*

History

19 Oct 2026, 21:10

Type Values Removed Values Added
Summary
  • (es) En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta: mm: mover las declaraciones de sincronización de tablas de páginas a linux/pgtable.h Durante nuestras pruebas internas, comenzamos a observar fallos de arranque intermitentes cuando la máquina utiliza paginación de 4 niveles y tiene una gran cantidad de memoria persistente: BUG: incapaz de manejar fallo de página para la dirección: ffffe70000000034 #PF: acceso de escritura de supervisor en modo kernel #PF: código_de_error(0x0002) - página no presente PGD 0 P4D 0 Oops: 0002 [#1] SMP NOPTI RIP: 0010:__init_single_page+0x9/0x6d Call Trace: <TASK> __init_zone_device_page+0x17/0x5d memmap_init_zone_device+0x154/0x1bb pagemap_range+0x2e0/0x40f memremap_pages+0x10b/0x2f0 devm_memremap_pages+0x1e/0x60 dev_dax_probe+0xce/0x2ec [device_dax] dax_bus_probe+0x6d/0xc9 [... recortado ...] </TASK> Resulta que el kernel entra en pánico mientras inicializa vmemmap (array de struct page) cuando la región vmemmap abarca dos entradas PGD, porque la nueva entrada PGD solo se instala en init_mm.pgd, pero no en las tablas de páginas de otras tareas. Y mirando a __populate_section_memmap(): if (vmemmap_can_optimize(altmap, pgmap)) // no sincroniza las tablas de páginas de nivel superior r = vmemmap_populate_compound_pages(pfn, start, end, nid, pgmap); else // sincroniza las tablas de páginas de nivel superior en x86 r = vmemmap_populate(start, end, nid, altmap); En la ruta normal, vmemmap_populate() en arch/x86/mm/init_64.c sincroniza la tabla de páginas de nivel superior (Ver commit 9b861528a801 ('x86-64, mem: Actualizar todos los PGD para mapeo directo y cambios de mapeo de vmemmap')) para que todas las tareas en el sistema puedan ver la nueva área vmemmap. Sin embargo, cuando vmemmap_can_optimize() devuelve verdadero, la ruta optimizada omite la sincronización de las tablas de páginas de nivel superior. Esto se debe a que vmemmap_populate_compound_pages() está implementado en el código MM central, el cual no maneja la sincronización de las tablas de páginas de nivel superior. En cambio, el MM central ha dependido históricamente de cada arquitectura para realizar esta sincronización manualmente. No somos la primera parte en encontrar un fallo causado por tablas de páginas de nivel superior no sincronizadas: a principios de este año, Gwan-gyeong Mun intentó abordar el problema [1] [2] después de experimentar un pánico del kernel cuando el código x86 accedió al área vmemmap antes de que las entradas de nivel superior correspondientes fueran sincronizadas. En ese momento, se creía que el problema se activaba solo cuando la estructura de página (struct page) se ampliaba con fines de depuración, y el parche no recibió más actualizaciones. Resulta que el enfoque actual de depender de cada arquitectura para manejar la sincronización manual de la tabla de páginas es frágil porque 1) es fácil olvidar sincronizar la tabla de páginas de nivel superior, y 2) también es fácil pasar por alto que el kernel no debe acceder a las áreas vmemmap y de mapeo directo antes de la sincronización. # La solución: Hacer que la sincronización de la tabla de páginas sea más robusta en el código y más difícil de pasar por alto Para abordar esto, Dave Hansen sugirió [3] [4] introducir {pgd,p4d}_populate_kernel() para actualizar la porción del kernel de las tablas de páginas y permitir que cada arquitectura realice explícitamente la sincronización al instalar entradas de nivel superior. Con este enfoque, ya no necesitamos preocuparnos por omitir el paso de sincronización, reduciendo el riesgo de futuras regresiones. La nueva interfaz reutiliza la facilidad existente ARCH_PAGE_TABLE_SYNC_MASK, PGTBL_P*D_MODIFIED y arch_sync_kernel_mappings() utilizada por vmalloc y ioremap para sincronizar tablas de páginas. pgd_populate_kernel() se ve así: static inline void --TRUNCADO--

Information

Published : 2025-09-19 16:15

Updated : 2026-10-19 21:10


NVD link : CVE-2025-39844

Mitre link : CVE-2025-39844

CVE.ORG link : CVE-2025-39844


JSON object : View

Products Affected

debian

  • debian_linux

linux

  • linux_kernel