Skip to contentSkip to conversation

CVE-2026-63941: KVM: arm64: Correctly cap ZCR_EL2 provided by a guest hypervisor

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Jul 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: arm64: Correctly cap ZCR_EL2 provided by a guest hypervisor

ZCR_EL2 can be updated by a VHE guest hypervisor either using ZCR_EL2 (which traps) or ZCR_EL1 (which does not trap). KVM handles both in different way:

- on ZCR_EL2 trap, ZCR_EL2.LEN is immediately capped at the VM's own VL limit. This has the potential to break existing SW that relies on the full LEN field to be stateful.

- on ZCR_EL1 access, we do absolutely nothing.

On restoring the SVE context for an L2 guest, we directly restore the guest hypervisor's view of ZCR_EL2 into the physical ZCR_EL2. If the guest's view of the register was updated using the ZCR_EL2 accessor, the value has already been sanitised (with the caveat mentioned above).

But if the guest used ZCR_EL1, the raw value is written into the HW, and the L2 guest can now access VLs that it shouldn't.

Fix all the above by moving the VL capping to the restore points, ensuring that:

- the HW is always programmed with a capped value, irrespective of the accessor being used,

- the ZCR_EL2.LEN field is always completely stateful, irrespective of the accessor being used.

Additionally, move ZCR_EL2 to be a sanitised register, ensuring that only the LEN field is actually stateful. This requires some creative construction of the RES0 mask, as the sysreg generation script does not yet generate RAZ/WI fields.

[maz: rewrote commit message, tidy up access_zcr_el2()]

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

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

	Issue introduced in 6.11 with commit b3d29a8230998b36afecf494b199211d26052785 and fixed in 7.0.12 with commit 742a9b5ccd8c46caf983ca90c94f855466968e34
	Issue introduced in 6.11 with commit b3d29a8230998b36afecf494b199211d26052785 and fixed in 7.1 with commit 83726330748981372bde86ed5411d7b306612991

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

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/include/asm/kvm_host.h
	arch/arm64/kvm/hyp/include/hyp/switch.h
	arch/arm64/kvm/nested.c
	arch/arm64/kvm/sys_regs.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/742a9b5ccd8c46caf983ca90c94f855466968e34
	https://git.kernel.org/stable/c/83726330748981372bde86ed5411d7b306612991