mirror of
https://github.com/torvalds/linux.git
synced 2024-11-07 04:32:03 +00:00
KVM: MMU: fix check the reserved bits on the gpte of L2
Current code always uses arch.mmu to check the reserved bits on guest gpte which is valid only for L1 guest, we should use arch.nested_mmu instead when we translate gva to gpa for the L2 guest Fix it by using @mmu instead since it is adapted to the current mmu mode automatically The bug can be triggered when nested npt is used and L1 guest and L2 guest use different mmu mode Reported-by: Jan Kiszka <jan.kiszka@siemens.com> Reviewed-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
205befd9a5
commit
027664216d
@ -218,8 +218,7 @@ retry_walk:
|
||||
if (unlikely(!is_present_gpte(pte)))
|
||||
goto error;
|
||||
|
||||
if (unlikely(is_rsvd_bits_set(&vcpu->arch.mmu, pte,
|
||||
walker->level))) {
|
||||
if (unlikely(is_rsvd_bits_set(mmu, pte, walker->level))) {
|
||||
errcode |= PFERR_RSVD_MASK | PFERR_PRESENT_MASK;
|
||||
goto error;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user