8.8high
KVM: arm64: Fix ID register initialization for non-protected pKVM guests
- Severity
- 8.8high CVSS:3.1 by Linux
- Exploit likelihood
- 0.14% (higher than 3% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- Linux
Description
In the Linux kernel, the following vulnerability has been resolved: KVM: arm64: Fix ID register initialization for non-protected pKVM guests In protected mode, the hypervisor maintains a separate instance of the `kvm` structure for each VM. For non-protected VMs, this structure is initialized from the host's `kvm` state. Currently, `pkvm_init_features_from_host()` copies the `KVM_ARCH_FLAG_ID_REGS_INITIALIZED` flag from the host without the underlying `id_regs` data being initialized. This results in the hypervisor seeing the flag as set while the ID registers remain zeroed. Consequently, `kvm_has_feat()` checks at EL2 fail (return 0) for non-protected VMs. This breaks logic that relies on feature detection, such as `ctxt_has_tcrx()` for TCR2_EL1 support. As a result, certain system registers (e.g., TCR2_EL1, PIR_EL1, POR_EL1) are not saved/restored during the world switch, which could lead to state corruption. Fix this by explicitly copying the ID registers from the host `kvm` to the hypervisor `kvm` for non-protected VMs during initialization, since we trust the host with its non-protected guests' features. Also ensure `KVM_ARCH_FLAG_ID_REGS_INITIALIZED` is cleared initially in `pkvm_init_features_from_host` so that `vm_copy_id_regs` can properly initialize them and set the flag once done.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Linux Linux | from 41d6028e28bd474298ff10409c292ec46cf43a90 before bce3847f7c51b86332bf2e554c9e80ca3820f16c, from 41d6028e28bd474298ff10409c292ec46cf43a90 before 858620655c1fbff05997e162fc7d83a3293d5142, from 41d6028e28bd474298ff10409c292ec46cf43a90 before 7e7c2cf0024d89443a7af52e09e47b1fe634ab17, 6.14 Not affected: before 6.14, from 6.18.17 up to 6.18.*, from 6.19.7 up to 6.19.*, from 7.0 up to * | CVE List |
| linux linux_kernel | from 6.14.1 before 6.18.17, from 6.19 before 6.19.7, 6.14, 7.0 | NVD |
All scores
| Linux | 8.8high CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H |
| NVD | 5.5medium CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H |
What each source says
CVE List
In the Linux kernel, the following vulnerability has been resolved: KVM: arm64: Fix ID register initialization for non-protected pKVM guests In protected mode, the hypervisor maintains a separate instance of the `kvm` structure for each VM. For non-protected VMs, this structure is initialized from the host's `kvm` state. Currently, `pkvm_init_features_from_host()` copies the `KVM_ARCH_FLAG_ID_REGS_INITIALIZED` flag from the host without the underlying `id_regs` data being initialized. This results in the hypervisor seeing the flag as set while the ID registers remain zeroed. Consequently, `kvm_has_feat()` checks at EL2 fail (return 0) for non-protected VMs. This breaks logic that relies on feature detection, such as `ctxt_has_tcrx()` for TCR2_EL1 support. As a result, certain system registers (e.g., TCR2_EL1, PIR_EL1, POR_EL1) are not saved/restored during the world switch, which could lead to state corruption. Fix this by explicitly copying the ID registers from the host `kvm` to the hypervisor `kvm` for non-protected VMs during initialization, since we trust the host with its non-protected guests' features. Also ensure `KVM_ARCH_FLAG_ID_REGS_INITIALIZED` is cleared initially in `pkvm_init_features_from_host` so that `vm_copy_id_regs` can properly initialize them and set the flag once done.
NVD (es)
En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta: KVM: arm64: Corrección de la inicialización de registros ID para invitados pKVM no protegidos En modo protegido, el hipervisor mantiene una instancia separada de la estructura 'kvm' para cada VM. Para VMs no protegidas, esta estructura se inicializa a partir del estado 'kvm' del host. Actualmente, 'pkvm_init_features_from_host()' copia el flag 'KVM_ARCH_FLAG_ID_REGS_INITIALIZED' del host sin que los datos subyacentes de 'id_regs' se inicialicen. Esto resulta en que el hipervisor ve el flag como establecido mientras los registros ID permanecen a cero. Consecuentemente, las comprobaciones de 'kvm_has_feat()' en EL2 fallan (devuelven 0) para VMs no protegidas. Esto rompe la lógica que depende de la detección de características, como 'ctxt_has_tcrx()' para el soporte de TCR2_EL1. Como resultado, ciertos registros del sistema (p. ej., TCR2_EL1, PIR_EL1, POR_EL1) no se guardan/restauran durante el world switch, lo que podría llevar a la corrupción del estado. Esto se soluciona copiando explícitamente los registros ID del 'kvm' del host al 'kvm' del hipervisor para VMs no protegidas durante la inicialización, ya que confiamos en el host con las características de sus invitados no protegidos. También se debe asegurar que 'KVM_ARCH_FLAG_ID_REGS_INITIALIZED' se borre inicialmente en 'pkvm_init_features_from_host' para que 'vm_copy_id_regs' pueda inicializarlos correctamente y establecer el flag una vez terminado.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-23425 changed 2026-08-05 | CVE Terms of Use |
| NVD | CVE-2026-23425 changed 2026-07-21 | Public domain |