CVE-2024-57881

mm/page_alloc: don't call pfn_to_page() on possibly non-existent PFN in split_large_buddy()

State
Published
Severity
5.5 Medium
Published
Jan 11, 2025
Updated
May 11, 2026
Reserved
Jan 11, 2025

Read the record on cve.org

Description

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

mm/page_alloc: don't call pfn_to_page() on possibly non-existent PFN in split_large_buddy()

In split_large_buddy(), we might call pfn_to_page() on a PFN that might not exist. In corner cases, such as when freeing the highest pageblock in the last memory section, this could result with CONFIG_SPARSEMEM && !CONFIG_SPARSEMEM_EXTREME in __pfn_to_section() returning NULL and and __section_mem_map_addr() dereferencing that NULL pointer.

Let's fix it, and avoid doing a pfn_to_page() call for the first iteration, where we already have the page.

So far this was found by code inspection, but let's just CC stable as the fix is easy.

Scores

CVSSScoreVectorSource
3.15.5 MediumCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:HCISA-ADP

Weaknesses

Affected Products

ProductVersions
LinuxLinux
  • fd919a85cd55be5d00a6a7372071f44c8eafb825 to before 4234ca9884bcae9e48ed38652d91696ad5cd591dAffected
  • fd919a85cd55be5d00a6a7372071f44c8eafb825 to before faeec8e23c10bd30e8aa759a2eb3018dae00f924Affected
LinuxLinux
  • 6.10Affected
  • before 6.10Not affected
  • 6.12.7 through 6.12.*Not affected
  • 6.13 and laterNot affected

References

Every record here comes from the CVE Program’s CVE List. © 1999–2026 The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation. The records are reproduced under the CVE Program terms of use.