CVE-2026-74632
mm/huge_memory: fix huge_zero_pfn race
Check your servers for CVE-2026-74632
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-2026-74632 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/huge_memory: fix huge_zero_pfn race
Patch series "mm/huge_memory: fix huge_zero_pfn race", v2.
There is a subtle race in the reference-counted huge_zero_folio implementation.
The fast path atomic logic fails to account for the fact that the shrinker (which drops the final huge_zero_refcount pin) can overwrite huge_zero_pfn with the ~0UL sentinel value in shrink_huge_zero_folio_scan() after a racing get_huge_zero_folio() installed a valid value there.
This results in huge_zero_folio being correctly set but huge_zero_pfn being set incorrectly and thus is_huge_zero_pfn() and consequently is_huge_zero_pmd() will misidentify the huge zero folio as being an ordinary THP folio.
This can result in the huge zero folio being split and otherwise treated incorrectly.
The solution to this is very subtle as there is an atomic fast path, and thus ordering in weakly ordered architectures has to be treated very carefully.
The first commit fixes the issue by introducing a spinlock around huge_zero_[pfn, folio, refcount] write, with careful consideration paid to load/store ordering in the fast path. It is placed first and kept as small as possible so that it can be backported on its own.
The second commit is a pure cleanup which reworks the CONFIG_PERSISTENT_HUGE_ZERO_FOLIO logic to better separate the persistent logic from the dynamically allocated one.
This patch (of 2):
If !CONFIG_PERSISTENT_HUGE_ZERO_FOLIO, the huge_zero_folio is refcounted by huge_zero_refcount and returned by mm_get_huge_zero_folio().
When the caller is done with the huge zero page, its reference count is decremented. Only a shrinker can set the reference count to zero.
A race can unfortunately occur between a shrinker decrementing the reference count to zero and a concurrent page fault.
This is because shrink_huge_zero_folio_scan() might, if very unlucky, be preempted between setting huge_zero_refcount to zero and writing an invalid value.
During this time get_huge_zero_folio() could write to huge_zero_pfn before shrink_huge_zero_folio_scan() resumes.
In this event the huge zero folio will be persistently misidentified causing the THP code path to be entered inappropriately for the huge zero folio:
CPU 0 CPU 1 =======================================|================================= shrink_huge_zero_folio_scan() | atomic_cmpxchg() sets refcount to 0 | xchg() sets huge_zero_folio to NULL | get_huge_zero_folio() | | atomic_inc_not_zero() -> zero preempted for a long time | Allocate new huge zero folio | | Write valid huge_zero_folio v | Write valid huge_zero_pfn Overwrite huge_zero_pfn with ~0UL <--- Invalid overwrite!
This results in is_huge_zero_pfn() and is_huge_zero_pmd() incorrectly returning false for a huge zero page which could result in issues like the huge zero folio being incorrectly split.
Note that the issue is with huge_zero_pfn not huge_zero_folio, as get_huge_zero_folio() uses cmpxchg() gated on huge_zero_folio being NULL with a retry loop and shrink_huge_zero_folio_scan() uses xchg() to set huge_zero_folio.
Fix the issue by introducing a spinlock, huge_zero_lock, to prevent concurrent write of huge_zero_folio, huge_zero_pfn and huge_zero_refcount.
There needs to be significant care taken here to ensure correctness:
The fast path in get_huge_zero_folio() uses atomic_inc_not_zero(), which is outside of the critical section, and means huge zero allocation is gated on zero huge_zero_refcount.
The fast path doesn't use huge_zero_lock, so the critical section is irrelevant to it.
So invariants are required - huge_zero_refcount MUST:
* Only be set in the huge_zero_lock critical section to ensure serialisation of huge_zero_pfn, huge_zero_folio and ---truncated---
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.13%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 2.78% of all scored CVEs. Scores of 1 Dec 2026.
The assessment of CISA (SSVC, 16 Oct 2026):
- Exploitation
- none: CISA did not find evidence of exploitation or a public proof of concept
- Automatable
- no: each attack takes manual steps
- Technical impact
- total: full control of the component or of its data
Affected products
As the CNA lists them.
| Product | Versions |
|---|---|
| Linux |
affected from 6527d8ef68c3ca3c455e38ae2a37cd7810caec73, before 9c0fd1802ce06d7709f0bae4edeb085288f28764 affected from 3b77e8c8cde581dadab9a0f1543a347e24315f11, before b7041ba61c5da4e0b56f9be58cfb87d7689724e4 affected from 3b77e8c8cde581dadab9a0f1543a347e24315f11, before 9332b080ad57650d1dc582e54517f9fc78ef89cc affected from 3b77e8c8cde581dadab9a0f1543a347e24315f11, before f3a874a903053c53fb53ba287ea9eacda69c68e8 affected from 3b77e8c8cde581dadab9a0f1543a347e24315f11, before 6024f6d0d9b9ca5138bfc4ac6f6e4bdf616e42b3 affected from 3b77e8c8cde581dadab9a0f1543a347e24315f11, before 105d04edbec83010df5728f74d17fd9c108e7553 affected from 3b77e8c8cde581dadab9a0f1543a347e24315f11, before ab7e4b407c7f58d1a003134eff3841f303d5ccc2 affected from 3b77e8c8cde581dadab9a0f1543a347e24315f11, before 33192a26cddea7a7e4ca66e5c3eebd36fa8be2bb affected fc1fbc5b017b6f5ef24a4a93f33cd022225e01c8 affected bd092a0f19423d7e9e81182314a96ecd6a14f3b7 affected b1daf8f862136894a4595770a44e4508808fb806 affected from 5.10.47, before 5.10.267 affected from 4.19.197, before 4.20 affected from 5.4.129, before 5.5 affected from 5.12.14, before 5.13
Other versions: unaffected
|
| Linux |
affected 5.13 unaffected before 5.13 unaffected from 5.10.267 up to and including 5.10.* unaffected from 5.15.218 up to and including 5.15.* unaffected from 6.1.184 up to and including 6.1.* unaffected from 6.6.153 up to and including 6.6.* unaffected from 6.12.104 up to and including 6.12.* unaffected from 6.18.45 up to and including 6.18.* unaffected from 7.1.9 up to and including 7.1.* unaffected 7.2 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-2026-74632 /usr/share/doc/linux-image-$(uname -r)/changelog.Debian.gz
# RHEL, Rocky, Alma
rpm -q --changelog kernel | grep CVE-2026-74632
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-2026-74632
trivy image --scanners vuln IMAGE | grep CVE-2026-74632
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/9c0fd1802ce06d7709f0bae4edeb085288f28764 git.kernel.org
- https://git.kernel.org/stable/c/b7041ba61c5da4e0b56f9be58cfb87d7689724e4 git.kernel.org
- https://git.kernel.org/stable/c/9332b080ad57650d1dc582e54517f9fc78ef89cc git.kernel.org
- https://git.kernel.org/stable/c/f3a874a903053c53fb53ba287ea9eacda69c68e8 git.kernel.org
- https://git.kernel.org/stable/c/6024f6d0d9b9ca5138bfc4ac6f6e4bdf616e42b3 git.kernel.org
- https://git.kernel.org/stable/c/105d04edbec83010df5728f74d17fd9c108e7553 git.kernel.org
- https://git.kernel.org/stable/c/ab7e4b407c7f58d1a003134eff3841f303d5ccc2 git.kernel.org
- https://git.kernel.org/stable/c/33192a26cddea7a7e4ca66e5c3eebd36fa8be2bb git.kernel.org
Source: the record CVE-2026-74632 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