|
@@ -7659,7 +7659,7 @@ static int handle_invept(struct kvm_vcpu *vcpu)
|
|
|
|
|
|
types = (vmx->nested.nested_vmx_ept_caps >> VMX_EPT_EXTENT_SHIFT) & 6;
|
|
|
|
|
|
- if (!(types & (1UL << type))) {
|
|
|
+ if (type >= 32 || !(types & (1 << type))) {
|
|
|
nested_vmx_failValid(vcpu,
|
|
|
VMXERR_INVALID_OPERAND_TO_INVEPT_INVVPID);
|
|
|
skip_emulated_instruction(vcpu);
|
|
@@ -7722,7 +7722,7 @@ static int handle_invvpid(struct kvm_vcpu *vcpu)
|
|
|
|
|
|
types = (vmx->nested.nested_vmx_vpid_caps >> 8) & 0x7;
|
|
|
|
|
|
- if (!(types & (1UL << type))) {
|
|
|
+ if (type >= 32 || !(types & (1 << type))) {
|
|
|
nested_vmx_failValid(vcpu,
|
|
|
VMXERR_INVALID_OPERAND_TO_INVEPT_INVVPID);
|
|
|
skip_emulated_instruction(vcpu);
|