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

- Priority: **Routine**
- Reason: Not severe (CVSS 7, local access); no exploitation reported by the 5 checked sources
- Next step: Fix in the normal cadence
- Status: published
- Published: 2026-11-19 · Modified: 2026-11-22
- Aliases: DEBIAN-CVE-2026-99336, UBUNTU-CVE-2026-99336, CGA-5qwr-8w88-mcx2, CGA-88c6-f2wj-j998, CGA-88p4-wq77-96mc, CGA-chcp-j2jq-r28w, CGA-h56m-qxpc-jc2q, CGA-pwf6-r7gj-vmr4, CGA-r7x3-fm6p-m2pc, CGA-rmqx-qc3h-j43f, CGA-v34h-956q-4mch, CGA-x7vj-7925-vgxg, CGA-5rmq-chv2-9h24, CGA-mj3m-4x4w-c895, CGA-p42p-84hq-wcxf, CGA-q8cv-f35g-hgwh, CGA-qx4f-2834-h7cc, CGA-x628-29h8-mcr6, CGA-x9xv-3m3w-xjw2, CGA-64wh-8gvf-jwvm, CGA-rj82-4463-42qq
- Record: https://cvemate.com/vulnerability/CVE-2026-99336 · JSON: https://cvemate.com/vulnerability/CVE-2026-99336/json

## Description

```text
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.
```

## Signals

- CVSS: 7 high (v3.1, CVE.org) CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
- EPSS: 0.165%, percentile 5.91%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected (first 20 of 135)

- chainguard linux-desktop-7.2 (Chainguard): All versions (No fix recorded)
- chainguard linux-desktop-7.2-bootc (Chainguard): All versions (No fix recorded)
- chainguard linux-desktop-7.2-bootc-boot-installed (Chainguard): All versions (No fix recorded)
- chainguard linux-desktop-7.2-headers (Chainguard): All versions (No fix recorded)
- chainguard linux-desktop-7.2-modules (Chainguard): All versions (No fix recorded)
- chainguard linux-server-7.2 (Chainguard): All versions (No fix recorded)
- chainguard linux-server-7.2-bootc (Chainguard): All versions (No fix recorded)
- chainguard linux-server-7.2-bootc-boot-installed (Chainguard): All versions (No fix recorded)
- chainguard linux-server-7.2-headers (Chainguard): All versions (No fix recorded)
- chainguard linux-server-7.2-modules (Chainguard): All versions (No fix recorded)
- debian linux (Debian): All versions (No fix recorded) \| \< 6.12.118-1 \| \< 7.3.3-1
- debian linux-6.12 (Debian): \< 6.12.118-1~deb12u1
- ubuntu linux (Ubuntu): All versions (No fix recorded)
- ubuntu linux-allwinner-5.19 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.0 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.11 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.13 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.19 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.3 (Ubuntu): All versions (No fix recorded)

## References

- <https://git.kernel.org/stable/c/4ae4316682cdc78d8f5a856ab0712a8281f211ca>
- <https://git.kernel.org/stable/c/3af94f4e3526efdf52d84d7ba8d9fb8e8facb93a>
- <https://git.kernel.org/stable/c/024be82ac4c4df650cc6daca6d7db79daee95470>
- <https://git.kernel.org/stable/c/0ee2c883b62deb74d8c43007e8049dc006d3a2fb>
- <https://security-tracker.debian.org/tracker/CVE-2026-99336>
- <https://ubuntu.com/security/CVE-2026-99336>
- <https://www.cve.org/CVERecord?id=CVE-2026-99336>
- <https://git.kernel.org/linus/0ee2c883b62deb74d8c43007e8049dc006d3a2fb>
- <https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/99xxx/CVE-2026-99336.json>
- <https://nvd.nist.gov/vuln/detail/CVE-2026-99336>
- <https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git>

---

Data as of 2026-12-05T03:57:27.617Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
