Skip to contentSkip to conversation

CVE-2026-99335: KVM: guest_memfd: Establish memslot<=>guest_memfd bindings *after* memslot is ready

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Nov 19

lore
Share & tools
lore
#0 lore raw

From: Greg Kroah-Hartman <[email protected]>

Description
===========

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

KVM: guest_memfd: Establish memslot<=>guest_memfd bindings *after* memslot is ready

Wait to bind a memslot to a guest_memfd instance until *after* the memslot is fully prepared, as creating the binding in guest_memfd will effectively expose the memslot to readers. As pointed out by Sashiko, binding the memslot before it's ready to be exposed to the rest of the world can break various memslot assumption and rules. E.g. x86 could observe a NULL rmap pointer if a PUNCH_HOLE hit the guest_memfd after the binding was created, but before KVM made it through kvm_prepare_memory_region().

The Linux kernel CVE team has assigned CVE-2026-99335 to this issue.

Affected and fixed versions
===========================

	Issue introduced in 6.8 with commit a7800aa80ea4d5356b8474c2302812e9d4926fa6 and fixed in 6.12.118 with commit 698f807aa8df9414fdc23d9ea454f4883b5b08ff
	Issue introduced in 6.8 with commit a7800aa80ea4d5356b8474c2302812e9d4926fa6 and fixed in 6.18.64 with commit dc0cb5d30647b22a3da252a2847ed8f6afb5d567
	Issue introduced in 6.8 with commit a7800aa80ea4d5356b8474c2302812e9d4926fa6 and fixed in 7.3.2 with commit fd224f1778e13660aec4e1f51fcdaeab5794e7ee
	Issue introduced in 6.8 with commit a7800aa80ea4d5356b8474c2302812e9d4926fa6 and fixed in 7.4-rc1 with commit 3fe5d2944e5ac3fc5073344b0982c73703332e18

Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.

Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at

	https://cve.org/CVERecord/?id=CVE-2026-99335

will be updated if fixes are backported, please check that for the most up to date information about this issue.

Affected files
==============

The file(s) affected by this issue are:
virt/kvm/kvm_main.c

Mitigation
==========

The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:

	https://git.kernel.org/stable/c/698f807aa8df9414fdc23d9ea454f4883b5b08ff
	https://git.kernel.org/stable/c/dc0cb5d30647b22a3da252a2847ed8f6afb5d567
	https://git.kernel.org/stable/c/fd224f1778e13660aec4e1f51fcdaeab5794e7ee
	https://git.kernel.org/stable/c/3fe5d2944e5ac3fc5073344b0982c73703332e18