CVE-2025-37818

Source
https://cve.org/CVERecord?id=CVE-2025-37818
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-37818.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2025-37818
Downstream
Published
2025-05-08T06:26:13Z
Modified
2026-08-12T03:51:17Z
Summary
LoongArch: Return NULL from huge_pte_offset() for invalid PMD
Details

In the Linux kernel, the following vulnerability has been resolved:

LoongArch: Return NULL from huge_pte_offset() for invalid PMD

LoongArch's huge_pte_offset() currently returns a pointer to a PMD slot even if the underlying entry points to invalid_pte_table (indicating no mapping). Callers like smaps_hugetlb_range() fetch this invalid entry value (the address of invalid_pte_table) via this pointer.

The generic is_swap_pte() check then incorrectly identifies this address as a swap entry on LoongArch, because it satisfies the "!pte_present() && !pte_none()" conditions. This misinterpretation, combined with a coincidental match by is_migration_entry() on the address bits, leads to kernel crashes in pfn_swap_entry_to_page().

Fix this at the architecture level by modifying huge_pte_offset() to check the PMD entry's content using pmd_none() before returning. If the entry is invalid (i.e., it points to invalid_pte_table), return NULL instead of the pointer to the slot.

Database specific
{
    "cna_assigner": "Linux",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/37xxx/CVE-2025-37818.json"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
fa96b57c149061f71a70bd6582d995f6424fbbf4
Fixed
34256805720993e37adf6127371a1265aea8376a
Fixed
2ca9380b12711afe95b3589bd82b59623b3c96b3
Fixed
51424fd171cee6a33f01f7c66b8eb23ac42289d4
Fixed
b49f085cd671addbda4802d6b9382513f7dd0f30
Fixed
bd51834d1cf65a2c801295d230c220aeebf87a73

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-37818.json"

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
5.19.0
Fixed
6.1.136
Type
ECOSYSTEM
Events
Introduced
6.2.0
Fixed
6.6.89
Type
ECOSYSTEM
Events
Introduced
6.7.0
Fixed
6.12.26
Type
ECOSYSTEM
Events
Introduced
6.13.0
Fixed
6.14.5

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-37818.json"