← All Advisories
Reported from OT-Advisories.com as of

Linux Kernel KVM guest_memfd Skips the Invalidate Lock When Unbinding a Dying File

Last refreshed2026-11-23

Status: UPDATED  |  Advisory ID: CVE-2026-99336

Key Details

CVECVE-2026-99336
CVSS Score / Version
7.0 (High) / CVSS v3.1
Updated2026-11-22
CVSS Vector
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
CVSS Prose
attack vector is local; attack complexity is high; privileges required is low; user interaction is none; scope is unchanged; confidentiality impact is high; integrity impact is high; availability impact is high.
Affected products
Linux Kernel

Affected Products, Subsystems & Sectors

VendorProductAffected VersionsPatch Status
LinuxLinux Kernel
SubsystemsOT Supporting Infrastructure
SectorsAll Sectors

What to Know

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. (NVD)

What to Do

Monitor Linux's web page for any future patch releases.

References

SourceReference
NVDhttps://nvd.nist.gov/vuln/detail/CVE-2026-99336
CVEhttps://www.cve.org/CVERecord?id=CVE-2026-99336
Report compilation © 2026 OT-Advisories.com  ·  CC BY 4.0  ·  Source materials remain the property of their respective publishers as cited.