{"id":"CVE-2025-37818","state":"PUBLISHED","title":"LoongArch: Return NULL from huge_pte_offset() for invalid PMD","description":"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.","publishedAt":"2025-05-08T06:26:13.322Z","updatedAt":"2026-05-11T21:15:44.270Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"fa96b57c149061f71a70bd6582d995f6424fbbf4","status":"affected","lessThan":"34256805720993e37adf6127371a1265aea8376a","versionType":"git"},{"version":"fa96b57c149061f71a70bd6582d995f6424fbbf4","status":"affected","lessThan":"2ca9380b12711afe95b3589bd82b59623b3c96b3","versionType":"git"},{"version":"fa96b57c149061f71a70bd6582d995f6424fbbf4","status":"affected","lessThan":"51424fd171cee6a33f01f7c66b8eb23ac42289d4","versionType":"git"},{"version":"fa96b57c149061f71a70bd6582d995f6424fbbf4","status":"affected","lessThan":"b49f085cd671addbda4802d6b9382513f7dd0f30","versionType":"git"},{"version":"fa96b57c149061f71a70bd6582d995f6424fbbf4","status":"affected","lessThan":"bd51834d1cf65a2c801295d230c220aeebf87a73","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["arch/loongarch/mm/hugetlbpage.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.19","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.19","versionType":"semver"},{"version":"6.1.136","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.89","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.26","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.14.5","status":"unaffected","lessThanOrEqual":"6.14.*","versionType":"semver"},{"version":"6.15","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["arch/loongarch/mm/hugetlbpage.c"]}],"references":["https://git.kernel.org/stable/c/34256805720993e37adf6127371a1265aea8376a","https://git.kernel.org/stable/c/2ca9380b12711afe95b3589bd82b59623b3c96b3","https://git.kernel.org/stable/c/51424fd171cee6a33f01f7c66b8eb23ac42289d4","https://git.kernel.org/stable/c/b49f085cd671addbda4802d6b9382513f7dd0f30","https://git.kernel.org/stable/c/bd51834d1cf65a2c801295d230c220aeebf87a73","https://lists.debian.org/debian-lts-announce/2025/05/msg00045.html"],"weaknesses":[],"ingestedAt":"2026-10-29T20:09:03.054Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2025/37xxx/CVE-2025-37818.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2025-37818","state":"PUBLISHED","datePublished":"2025-05-08T06:26:13.322Z","dateUpdated":"2026-05-11T21:15:44.270Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2025-04-16T04:51:23.947Z"},"containers":{"cna":{"title":"LoongArch: Return NULL from huge_pte_offset() for invalid PMD","descriptions":[{"lang":"en","value":"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."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"fa96b57c149061f71a70bd6582d995f6424fbbf4","status":"affected","lessThan":"34256805720993e37adf6127371a1265aea8376a","versionType":"git"},{"version":"fa96b57c149061f71a70bd6582d995f6424fbbf4","status":"affected","lessThan":"2ca9380b12711afe95b3589bd82b59623b3c96b3","versionType":"git"},{"version":"fa96b57c149061f71a70bd6582d995f6424fbbf4","status":"affected","lessThan":"51424fd171cee6a33f01f7c66b8eb23ac42289d4","versionType":"git"},{"version":"fa96b57c149061f71a70bd6582d995f6424fbbf4","status":"affected","lessThan":"b49f085cd671addbda4802d6b9382513f7dd0f30","versionType":"git"},{"version":"fa96b57c149061f71a70bd6582d995f6424fbbf4","status":"affected","lessThan":"bd51834d1cf65a2c801295d230c220aeebf87a73","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["arch/loongarch/mm/hugetlbpage.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.19","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.19","versionType":"semver"},{"version":"6.1.136","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.89","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.26","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.14.5","status":"unaffected","lessThanOrEqual":"6.14.*","versionType":"semver"},{"version":"6.15","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["arch/loongarch/mm/hugetlbpage.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/34256805720993e37adf6127371a1265aea8376a"},{"url":"https://git.kernel.org/stable/c/2ca9380b12711afe95b3589bd82b59623b3c96b3"},{"url":"https://git.kernel.org/stable/c/51424fd171cee6a33f01f7c66b8eb23ac42289d4"},{"url":"https://git.kernel.org/stable/c/b49f085cd671addbda4802d6b9382513f7dd0f30"},{"url":"https://git.kernel.org/stable/c/bd51834d1cf65a2c801295d230c220aeebf87a73"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-05-11T21:15:44.270Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.19","versionEndExcluding":"6.1.136"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.19","versionEndExcluding":"6.6.89"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.19","versionEndExcluding":"6.12.26"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.19","versionEndExcluding":"6.14.5"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.19","versionEndExcluding":"6.15"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}},"adp":[{"title":"CVE Program Container","references":[{"url":"https://lists.debian.org/debian-lts-announce/2025/05/msg00045.html"}],"providerMetadata":{"shortName":"CVE","orgId":"af854a3a-2127-422b-91ae-364da2661108","dateUpdated":"2025-11-03T19:55:50.705Z"}}]}}}