{"id":"CVE-2025-37818","aliases":["CVE-2025-37818"],"related":[],"kind":"vulnerability","state":"published","title":"LoongArch: Return NULL from huge_pte_offset() for invalid PMD","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nLoongArch: Return NULL from huge_pte_offset() for invalid PMD\n\nLoongArch's huge_pte_offset() currently returns a pointer to a PMD slot\neven if the underlying entry points to invalid_pte_table (indicating no\nmapping). Callers like smaps_hugetlb_range() fetch this invalid entry\nvalue (the address of invalid_pte_table) via this pointer.\n\nThe generic is_swap_pte() check then incorrectly identifies this address\nas a swap entry on LoongArch, because it satisfies the \"!pte_present()\n&& !pte_none()\" conditions. This misinterpretation, combined with a\ncoincidental match by is_migration_entry() on the address bits, leads to\nkernel crashes in pfn_swap_entry_to_page().\n\nFix this at the architecture level by modifying huge_pte_offset() to\ncheck the PMD entry's content using pmd_none() before returning. If the\nentry is invalid (i.e., it points to invalid_pte_table), return NULL\ninstead of the pointer to the slot.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nLoongArch: Return NULL from huge_pte_offset() for invalid PMD\n\nLoongArch's huge_pte_offset() currently returns a pointer to a PMD slot\neven if the underlying entry points to invalid_pte_table (indicating no\nmapping). Callers like smaps_hugetlb_range() fetch this invalid entry\nvalue (the address of invalid_pte_table) via this pointer.\n\nThe generic is_swap_pte() check then incorrectly identifies this address\nas a swap entry on LoongArch, because it satisfies the \"!pte_present()\n&& !pte_none()\" conditions. This misinterpretation, combined with a\ncoincidental match by is_migration_entry() on the address bits, leads to\nkernel crashes in pfn_swap_entry_to_page().\n\nFix this at the architecture level by modifying huge_pte_offset() to\ncheck the PMD entry's content using pmd_none() before returning. If the\nentry is invalid (i.e., it points to invalid_pte_table), return NULL\ninstead of the pointer to the slot.","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: LoongArch: Devuelve NULL desde huge_pte_offset() para PMD no válido. La función huge_pte_offset() de LoongArch actualmente devuelve un puntero a una ranura PMD incluso si la entrada subyacente apunta a invalid_pte_table (lo que indica que no hay asignación). Llamadores como smaps_hugetlb_range() obtienen este valor de entrada no válido (la dirección de invalid_pte_table) a través de este puntero. La comprobación genérica is_swap_pte() identifica incorrectamente esta dirección como una entrada de intercambio en LoongArch, ya que cumple las condiciones \"!pte_present() &amp;&amp; !pte_none()\". Esta interpretación errónea, combinada con una coincidencia de is_migration_entry() en los bits de dirección, provoca fallos del kernel en pfn_swap_entry_to_page(). Solucione esto a nivel de arquitectura modificando huge_pte_offset() para comprobar el contenido de la entrada PMD mediante pmd_none() antes de regresar. Si la entrada no es válida (es decir, apunta a invalid_pte_table), devuelva NULL en lugar del puntero a la ranura.","source":"nvd"}],"published":"2025-05-08T06:26:13.322Z","modified":"2026-06-17T09:15:30.080Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"},"severities":[{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"}],"cwes":["CWE-476"],"affected":[{"ranges":[{"type":"git","introduced":"fa96b57c149061f71a70bd6582d995f6424fbbf4","fixed":"34256805720993e37adf6127371a1265aea8376a","status":"affected"},{"type":"git","introduced":"fa96b57c149061f71a70bd6582d995f6424fbbf4","fixed":"2ca9380b12711afe95b3589bd82b59623b3c96b3","status":"affected"},{"type":"git","introduced":"fa96b57c149061f71a70bd6582d995f6424fbbf4","fixed":"51424fd171cee6a33f01f7c66b8eb23ac42289d4","status":"affected"},{"type":"git","introduced":"fa96b57c149061f71a70bd6582d995f6424fbbf4","fixed":"b49f085cd671addbda4802d6b9382513f7dd0f30","status":"affected"},{"type":"git","introduced":"fa96b57c149061f71a70bd6582d995f6424fbbf4","fixed":"bd51834d1cf65a2c801295d230c220aeebf87a73","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"5.19","status":"affected"},{"type":"semver","introduced":"0","fixed":"5.19","status":"unaffected"},{"type":"semver","introduced":"6.1.136","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.6.89","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.12.26","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.14.5","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","introduced":"5.19","fixed":"6.1.136"},{"status":"affected","introduced":"6.2","fixed":"6.6.89"},{"status":"affected","introduced":"6.7","fixed":"6.12.26"},{"status":"affected","introduced":"6.13","fixed":"6.14.5"},{"status":"affected","version":"6.15"},{"status":"affected","version":"6.15"},{"status":"affected","version":"6.15"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"status":"affected","version":"11.0"}],"vendor":"debian","product":"debian_linux","cpe":"cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/34256805720993e37adf6127371a1265aea8376a","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/2ca9380b12711afe95b3589bd82b59623b3c96b3","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/51424fd171cee6a33f01f7c66b8eb23ac42289d4","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/b49f085cd671addbda4802d6b9382513f7dd0f30","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/bd51834d1cf65a2c801295d230c220aeebf87a73","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://lists.debian.org/debian-lts-announce/2025/05/msg00045.html","tags":["mailing-list","third-party-advisory"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-37818","url":"https://www.cve.org/CVERecord?id=CVE-2025-37818","licence":"CVE Terms of Use","modified":"2026-05-11T21:15:44.270Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-37818","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-37818","licence":"Public domain","modified":"2026-06-17T09:15:30.080Z"}],"updatedAt":"2026-11-25T22:58:57.798Z","epss":{"score":0.00194,"percentile":0.09528,"date":"2026-12-01T12:00:22.000Z"}}