CVE-2025-37958
JSON

5.5medium

mm/huge_memory: fix dereferencing invalid pmd migration entry

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

Description

In the Linux kernel, the following vulnerability has been resolved: mm/huge_memory: fix dereferencing invalid pmd migration entry When migrating a THP, concurrent access to the PMD migration entry during a deferred split scan can lead to an invalid address access, as illustrated below. To prevent this invalid access, it is necessary to check the PMD migration entry and return early. In this context, there is no need to use pmd_to_swp_entry and pfn_swap_entry_to_page to verify the equality of the target folio. Since the PMD migration entry is locked, it cannot be served as the target. Mailing list discussion and explanation from Hugh Dickins: "An anon_vma lookup points to a location which may contain the folio of interest, but might instead contain another folio: and weeding out those other folios is precisely what the "folio != pmd_folio((*pmd)" check (and the "risk of replacing the wrong folio" comment a few lines above it) is for." BUG: unable to handle page fault for address: ffffea60001db008 CPU: 0 UID: 0 PID: 2199114 Comm: tee Not tainted 6.14.0+ #4 NONE Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 RIP: 0010:split_huge_pmd_locked+0x3b5/0x2b60 Call Trace: <TASK> try_to_migrate_one+0x28c/0x3730 rmap_walk_anon+0x4f6/0x770 unmap_folio+0x196/0x1f0 split_huge_page_to_list_to_order+0x9f6/0x1560 deferred_split_scan+0xac5/0x12a0 shrinker_debugfs_scan_write+0x376/0x470 full_proxy_write+0x15c/0x220 vfs_write+0x2fc/0xcb0 ksys_write+0x146/0x250 do_syscall_64+0x6a/0x120 entry_SYSCALL_64_after_hwframe+0x76/0x7e The bug is found by syzkaller on an internal kernel, then confirmed on upstream.

Affected

Product or packageVersionsReported by
Linux Linuxfrom 84c3fc4e9c563d8fb91cfdf5948da48fe1af34d3 before 753f142f7ff7d2223a47105b61e1efd91587d711, from 84c3fc4e9c563d8fb91cfdf5948da48fe1af34d3 before 9468afbda3fbfcec21ac8132364dff3dab945faf, from 84c3fc4e9c563d8fb91cfdf5948da48fe1af34d3 before ef5706bed97e240b4abf4233ceb03da7336bc775, from 84c3fc4e9c563d8fb91cfdf5948da48fe1af34d3 before 22f6368768340260e862f35151d2e1c55cb1dc75, from 84c3fc4e9c563d8fb91cfdf5948da48fe1af34d3 before 3977946f61cdba87b6b5aaf7d7094e96089583a5, from 84c3fc4e9c563d8fb91cfdf5948da48fe1af34d3 before 6166c3cf405441f7147b322980144feb3cefc617, from 84c3fc4e9c563d8fb91cfdf5948da48fe1af34d3 before fbab262b0c8226c697af1851a424896ed47dedcc, from 84c3fc4e9c563d8fb91cfdf5948da48fe1af34d3 before be6e843fc51a584672dfd9c4a6a24c8cb81d5fb7 and 1 more
Not affected: before 4.14, from 5.4.295 up to 5.4.*, from 5.10.239 up to 5.10.*, from 5.15.186 up to 5.15.*, from 6.1.142 up to 6.1.*, from 6.6.95 up to 6.6.*
CVE List
linux linux_kernelfrom 4.14 before 5.4.295, from 5.5 before 5.10.239, from 5.11 before 5.15.186, from 5.16 before 6.1.142, from 6.2 before 6.6.95, from 6.7 before 6.12.29, from 6.13 before 6.14.7, 6.15NVD
debian debian_linux11.0NVD

Classification

CWE-476

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/huge_memory: fix dereferencing invalid pmd migration entry When migrating a THP, concurrent access to the PMD migration entry during a deferred split scan can lead to an invalid address access, as illustrated below. To prevent this invalid access, it is necessary to check the PMD migration entry and return early. In this context, there is no need to use pmd_to_swp_entry and pfn_swap_entry_to_page to verify the equality of the target folio. Since the PMD migration entry is locked, it cannot be served as the target. Mailing list discussion and explanation from Hugh Dickins: "An anon_vma lookup points to a location which may contain the folio of interest, but might instead contain another folio: and weeding out those other folios is precisely what the "folio != pmd_folio((*pmd)" check (and the "risk of replacing the wrong folio" comment a few lines above it) is for." BUG: unable to handle page fault for address: ffffea60001db008 CPU: 0 UID: 0 PID: 2199114 Comm: tee Not tainted 6.14.0+ #4 NONE Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 RIP: 0010:split_huge_pmd_locked+0x3b5/0x2b60 Call Trace: <TASK> try_to_migrate_one+0x28c/0x3730 rmap_walk_anon+0x4f6/0x770 unmap_folio+0x196/0x1f0 split_huge_page_to_list_to_order+0x9f6/0x1560 deferred_split_scan+0xac5/0x12a0 shrinker_debugfs_scan_write+0x376/0x470 full_proxy_write+0x15c/0x220 vfs_write+0x2fc/0xcb0 ksys_write+0x146/0x250 do_syscall_64+0x6a/0x120 entry_SYSCALL_64_after_hwframe+0x76/0x7e The bug is found by syzkaller on an internal kernel, then confirmed on upstream.

NVD (es)

En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: mm/huge_memory: se corrige la desreferenciación de una entrada de migración de PMD no válida. Al migrar un THP, el acceso simultáneo a la entrada de migración de PMD durante un escaneo dividido diferido puede provocar un acceso no válido a una dirección, como se ilustra a continuación. Para evitar este acceso no válido, es necesario comprobar la entrada de migración de PMD y regresar antes. En este contexto, no es necesario usar pmd_to_swp_entry ni pfn_swap_entry_to_page para verificar la igualdad del folio de destino. Dado que la entrada de migración de PMD está bloqueada, no puede servir como destino. Discusión y explicación de Hugh Dickins en la lista de correo: "Una búsqueda anon_vma apunta a una ubicación que podría contener el folio de interés, pero que en su lugar podría contener otro folio: y eliminar esos otros folios es precisamente para lo que sirve la comprobación "folio != pmd_folio((*pmd)" (y el comentario "riesgo de reemplazar el folio equivocado" unas líneas más arriba)." ERROR: no se puede gestionar el fallo de página para la dirección: ffffea60001db008 CPU: 0 UID: 0 PID: 2199114 Comm: tee No contaminado 6.14.0+ #4 NINGUNO Nombre del hardware: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 RIP: 0010: pmd_enorme_división_bloqueada+0x3b5/0x2b60 Rastreo de llamadas: try_to_migrate_one+0x28c/0x3730 rmap_walk_anon+0x4f6/0x770 unmap_folio+0x196/0x1f0 split_huge_page_to_list_to_order+0x9f6/0x1560 deferred_split_scan+0xac5/0x12a0 shrinker_debugfs_scan_write+0x376/0x470 full_proxy_write+0x15c/0x220 vfs_write+0x2fc/0xcb0 ksys_write+0x146/0x250 do_syscall_64+0x6a/0x120 entry_SYSCALL_64_after_hwframe+0x76/0x7e El error fue detectado por syzkaller en un kernel interno, y luego confirmado en upstream.

References

Sources

SourceRecordLicence
CVE ListCVE-2025-37958 changed 2026-11-05CVE Terms of Use
NVDCVE-2025-37958 changed 2026-11-05Public domain