[PW_SID:1092007] riscv: KVM: Fix missing TLB flush on HENVCFG.PMM updates#1895
[PW_SID:1092007] riscv: KVM: Fix missing TLB flush on HENVCFG.PMM updates#1895linux-riscv-bot wants to merge 2 commits into
Conversation
According to the RISC-V Privileged ISA specification, if henvcfg.PMM is changed from or to a value where (XLEN-PMLEN) is less than the GPA width supported by the hgatp translation mode of that guest, hypervisors must execute an HFENCE.GVMA with rs1=x0. Currently, when a guest dynamically changes pointer masking mode via the SBI FWFT extension, kvm_sbi_fwft_set_pointer_masking_pmlen() directly modifies the hardware CSR_HENVCFG from the non-one-reg-access path without issuing the required TLB invalidation Fix this by adding an unconditional HFENCE.GVMA after the CSR write. This vulnerability was discovered and reported by my SpecHunter, an AI-driven architecture specification analysis tool. Link: https://github.com/yizishun/rv-isa-sec/blob/master/output/riscv-isa-manual/pr-2494/linux.txt Fixes: 48d6710 ("RISC-V: KVM: Implement ONE_REG interface for SBI FWFT state") Assisted-by: DeepSeek:DeepSeek-V4-Pro Signed-off-by: Zishun Yi <vulab@iscas.ac.cn> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
|
Patch 1: "riscv: KVM: Fix missing TLB flush on HENVCFG.PMM updates" |
|
Patch 1: "riscv: KVM: Fix missing TLB flush on HENVCFG.PMM updates" |
|
Patch 1: "riscv: KVM: Fix missing TLB flush on HENVCFG.PMM updates" |
|
Patch 1: "riscv: KVM: Fix missing TLB flush on HENVCFG.PMM updates" |
|
Patch 1: "riscv: KVM: Fix missing TLB flush on HENVCFG.PMM updates" |
|
Patch 1: "riscv: KVM: Fix missing TLB flush on HENVCFG.PMM updates" |
|
Patch 1: "riscv: KVM: Fix missing TLB flush on HENVCFG.PMM updates" |
|
Patch 1: "riscv: KVM: Fix missing TLB flush on HENVCFG.PMM updates" |
|
Patch 1: "riscv: KVM: Fix missing TLB flush on HENVCFG.PMM updates" |
|
Patch 1: "riscv: KVM: Fix missing TLB flush on HENVCFG.PMM updates" |
|
Patch 1: "riscv: KVM: Fix missing TLB flush on HENVCFG.PMM updates" |
|
Patch 1: "riscv: KVM: Fix missing TLB flush on HENVCFG.PMM updates" |
2d4fcdd to
cd9d421
Compare
PR for series 1092007 applied to workflow__riscv__fixes
Name: riscv: KVM: Fix missing TLB flush on HENVCFG.PMM updates
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1092007
Version: 1