CVE-2023-52489: mm/sparsemem: fix race in accessing memory_section->usage

Published Feb 29, 2024
·
Updated

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

mm/sparsemem: fix race in accessing memorysection->usage

The below race is observed on a PFN which falls into the device memory region with the system memory configuration where PFN's are such that [ZONENORMAL ZONEDEVICE ZONENORMAL]. Since normal zone start and end pfn contains the device memory PFN's as well, the compaction triggered will try on the device memory PFN's too though they end up in NOP(because pfntoonlinepage() returns NULL for ZONEDEVICE memory sections). When from other core, the section mappings are being removed for the ZONEDEVICE region, that the PFN in question belongs to, on which compaction is currently being operated is resulting into the kernel crash with CONFIGSPASEMEMVMEMAP enabled. The crash logs can be seen at [1].

compactzone() memunmappages ------------- --------------- pageblockpfntopage ...... (a)pfnvalid(): validsection()//return true (b)removepages()-> sparseremovesection()-> sectiondeactivate(): [Free the array ms->usage and set ms->usage = NULL] pfnsectionvalid() [Access ms->usage which is NULL]

NOTE: From the above it can be said that the race is reduced to between the pfnvalid()/pfnsectionvalid() and the section deactivate with SPASEMEMVMEMAP enabled.

The commit b943f045a9af("mm/sparse: fix kernel crash with pfnsectionvalid check") tried to address the same problem by clearing the SECTIONHASMEMMAP with the expectation of validsection() returns false thus ms->usage is not accessed.

Fix this issue by the below steps:

a) Clear SECTIONHASMEMMAP before freeing the ->usage.

b) RCU protected read side critical section will either return NULL when SECTIONHASMEMMAP is cleared or can successfully access ->usage.

c) Free the ->usage with kfreercu() and set ms->usage = NULL. No attempt will be made to access ->usage after this as the SECTIONHASMEMMAP is cleared thus validsection() return false.

Thanks to David/Pavan for their inputs on this patch.

[1]

Other sources

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

mm/sparsemem: fix race in accessing memorysection->usage

The Linux kernel CVE team has assigned CVE-2023-52489 to this issue.

Upstream advisory: https://lore.kernel.org/linux-cve-announce/20240229155245.1571576-30-lee@kernel.org/T

Red Hat

Affected Software

17 affected componentsFixes available
redhat/kernel<5.10.210
5.10.210
redhat/kernel<5.15.149
5.15.149
redhat/kernel<6.1.76
6.1.76
redhat/kernel<6.6.15
6.6.15
redhat/kernel<6.7.3
6.7.3
redhat/kernel<6.8
6.8
Linux Linux kernel>=5.3<5.10.210
Linux Linux kernel>=5.11<5.15.149
Linux Linux kernel>=5.16<6.1.76
Linux Linux kernel>=6.2<6.6.15
Linux Linux kernel>=6.7<6.7.3
Debian Debian Linux=10.0
IBM Security Verify Governance<=ISVG 10.0.2
IBM Security Verify Governance, Identity Manager Software Stack<=ISVG 10.0.2
IBM Security Verify Governance, Identity Manager Virtual Appliance<=ISVG 10.0.2
IBM Security Verify Governance Identity Manager Container<=ISVG 10.0.2
debian/linux
5.10.223-15.10.234-16.1.129-16.1.135-16.12.25-16.12.27-1

Event History

Feb 29, 2024
CVE Published
via MITRE·03:52 PM
Data Sourced
via MITRE·03:52 PM
Description
Mar 12, 2024
Data Sourced
via Red Hat·03:58 PM
DescriptionSeverityAffected Software
May 11, 2024
Data Sourced
via Launchpad·08:29 PM
Description
Apr 29, 2025
Data Sourced
via Ubuntu·05:33 AM
RemedyDescriptionSeverityAffected Software

Parent advisories

This vulnerability appears in the following advisories.

Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2023-52489?

CVE-2023-52489 is classified as a moderate severity vulnerability in the Linux kernel.

2

How does CVE-2023-52489 affect the Linux kernel?

CVE-2023-52489 introduces a race condition in accessing the memory_section structure, which could lead to undefined behavior.

3

How do I fix CVE-2023-52489?

To fix CVE-2023-52489, upgrade your Linux kernel to a version that is beyond the specified vulnerabilities, such as 5.10.210, 5.15.149, or higher.

4

Which Linux kernel versions are affected by CVE-2023-52489?

CVE-2023-52489 affects Linux kernel versions up to 5.10.209, 5.15.148, and lower versions, as well as some earlier versions in the 6.x series.

5

Is there a workaround for CVE-2023-52489?

Currently, there is no specific workaround for CVE-2023-52489; the best mitigation is to apply the kernel updates from your distribution.

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