CVE-2025-37818: LoongArch: Return NULL from huge_pte_offset() for invalid PMD
In the Linux kernel, the following vulnerability has been resolved:
LoongArch: Return NULL from hugepteoffset() for invalid PMD
LoongArch's hugepteoffset() currently returns a pointer to a PMD slot even if the underlying entry points to invalidptetable (indicating no mapping). Callers like smapshugetlbrange() fetch this invalid entry value (the address of invalidptetable) via this pointer.
The generic isswappte() check then incorrectly identifies this address as a swap entry on LoongArch, because it satisfies the "!ptepresent() && !ptenone()" conditions. This misinterpretation, combined with a coincidental match by ismigrationentry() on the address bits, leads to kernel crashes in pfnswapentrytopage().
Fix this at the architecture level by modifying hugepteoffset() to check the PMD entry's content using pmdnone() before returning. If the entry is invalid (i.e., it points to invalidptetable), return NULL instead of the pointer to the slot.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
ubuntu/linux-gcp-6.14to a version that resolves this vulnerability.Fixed in 6.14.0-1011.11~24.04.1 - Upgrade
Upgrade
ubuntu/linux-realtime-6.14to a version that resolves this vulnerability.Fixed in 6.14.0-1010.10~24.04.1 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.1.137-1 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.12.27-1 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.1.137-1Fixed in 6.12.27-1 - Upgrade
Upgrade
debian/linux-6.1to a version that resolves this vulnerability.Fixed in 6.1.137-1~deb11u1 - Compensating control
In LoongArch, modify huge_pte_offset() to check the PMD entry with pmd_none() and return NULL when the entry points to invalid_pte_table.
Event History
Frequently Asked Questions
What is the severity of CVE-2025-37818?
CVE-2025-37818 is classified as a medium-severity vulnerability affecting the Linux kernel.
How do I fix CVE-2025-37818?
To fix CVE-2025-37818, you should upgrade to a patched version of the Linux kernel that addresses this vulnerability.
What specific systems are affected by CVE-2025-37818?
CVE-2025-37818 affects systems running the Linux kernel, particularly those using the LoongArch architecture.
What are the potential impacts of CVE-2025-37818?
The potential impacts of CVE-2025-37818 include instability or incorrect memory management leading to application failures.
Is CVE-2025-37818 publicly known?
Yes, CVE-2025-37818 is a publicly disclosed vulnerability and detailed information is available in security advisories.