[PW_SID:1146017] KVM: riscv: Avoid overwriting existing G-stage tables with huge leaves - #2473
[PW_SID:1146017] KVM: riscv: Avoid overwriting existing G-stage tables with huge leaves#2473linux-riscv-bot wants to merge 2 commits into
Conversation
RISC-V KVM can overwrite an existing G-stage table entry when installing a huge leaf mapping. If the target huge range already has a lower-level page table, kvm_riscv_gstage_set_pte() can replace the non-leaf entry with a leaf PTE. This disconnects the lower-level page table and can change guest-visible mappings or leak the page-table page. Reject replacing a valid non-leaf PTE with a leaf PTE. If huge-page installation hits such a conflict, fall back to a 4K mapping for the faulting GPA and leave the existing page-table structure intact. Suggested-by: Sashiko <sashiko-bot@kernel.org> Fixes: 9d05c1f ("RISC-V: KVM: Implement stage2 page table programming") Signed-off-by: Jinyu Tang <jinyu.tang@linux.dev> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
3c76238 to
492cc66
Compare
|
Patch 1: "KVM: riscv: Avoid overwriting existing G-stage tables with huge leaves" |
|
Patch 1: "KVM: riscv: Avoid overwriting existing G-stage tables with huge leaves" |
|
Patch 1: "KVM: riscv: Avoid overwriting existing G-stage tables with huge leaves" |
|
Patch 1: "KVM: riscv: Avoid overwriting existing G-stage tables with huge leaves" |
|
Patch 1: "KVM: riscv: Avoid overwriting existing G-stage tables with huge leaves" |
|
Patch 1: "KVM: riscv: Avoid overwriting existing G-stage tables with huge leaves" |
|
Patch 1: "KVM: riscv: Avoid overwriting existing G-stage tables with huge leaves" |
|
Patch 1: "KVM: riscv: Avoid overwriting existing G-stage tables with huge leaves" |
|
Patch 1: "KVM: riscv: Avoid overwriting existing G-stage tables with huge leaves" |
|
Patch 1: "KVM: riscv: Avoid overwriting existing G-stage tables with huge leaves" |
|
Patch 1: "KVM: riscv: Avoid overwriting existing G-stage tables with huge leaves" |
|
Patch 1: "KVM: riscv: Avoid overwriting existing G-stage tables with huge leaves" |
bb1a926 to
6f6f7c0
Compare
PR for series 1146017 applied to workflow__riscv__fixes
Name: KVM: riscv: Avoid overwriting existing G-stage tables with huge leaves
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1146017
Version: 1