CVE-2024-35872
mm/secretmem: fix GUP-fast succeeding on secretmem folios
Check your servers for CVE-2024-35872
The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2024-35872 affects the running kernel, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.
Description
In the Linux kernel, the following vulnerability has been resolved:
mm/secretmem: fix GUP-fast succeeding on secretmem folios
folio_is_secretmem() 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 secretmem_fault() allocates a fresh page and calls filemap_add_folio()->folio_add_lru(). 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., lru_add_drain().
Consequently, folio_is_secretmem() 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.
Severity (CVSS)
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- Attack vector
- local: the attacker needs local access, or a user has to open a prepared file
- Attack complexity
- low: an attack works without special conditions
- Privileges required
- low: the attacker needs an ordinary user account
- User interaction
- none: nobody has to click or open anything
- Scope
- unchanged: the damage stays inside the vulnerable component
- Impact
- confidentiality high, integrity high, availability high: what an attacker can read (confidentiality), change (integrity) or stop (availability)
Exploitation
EPSS 0.24%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 15.6% of all scored CVEs. Scores of 1 Dec 2026.
The assessment of CISA (SSVC, 20 May 2024):
- Exploitation
- none: CISA did not find evidence of exploitation or a public proof of concept
- Automatable
- no: each attack takes manual steps
- Technical impact
- partial: limited control or limited data
Affected products
As the CNA lists them.
| Product | Versions |
|---|---|
| Linux |
affected from 1507f51255c9ff07d75909a84e7c0d7f3c4b2f49, before 6564b014af92b677c1f07c44d7f5b595d589cf6e affected from 1507f51255c9ff07d75909a84e7c0d7f3c4b2f49, before 9c2b4b657739ecda38e3b383354a29566955ac48 affected from 1507f51255c9ff07d75909a84e7c0d7f3c4b2f49, before 43fad1d0284de30159661d0badfc3cbaf7e6f8f8 affected from 1507f51255c9ff07d75909a84e7c0d7f3c4b2f49, before 201e4aaf405dfd1308da54448654053004c579b5 affected from 1507f51255c9ff07d75909a84e7c0d7f3c4b2f49, before 65291dcfcf8936e1b23cfd7718fdfde7cfaf7706
Other versions: unaffected
|
| Linux |
affected 5.14 unaffected before 5.14 unaffected from 5.15.154 up to and including 5.15.* unaffected from 6.1.85 up to and including 6.1.* unaffected from 6.6.26 up to and including 6.6.* unaffected from 6.8.5 up to and including 6.8.* unaffected 6.9 and later
Other versions: affected
|
Is my server affected?
This CVE is in the Linux kernel. Compare the running kernel with the fixed kernel version of your distribution, and reboot after a kernel update:
uname -r
# Debian, Ubuntu: does the changelog of the running kernel name the CVE?
zgrep -l CVE-2024-35872 /usr/share/doc/linux-image-$(uname -r)/changelog.Debian.gz
# RHEL, Rocky, Alma
rpm -q --changelog kernel | grep CVE-2024-35872
With Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:
trivy rootfs --scanners vuln / | grep CVE-2024-35872
trivy image --scanners vuln IMAGE | grep CVE-2024-35872
Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.
References
Other references
- https://git.kernel.org/stable/c/6564b014af92b677c1f07c44d7f5b595d589cf6e git.kernel.org
- https://git.kernel.org/stable/c/9c2b4b657739ecda38e3b383354a29566955ac48 git.kernel.org
- https://git.kernel.org/stable/c/43fad1d0284de30159661d0badfc3cbaf7e6f8f8 git.kernel.org
- https://git.kernel.org/stable/c/201e4aaf405dfd1308da54448654053004c579b5 git.kernel.org
- https://git.kernel.org/stable/c/65291dcfcf8936e1b23cfd7718fdfde7cfaf7706 git.kernel.org
Source: the record CVE-2024-35872 of the CVE List (CVE Program), CVE Terms of Use; the CISA KEV catalog and the CISA ADP container; EPSS of FIRST. The text of the record is shown as published. Data sources and licences.
Vulnpocalypse