CVE-2024-57945: riscv: mm: Fix the out of bound issue of vmemmap address

Published Jan 21, 2025
·
Updated

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 )VMEMMAPSTART - (physrambase >> PAGESHIFT)). 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 physrambase belongs to. If the first page's physical address is not (physrambase >> PAGESHIFT), then we get an va below VMEMMAPSTART when calculating va for it's struct page.

For example, if physrambase starts from 0x82000000 with pfn 0x82000, the first page in the same section is actually pfn 0x80000. During initunavailablerange(), we will initialize struct page for pfn 0x80000 with virtual address ((struct page )VMEMMAPSTART - 0x2000), which is below VMEMMAPSTART as well as PCIIOEND.

This commit fixes this bug by introducing a new variable 'vmemmapstartpfn' which is aligned with memory section size and using it to calculate vmemmap address instead of physrambase.

Other sources

This CVE was automatically created from a reference found in an email or other text. If you are reading this, then this CVE entry is probably erroneous, since this text should be replaced by the official CVE description automatically.

Launchpad

Affected Software

17 affected componentsFixes available
Linux Linux kernel
debian/linux<=5.10.223-1, <=5.10.234-1, <=6.1.129-1, <=6.1.135-1
6.12.27-1
Linux Linux kernel>=5.10.212<5.11
Linux Linux kernel>=5.15.151<5.16
Linux Linux kernel>=6.1.81<6.1.140
Linux Linux kernel>=6.6.21<6.6.72
Linux Linux kernel>=6.7.9<6.8
Linux Linux kernel>=6.8.1<6.12.10
Linux Linux kernel=6.8
Linux Linux kernel=6.8-rc7
Linux Linux kernel=6.13-rc1
Linux Linux kernel=6.13-rc2
Linux Linux kernel=6.13-rc3
Linux Linux kernel=6.13-rc4
Linux Linux kernel=6.13-rc5
Linux Linux kernel=6.13-rc6
Microsoft cbl2 kernel 5.15.186.1-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade debian/linux to a version that resolves this vulnerability.

    Fixed in 6.12.27-1

Event History

Jan 21, 2025
CVE Published
via MITRE·12:18 PM
Data Sourced
via MITRE·12:18 PM
DescriptionSeverity
Data Sourced
via NVD·01:15 PM
Description
Data Sourced
via NVD·01:15 PM
RemedySeverityWeaknessAffected Software
Mar 27, 2025
Data Sourced
via Launchpad·06:49 PM
Description
Apr 28, 2025
Data Sourced
via Ubuntu·06:56 PM
RemedyDescriptionSeverityAffected Software
Sep 28, 2025
Data Sourced
via Microsoft·01:02 AM
DescriptionSeverityWeakness
Data Sourced
via Microsoft·01:02 AM
Affected Software
Updated
via Microsoft·01:02 AM
DescriptionSeverity

Frequently Asked Questions

1

What is the severity of CVE-2024-57945?

CVE-2024-57945 is classified as a medium severity vulnerability affecting the Linux kernel.

2

How do I fix CVE-2024-57945?

To fix CVE-2024-57945, upgrade to the latest stable version of the Linux kernel that includes the security patches.

3

Which systems are affected by CVE-2024-57945?

CVE-2024-57945 affects systems running certain versions of the Linux kernel that use the sparse vmemmap model.

4

What are the potential impacts of CVE-2024-57945?

The potential impacts of CVE-2024-57945 include possible system crashes or instability due to out-of-bounds memory access.

5

Is there a workaround for CVE-2024-57945?

There is no widely recommended workaround for CVE-2024-57945; updating the kernel is the best course of action.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203