CVE-2024-35872: mm/secretmem: fix GUP-fast succeeding on secretmem folios

Published May 19, 2024
·
Updated

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

mm/secretmem: fix GUP-fast succeeding on secretmem folios

folioissecretmem() currently relies on secretmem folios being LRU folios, to save some cycles.

However, folios might reside in a folio batch without the LRU flag set, or temporarily have their LRU flag cleared. Consequently, the LRU flag is unreliable for this purpose.

In particular, this is the case when secretmemfault() allocates a fresh page and calls filemapaddfolio()->folioaddlru(). The folio might be added to the per-cpu folio batch and won't get the LRU flag set until the batch was drained using e.g., lruadddrain().

Consequently, folioissecretmem() might not detect secretmem folios and GUP-fast can succeed in grabbing a secretmem folio, crashing the kernel when we would later try reading/writing to the folio, because the folio has been unmapped from the directmap.

Fix it by removing that unreliable check.

Other sources

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

mm/secretmem: fix GUP-fast succeeding on secretmem folios

The Linux kernel CVE team has assigned CVE-2024-35872 to this issue.

Upstream advisory: https://lore.kernel.org/linux-cve-announce/2024051941-CVE-2024-35872-4632@gregkh/T

Red Hat

Affected Software

12 affected componentsFixes available
debian/linux
5.10.223-15.10.234-16.1.129-16.1.135-16.12.22-16.12.25-1
redhat/kernel<5.15.154
5.15.154
redhat/kernel<6.1.85
6.1.85
redhat/kernel<6.6.26
6.6.26
redhat/kernel<6.8.5
6.8.5
redhat/kernel<6.9
6.9
Linux Linux kernel>=5.14<5.15.154
Linux Linux kernel>=5.16<6.1.85
Linux Linux kernel>=6.2<6.6.26
Linux Linux kernel>=6.7<6.8.5
Linux Linux kernel=6.9-rc1
Linux Linux kernel=6.9-rc2

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

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

    Fixed in 5.10.223-1Fixed in 5.10.234-1Fixed in 6.1.129-1Fixed in 6.1.135-1Fixed in 6.12.22-1Fixed in 6.12.25-1
  2. Upgrade

    Upgrade redhat/kernel to a version that resolves this vulnerability.

    Fixed in 5.15.154
  3. Upgrade

    Upgrade redhat/kernel to a version that resolves this vulnerability.

    Fixed in 6.1.85
  4. Upgrade

    Upgrade redhat/kernel to a version that resolves this vulnerability.

    Fixed in 6.6.26
  5. Upgrade

    Upgrade redhat/kernel to a version that resolves this vulnerability.

    Fixed in 6.8.5
  6. Upgrade

    Upgrade redhat/kernel to a version that resolves this vulnerability.

    Fixed in 6.9
  7. Configuration

    Fix the kernel vulnerability by removing the unreliable LRU-based check that folio_is_secretmem() uses for detecting secretmem folios, so that GUP-fast cannot succeed on secretmem folios (which can otherwise lead to a kernel crash when the folio is later accessed after being unmapped from the directmap).

    Linux kernel (mm/secretmem) folio_is_secretmem() LRU-based check = removed
  8. Compensating control

    Mitigation: restrict exposure/usage paths that can trigger GUP-fast access to secretmem mappings until the kernel fix for mm/secretmem is applied.

Event History

May 19, 2024
CVE Published
via MITRE·08:34 AM
Data Sourced
via MITRE·08:34 AM
DescriptionSeverity
Data Sourced
via NVD·09:15 AM
Description
Data Sourced
via NVD·09:15 AM
RemedySeverityAffected Software
May 20, 2024
Data Sourced
via Red Hat·01:14 PM
DescriptionSeverityAffected Software
Jul 15, 2024
Data Sourced
via Launchpad·07:46 PM
Description
Apr 27, 2025
Data Sourced
via Ubuntu·12:21 AM
RemedyDescriptionSeverityAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2024-35872?

CVE-2024-35872 is classified as a moderate severity vulnerability in the Linux kernel.

2

How do I fix CVE-2024-35872?

To fix CVE-2024-35872, update the kernel to the recommended versions such as 5.15.154, 6.1.85, 6.6.26, 6.8.5, or 6.9 for Red Hat and specific versions for Debian.

3

Which Linux kernel versions are affected by CVE-2024-35872?

CVE-2024-35872 affects multiple Linux kernel versions prior to 5.15.154, 6.1.85, and includes certain versions of 6.12.x.

4

Is CVE-2024-35872 a remote or local vulnerability?

CVE-2024-35872 is a local vulnerability, requiring local access to exploit.

5

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

The potential impacts of CVE-2024-35872 include unauthorized access to sensitive memory segments in the Linux kernel.

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