CVE-2026-99336
published high CVSS 3.1 · 7.0KVM: guest_memfd: take the invalidate lock when unbinding a dying file
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| Linux | — | Linuxa8ac2bd0f98e1a230f1eb3260fa552bf2ef1753b to < 4ae4316682cdc78d8f5a856ab0712a8281f211ca · ae431059e75d36170a5ae6b44cc4d06d43613215 to < 3af94f4e3526efdf52d84d7ba8d9fb8e8facb93a · ae431059e75d36170a5ae6b44cc4d06d43613215 to < 024be82ac4c4df650cc6daca6d7db79daee95470 · ae431059e75d36170a5ae6b44cc4d06d43613215 to < 0ee2c883b62deb74d8c43007e8049dc006d3a2fb · 393893693a523e053f84d69320d090b93503f79f · 6.12.59 to < 6.12.118 · 6.17.9 to < 6.18 · Other versions: unaffected | Affected | Not stated | Linux |
| Linux | — | Linux6.18 (affected) · 0 to < 6.18 (unaffected · semver) · 6.12.118 through 6.12.* (unaffected · semver) · 6.18.64 through 6.18.* (unaffected · semver) · 7.3.2 through 7.3.* (unaffected · semver) · 7.4-rc1 and later (unaffected · original_commit_for_fix) · Other versions: affected | Version-specific | Not stated | Linux |
| Amazon Linux | AL2 | Release evaluation | Not Affected | Not required | Amazon Linux assessment |
| Amazon Linux | AL2023 | Release evaluation | Not Affected; Pending Fix | Not stated | Amazon Linux assessment |
| Debian | trixie | linux | Advisory build | 6.12.118-1 | DSA-6652-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | kernel-develaarch64 | Advisory build | 7.3.6-2.1 | OPENSUSE-SU-2026:12733-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | kernel-develppc64le | Advisory build | 7.3.6-2.1 | OPENSUSE-SU-2026:12733-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | kernel-devels390x | Advisory build | 7.3.6-2.1 | OPENSUSE-SU-2026:12733-1 |
Show 13 more entries
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| SUSE / openSUSE | openSUSE-Tumbleweed | kernel-develx86_64 | Advisory build | 7.3.6-2.1 | OPENSUSE-SU-2026:12733-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | kernel-macrosaarch64 | Advisory build | 7.3.6-2.1 | OPENSUSE-SU-2026:12733-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | kernel-macrosppc64le | Advisory build | 7.3.6-2.1 | OPENSUSE-SU-2026:12733-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | kernel-macross390x | Advisory build | 7.3.6-2.1 | OPENSUSE-SU-2026:12733-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | kernel-macrosx86_64 | Advisory build | 7.3.6-2.1 | OPENSUSE-SU-2026:12733-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | kernel-sourceaarch64 | Advisory build | 7.3.6-2.1 | OPENSUSE-SU-2026:12733-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | kernel-sourceppc64le | Advisory build | 7.3.6-2.1 | OPENSUSE-SU-2026:12733-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | kernel-sources390x | Advisory build | 7.3.6-2.1 | OPENSUSE-SU-2026:12733-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | kernel-sourcex86_64 | Advisory build | 7.3.6-2.1 | OPENSUSE-SU-2026:12733-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | kernel-source-vanillaaarch64 | Advisory build | 7.3.6-2.1 | OPENSUSE-SU-2026:12733-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | kernel-source-vanillappc64le | Advisory build | 7.3.6-2.1 | OPENSUSE-SU-2026:12733-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | kernel-source-vanillas390x | Advisory build | 7.3.6-2.1 | OPENSUSE-SU-2026:12733-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | kernel-source-vanillax86_64 | Advisory build | 7.3.6-2.1 | OPENSUSE-SU-2026:12733-1 |
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.
Related advisories
Vendor advisories explicitly linked to this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 7.0 / 10
- Severity
- high
- Provider
- Linux · cna
- Vector string
- CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
- Scenarios
- en: AV:L - kvm_gmem_unbind() runs only from kvm_free_memslot() when KVM_SET_USER_MEMORY_REGION deletes a slot (kvm_vm_ioctl -> kvm_vm_ioctl_set_memory_region -> kvm_set_memslot -> kvm_commit_memory_region). The racer, kvm_gmem_error_folio(), is entered from memory_failure(), not from a remote protocol message. AC:H - The invalidate lock is skipped only after get_file_active() fails on a dying guest_memfd, and the bad window is kvm_gmem_invalidate_start() through kvm_gmem_invalidate_end() in kvm_gmem_error_folio(). That callback runs only from memory_failure() on an ECC/MCE the attacker cannot schedule. PR:L - kvm_vm_ioctl() accepts KVM_CREATE_GUEST_MEMFD and KVM_SET_USER_MEMORY_REGION after checking only that kvm->mm equals current->mm. A user who can open /dev/kvm can create the guest_memfd, close it, and delete the slot; CAP_SYS_ADMIN is not checked. UI:N - The process that owns the VM fd closes the guest_memfd and issues the memslot deletion itself. No other user has to mount, open, or approve anything. S:U - The stuck kvm->mmu_invalidate_in_progress counter and the freed kvm_memory_slot belong to the host KVM instance the caller already controls via the VM fd. The guest cannot invoke kvm_gmem_unbind(), so this does not cross a guest/host boundary. C:H - kvm_free_memslot() kfree()s the slot as soon as the unlocked kvm_gmem_unbind() returns, while kvm_gmem_invalidate_start() can still be in kvm_unmap_gfn_range() reading slot->as_id and, once shadow roots exist, gfn_to_rmap() on slot->arch.rmap[]. Reclaiming that object exposes those reads. I:H - With shadow rmaps allocated, gfn_to_rmap() indexes slot->arch.rmap[] and kvm_zap_rmap() writes through that pointer while kvm_unmap_gfn_range() still holds the slot kvm_free_memslot() has kfree'd. Reclaiming the slab is a kernel write primitive. A:H - If kvm_gmem_invalidate_end() no longer finds the binding, mmu_invalidate_in_progress stays non-zero and mmu_invalidate_retry() returns 1 forever, so faults in gmem_abort() re-enter the guest with no mapping and the vCPU livelocks. The slot use-after-free can also oops the host.
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| Linux | Linux | a8ac2bd0f98e1a230f1eb3260fa552bf2ef1753b to < 4ae4316682cdc78d8f5a856ab0712a8281f211ca (affected · git)ae431059e75d36170a5ae6b44cc4d06d43613215 to < 3af94f4e3526efdf52d84d7ba8d9fb8e8facb93a (affected · git)ae431059e75d36170a5ae6b44cc4d06d43613215 to < 024be82ac4c4df650cc6daca6d7db79daee95470 (affected · git)ae431059e75d36170a5ae6b44cc4d06d43613215 to < 0ee2c883b62deb74d8c43007e8049dc006d3a2fb (affected · git)393893693a523e053f84d69320d090b93503f79f (affected · git)6.12.59 to < 6.12.118 (affected · semver)6.17.9 to < 6.18 (affected · semver)Default: unaffected | Linux · cna |
| Linux | Linux | 6.18 (affected)0 to < 6.18 (unaffected · semver)6.12.118 through 6.12.* (unaffected · semver)6.18.64 through 6.18.* (unaffected · semver)7.3.2 through 7.3.* (unaffected · semver)7.4-rc1 and later (unaffected · original_commit_for_fix)Default: affected | Linux · cna |
Weaknesses
0No weakness assertions.
References
4Provider assertions
1Linux · cna
KVM: guest_memfd: take the invalidate lock when unbinding a dying file
Provenance
- Schema
- 5.2
- Searchable
- yes
- Content hash
- 1e9a64b0a5197543950f5d9596825e4096ce6b251c717ab1c67c874d7f7be206
- Ingested
- 23 Nov 2026, 14:35:29 UTC
- Source record
- Official CVE record