Skip to contentSkip to conversation

CVE-2026-89917: KVM: arm64: Handle VNCR TLB invalidation race with vcpu_put() VNCR unmapping

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Sep 16

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: arm64: Handle VNCR TLB invalidation race with vcpu_put() VNCR unmapping

While VNCR TLB invalidation always occurs under the MMU lock, vcpu_put() doesn't, while it unmaps the VNCR page.

The problem is that the invalidation evaluates vncr_tlb::cpu to decide whether an unmapping needs to take place (cpu != -1) before performing it. On the other hand, this_cpu_reset_vncr_fixmap() unconditionally unmaps if L1_VNCR_MAPPED is set.

These two obviously can race, with a TOCTOU pattern on the TLBI path, and a BUG_ON() on the vcpu_put() path. And the two can end-up calling vncr_fixmap(-1), with extra lethal effects.

Move the reset of vncr_tlb::cpu to -1 to a common function, and make this update atomic so that only a single thread can reset the field and perform the corresponding unmap. The vcpu_put() still need to unconditionally unmap the current VNCR to close another ugly race.

Finally, the assignment of vncr_tlb::cpu is moved to be kept in sync with the actual mapping, similar to L1_VNCR_MAPPED being set.

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

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

	Issue introduced in 6.16 with commit 7270cc9157f474dfc46750a34c9d7defc686b2eb and fixed in 6.18.52 with commit 5cbd8761d001c11ada73b1753d772c4745a70e72
	Issue introduced in 6.16 with commit 7270cc9157f474dfc46750a34c9d7defc686b2eb and fixed in 7.2.5 with commit 9065c1261f8a05c6a7a2d90048c7c0665ab2896d
	Issue introduced in 6.16 with commit 7270cc9157f474dfc46750a34c9d7defc686b2eb and fixed in 7.3-rc1 with commit 38640bc32be3fcf9526d477155bc19d3f146231f

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-89917

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:

	arch/arm64/kvm/nested.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/5cbd8761d001c11ada73b1753d772c4745a70e72
	https://git.kernel.org/stable/c/9065c1261f8a05c6a7a2d90048c7c0665ab2896d
	https://git.kernel.org/stable/c/38640bc32be3fcf9526d477155bc19d3f146231f