# CVE-2026-99336: KVM: guest\_memfd: take the invalidate lock when unbinding a dying file

- **Severity:** HIGH 7.0
- **CVSS:** 7.0 (v3.1, CNA) `CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: High; 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.15% (percentile 2, 2026-11-28)
- **Published:** 2026-11-19T14:21:42.304Z
- **Modified:** 2026-11-22T11:16:47.793Z

## Who should check

- Anyone running Linux \>= a8ac2bd0f98e1a230f1eb3260fa552bf2ef1753b, \< 4ae4316682cdc78d8f5a856ab0712a8281f211ca; \>= ae431059e75d36170a5ae6b44cc4d06d43613215, \< 3af94f4e3526efdf52d84d7ba8d9fb8e8facb93a; \>= ae431059e75d36170a5ae6b44cc4d06d43613215, \< 024be82ac4c4df650cc6daca6d7db79daee95470; \>= ae431059e75d36170a5ae6b44cc4d06d43613215, \< 0ee2c883b62deb74d8c43007e8049dc006d3a2fb; 393893693a523e053f84d69320d090b93503f79f; \>= 6.12.59, \< 6.12.118; \>= 6.17.9, \< 6.18
- Anyone running Linux 6.18

## Description

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

KVM: guest\_memfd: take the invalidate lock when unbinding a dying file

kvm\_gmem\_unbind() takes mapping-\>invalidate\_lock only if the
get\_file\_active() succeeds. When the guest\_memfd file is dying, its
reference count is already zero so get\_file\_active fails and the binding
is removed without holding the invalidate lock.

kvm\_gmem\_invalidate\_{start,end}() checks f-\>bindings independently to
decide whether to begin or end KVM MMU invalidation. So, the bindings
must therefore remain stable between the two calls. Otherwise, unbind
can remove a binding after start increments mmu\_invalidate\_in\_progress,
but before end finds the binding and decrements it.
Example, unbind race with memory failure:

  CPU 0: memory failure               CPU 1: memslot delete
  ----------------------------------  ---------------------------
                                      (guest\_memfd file is dying)
  kvm\_gmem\_error\_folio()
    kvm\_gmem\_invalidate\_start()
      finds binding
      mmu\_invalidate\_in\_progress++
                                      kvm\_gmem\_unbind()
                                        get\_file\_active() fails
                                        removes binding
    kvm\_gmem\_invalidate\_end()
      no binding found
      counter stays elevated

mmu\_invalidate\_retry() then returns 1 forever, so guest page faults
retry without ever installing a mapping and the guest hangs.

Remove the distinction between live and dying files in the unbind path.
Always use slot-\>gmem.file and take the invalidate lock when it's non-NULL.
Normal unbind callers hold slots\_lock, which prevents release from clearing
the pointer or freeing the file state until unbind completes. Final VM
teardown can only see a NULL pointer because guest\_memfd pins the KVM until
release has cleared all bindings.

## Affected and fixed versions

- Linux: \>= a8ac2bd0f98e1a230f1eb3260fa552bf2ef1753b, \< 4ae4316682cdc78d8f5a856ab0712a8281f211ca; \>= ae431059e75d36170a5ae6b44cc4d06d43613215, \< 3af94f4e3526efdf52d84d7ba8d9fb8e8facb93a; \>= ae431059e75d36170a5ae6b44cc4d06d43613215, \< 024be82ac4c4df650cc6daca6d7db79daee95470; \>= ae431059e75d36170a5ae6b44cc4d06d43613215, \< 0ee2c883b62deb74d8c43007e8049dc006d3a2fb; 393893693a523e053f84d69320d090b93503f79f; \>= 6.12.59, \< 6.12.118; \>= 6.17.9, \< 6.18 (cvelist)
- Linux: 6.18 (cvelist)

## Technologies

Linux kernel

## Mitigation

- Upgrade Linux to 6.18 or later.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2026-99336.md
Affected: Linux >= a8ac2bd0f98e1a230f1eb3260fa552bf2ef1753b, < 4ae4316682cdc78d8f5a856ab0712a8281f211ca; >= ae431059e75d36170a5ae6b44cc4d06d43613215, < 3af94f4e3526efdf52d84d7ba8d9fb8e8facb93a; >= ae431059e75d36170a5ae6b44cc4d06d43613215, < 024be82ac4c4df650cc6daca6d7db79daee95470; >= ae431059e75d36170a5ae6b…
Fixed in: Linux 4ae4316682cdc78d8f5a856ab0712a8281f211ca, Linux 3af94f4e3526efdf52d84d7ba8d9fb8e8facb93a, Linux 024be82ac4c4df650cc6daca6d7db79daee95470, Linux 0ee2c883b62deb74d8c43007e8049dc006d3a2fb, Linux 6.12.118, Linux 6.18

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-99336 being exploited?

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

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

High: CVSS 7.0 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed). The attack needs conditions outside the attacker's control, which makes it harder.

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

Linux \>= a8ac2bd0f98e1a230f1eb3260fa552bf2ef1753b, \< 4ae4316682cdc78d8f5a856ab0712a8281f211ca; \>= ae431059e75d36170a5ae6b44cc4d06d43613215, \< 3af94f4e3526efdf52d84d7ba8d9fb8e8facb93a; \>= ae431059e75d36170a5ae6b44cc4d06d43613215, \< 024be82ac4c4df650cc6daca6d7db79daee95470; \>= ae431059e75d36170a5ae6b44cc4d06d43613215, \< 0ee2c883b62deb74d8c43007e8049dc006d3a2fb; 393893693a523e053f84d69320d090b93503f79f; \>= 6.12.59, \< 6.12.118; \>= 6.17.9, \< 6.18; Linux 6.18.

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

Yes. Fixed in Linux 4ae4316682cdc78d8f5a856ab0712a8281f211ca, Linux 3af94f4e3526efdf52d84d7ba8d9fb8e8facb93a, Linux 024be82ac4c4df650cc6daca6d7db79daee95470, Linux 0ee2c883b62deb74d8c43007e8049dc006d3a2fb, Linux 6.12.118, Linux 6.18. Upgrade Linux to 6.18 or later.

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

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/4ae4316682cdc78d8f5a856ab0712a8281f211ca>
- other: <https://git.kernel.org/stable/c/3af94f4e3526efdf52d84d7ba8d9fb8e8facb93a>
- other: <https://git.kernel.org/stable/c/024be82ac4c4df650cc6daca6d7db79daee95470>
- other: <https://git.kernel.org/stable/c/0ee2c883b62deb74d8c43007e8049dc006d3a2fb>

## 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-99336>
- FIRST EPSS: EPSS scores by FIRST <https://www.first.org/epss/>

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