CVE-2024-57945: riscv: mm: Fix the out of bound issue of vmemmap address
In the Linux kernel, the following vulnerability has been resolved:
riscv: mm: Fix the out of bound issue of vmemmap address
In sparse vmemmap model, the virtual address of vmemmap is calculated as:
((struct page *)VMEMMAP_START - (phys_ram_base >> PAGE_SHIFT)).
And the struct page's va can be calculated with an offset:
(vmemmap + (pfn)).
However, when initializing struct pages, kernel actually starts from the
first page from the same section that phys_ram_base belongs to. If the
first page's physical address is not (phys_ram_base >> PAGE_SHIFT), then
we get an va below VMEMMAP_START when calculating va for it's struct page.
For example, if phys_ram_base starts from 0x82000000 with pfn 0x82000, the
first page in the same section is actually pfn 0x80000. During
init_unavailable_range(), we will initialize struct page for pfn 0x80000
with virtual address ((struct page *)VMEMMAP_START - 0x2000), which is
below VMEMMAP_START as well as PCI_IO_END.
This commit fixes this bug by introducing a new variable
'vmemmap_start_pfn' which is aligned with memory section size and using
it to calculate vmemmap address instead of phys_ram_base.
Security readout for executives and security teams
Plain-English summary
This is a Linux kernel bug in RISC-V memory-management code. Under specific physical-memory layouts, the kernel can calculate a vmemmap address below its intended boundary while initializing page metadata. The sources do not state business impact, CVSS severity, exploitability, or active exploitation.
Executive priority
Treat this as a focused kernel-maintenance item, not an emergency, unless your organization operates production RISC-V Linux systems or a vendor advisory rates your package as urgent.
Technical view
The flaw is in RISC-V sparse vmemmap address calculation. Using phys_ram_base instead of a section-aligned starting PFN can make struct page virtual addresses fall below VMEMMAP_START during unavailable-range initialization. Kernel stable commits introduce vmemmap_start_pfn aligned to memory section size.
Likely exposure
Exposure appears limited to Linux systems running affected RISC-V kernel builds with sparse vmemmap behavior. The provided version data is not enough to map every distribution package reliably, so validate against vendor kernel advisories and package changelogs.
Exploitation context
The bundle marks KEV as false and provides no cited evidence of active exploitation or public weaponization. It also does not describe a practical attacker path, required privileges, or reachable impact beyond the kernel memory-addressing bug.
Researcher notes
The key issue is section alignment: initialization starts at the first page of the section containing phys_ram_base, but vmemmap was offset from phys_ram_base. Evidence does not establish security impact beyond out-of-bound vmemmap address calculation.
Mitigation direction
Prioritize vendor-supported kernel updates for RISC-V Linux systems.
Check Linux stable commits referenced for fixed upstream branches.
Review Debian LTS guidance if using Debian-packaged kernels.
Avoid inventing local workarounds; follow vendor kernel guidance.
Validation and detection
Inventory Linux hosts running RISC-V kernels.
Compare running kernel versions against vendor advisories and fixed packages.
Confirm whether sparse vmemmap is relevant for deployed RISC-V configurations.
Track CVE and distribution advisories for clarified severity or impact.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cve · low confidence lookup
CVE-2024-57945 mapping review
Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
0CVSS vectors
3Timeline events
1ADP providers
7Source links
Vulnerability timeline
Timeline events are normalized from CVE metadata, CNA source timelines, ADP timelines, and KEV metadata when present.
CVE reservedCVE Program
The CVE ID was reserved by the assigning CNA.
CVE publishedCVE Program
The CVE record was published.
Jan 21, 2025, 12:18 UTC (UTC+00:00)
CVE updatedCVE Program
The CVE record metadata indicates this as the latest update time.