diff options
| author | Marc Zyngier <maz@kernel.org> | 2026-10-20 07:43:06 +0100 |
|---|---|---|
| committer | Marc Zyngier <maz@kernel.org> | 2026-10-26 10:31:40 +0000 |
| commit | 68c11eed4f8097ef1b71c30679e96eb654df29e0 (patch) | |
| tree | 5cbd1bb00b020f3cb97d96f25cdcb682ac5d18a1 /scripts/basic | |
| parent | 3bb853ad84244f0b86ab12f029bc4a0c9c7100e8 (diff) | |
| download | linux-68c11eed4f8097ef1b71c30679e96eb654df29e0.tar.gz linux-68c11eed4f8097ef1b71c30679e96eb654df29e0.zip | |
KVM: arm64: Sanitise ID_AA64MMFR3_EL1.S1P[IO]E
KVM uses the VM's ID registers as the source of truth for what the
guest has, but userspace can expose S1PIE or S1POE without the features
they imply. As per the architecture, both imply TCR2 and ATS1A, and
S1POE also implies HPDS. With TCR2 hidden, the world switch skips
PIR_EL1, PIRE0_EL1 and POR_EL1 while KVM doesn't trap them, so the guest
accesses registers that are neither trapped nor switched. Under VHE,
that leaks values between guests. On nVHE and hVHE, pKVM included, the
host kernel resumes with the guest's PIR_EL1 and PIRE0_EL1.
On first run, clear S1PIE and S1POE from the VM's ID registers when the
features they imply are missing, before anything derives state from
them. The guest and userspace then see neither feature, and the guest's
accesses to their registers UNDEF.
Fixes: 70ed7238297fb ("KVM: arm64: Sanitise ID_AA64MMFR3_EL1")
Fixes: d4a89e5aee23e ("KVM: arm64: Expose S1PIE to guests")
Reported-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20260930-arm64-gcs-v21-2-3556644cd927@kernel.org
Link: https://lore.kernel.org/r/8633u229lq.wl-maz@kernel.org
Cc: stable@vger.kernel.org
Co-developed-by: Fuad Tabba <fuad.tabba@linux.dev>
Signed-off-by: Fuad Tabba <fuad.tabba@linux.dev>
Reviewed-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
Link: https://patch.msgid.link/20261020064306.1542865-1-fuad.tabba@linux.dev
Signed-off-by: Marc Zyngier <maz@kernel.org>
Diffstat (limited to 'scripts/basic')
0 files changed, 0 insertions, 0 deletions
