# CVE-2026-74632: mm/huge\_memory: fix huge\_zero\_pfn race

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 7.8
- **CVSS:** 7.8 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.18% (percentile 4, 2026-11-26)
- **Published:** 2026-08-22T15:32:13.078Z
- **Modified:** 2026-10-24T15:10:00.190Z

## Who should check

- Anyone running Linux \>= 6527d8ef68c3ca3c455e38ae2a37cd7810caec73, \< 9c0fd1802ce06d7709f0bae4edeb085288f28764; \>= 3b77e8c8cde581dadab9a0f1543a347e24315f11, \< b7041ba61c5da4e0b56f9be58cfb87d7689724e4; \>= 3b77e8c8cde581dadab9a0f1543a347e24315f11, \< 9332b080ad57650d1dc582e54517f9fc78ef89cc; \>= 3b77e8c8cde581dadab9a0f1543a347e24315f11, \< f3a874a903053c53fb53ba287ea9eacda69c68e8; \>= 3b77e8c8cde581dadab9a0f1543a347e24315f11, \< 6024f6d0d9b9ca5138bfc4ac6f6e4bdf616e42b3; \>= 3b77e8c8cde581dadab9a0f1543a347e24315f11, \< 105d04edbec83010df5728f74d17fd9c108e7553; \>= 3b77e8c8cde581dadab9a0f1543a347e24315f11, \< ab7e4b407c7f58d1a003134eff3841f303d5ccc2; \>= 3b77e8c8cde581dadab9a0f1543a347e24315f11, \< 33192a26cddea7a7e4ca66e5c3eebd36fa8be2bb; fc1fbc5b017b6f5ef24a4a93f33cd022225e01c8; bd092a0f19423d7e9e81182314a96ecd6a14f3b7; …
- Anyone running Linux 5.13

## 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---

## Affected and fixed versions

- Linux: \>= 6527d8ef68c3ca3c455e38ae2a37cd7810caec73, \< 9c0fd1802ce06d7709f0bae4edeb085288f28764; \>= 3b77e8c8cde581dadab9a0f1543a347e24315f11, \< b7041ba61c5da4e0b56f9be58cfb87d7689724e4; \>= 3b77e8c8cde581dadab9a0f1543a347e24315f11, \< 9332b080ad57650d1dc582e54517f9fc78ef89cc; \>= 3b77e8c8cde581dadab9a0f1543a347e24315f11, \< f3a874a903053c53fb53ba287ea9eacda69c68e8; \>= 3b77e8c8cde581dadab9a0f1543a347e24315f11, \< 6024f6d0d9b9ca5138bfc4ac6f6e4bdf616e42b3; \>= 3b77e8c8cde581dadab9a0f1543a347e24315f11, \< 105d04edbec83010df5728f74d17fd9c108e7553; \>= 3b77e8c8cde581dadab9a0f1543a347e24315f11, \< ab7e4b407c7f58d1a003134eff3841f303d5ccc2; \>= 3b77e8c8cde581dadab9a0f1543a347e24315f11, \< 33192a26cddea7a7e4ca66e5c3eebd36fa8be2bb; fc1fbc5b017b6f5ef24a4a93f33cd022225e01c8; bd092a0f19423d7e9e81182314a96ecd6a14f3b7; … (cvelist)
- Linux: 5.13 (cvelist)

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2026-74632. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-74632.md
Affected: Linux >= 6527d8ef68c3ca3c455e38ae2a37cd7810caec73, < 9c0fd1802ce06d7709f0bae4edeb085288f28764; >= 3b77e8c8cde581dadab9a0f1543a347e24315f11, < b7041ba61c5da4e0b56f9be58cfb87d7689724e4; >= 3b77e8c8cde581dadab9a0f1543a347e24315f11, < 9332b080ad57650d1dc582e54517f9fc78ef89cc; >= 3b77e8c8cde581dadab9a0f…
Fixed in: Linux 9c0fd1802ce06d7709f0bae4edeb085288f28764, Linux 9332b080ad57650d1dc582e54517f9fc78ef89cc, Linux 6024f6d0d9b9ca5138bfc4ac6f6e4bdf616e42b3, Linux 105d04edbec83010df5728f74d17fd9c108e7553, Linux 33192a26cddea7a7e4ca66e5c3eebd36fa8be2bb

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2026-74632 being exploited?

There is no confirmed exploitation: CVE-2026-74632 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.18% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2026-74632?

High: CVSS 7.8 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2026-74632?

Linux \>= 6527d8ef68c3ca3c455e38ae2a37cd7810caec73, \< 9c0fd1802ce06d7709f0bae4edeb085288f28764; \>= 3b77e8c8cde581dadab9a0f1543a347e24315f11, \< b7041ba61c5da4e0b56f9be58cfb87d7689724e4; \>= 3b77e8c8cde581dadab9a0f1543a347e24315f11, \< 9332b080ad57650d1dc582e54517f9fc78ef89cc; \>= 3b77e8c8cde581dadab9a0f1543a347e24315f11, \< f3a874a903053c53fb53ba287ea9eacda69c68e8; \>= 3b77e8c8cde581dadab9a0f1543a347e24315f11, \< 6024f6d0d9b9ca5138bfc4ac6f6e4bdf616e42b3; \>= 3b77e8c8cde581dadab9a0f1543a347e24315f11, \< 105d04edbec83010df5728f74d17fd9c108e7553; \>= 3b77e8c8cde581dadab9a0f1543a347e24315f11, \< ab7e4b407c7f58d1a003134eff3841f303d5ccc2; \>= 3b77e8c8cde581dadab9a0f1543a347e24315f11, \< 33192a26cddea7a7e4ca66e5c3eebd36fa8be2bb; fc1fbc5b017b6f5ef24a4a93f33cd022225e01c8; bd092a0f19423d7e9e81182314a96ecd6a14f3b7; …; Linux 5.13.

### Is there a fix for CVE-2026-74632?

Yes. Fixed in Linux 9c0fd1802ce06d7709f0bae4edeb085288f28764, Linux 9332b080ad57650d1dc582e54517f9fc78ef89cc, Linux 6024f6d0d9b9ca5138bfc4ac6f6e4bdf616e42b3, Linux 105d04edbec83010df5728f74d17fd9c108e7553, Linux 33192a26cddea7a7e4ca66e5c3eebd36fa8be2bb. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2026-74632?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- other: <https://git.kernel.org/stable/c/9c0fd1802ce06d7709f0bae4edeb085288f28764>
- other: <https://git.kernel.org/stable/c/b7041ba61c5da4e0b56f9be58cfb87d7689724e4>
- other: <https://git.kernel.org/stable/c/9332b080ad57650d1dc582e54517f9fc78ef89cc>
- other: <https://git.kernel.org/stable/c/f3a874a903053c53fb53ba287ea9eacda69c68e8>
- other: <https://git.kernel.org/stable/c/6024f6d0d9b9ca5138bfc4ac6f6e4bdf616e42b3>
- other: <https://git.kernel.org/stable/c/105d04edbec83010df5728f74d17fd9c108e7553>
- other: <https://git.kernel.org/stable/c/ab7e4b407c7f58d1a003134eff3841f303d5ccc2>
- other: <https://git.kernel.org/stable/c/33192a26cddea7a7e4ca66e5c3eebd36fa8be2bb>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2026-74632>

HTML: <https://flawdb.com/CVE-2026-74632> · JSON: <https://flawdb.com/api/v1/entries/CVE-2026-74632>
