Skip to content

Commit b3f1dfb

Browse files
jsmattsonjrrkrcmar
authored andcommitted
KVM: nVMX: Disallow VM-entry in MOV-SS shadow
Immediately following MOV-to-SS/POP-to-SS, VM-entry is disallowed. This check comes after the check for a valid VMCS. When this check fails, the instruction pointer should fall through to the next instruction, the ALU flags should be set to indicate VMfailValid, and the VM-instruction error should be set to 26 ("VM entry with events blocked by MOV SS"). Signed-off-by: Jim Mattson <[email protected]> Signed-off-by: Radim Krčmář <[email protected]>
1 parent 4c4a6f7 commit b3f1dfb

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

arch/x86/kvm/vmx.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10492,6 +10492,7 @@ static int nested_vmx_run(struct kvm_vcpu *vcpu, bool launch)
1049210492
{
1049310493
struct vmcs12 *vmcs12;
1049410494
struct vcpu_vmx *vmx = to_vmx(vcpu);
10495+
u32 interrupt_shadow = vmx_get_interrupt_shadow(vcpu);
1049510496
u32 exit_qual;
1049610497
int ret;
1049710498

@@ -10516,6 +10517,12 @@ static int nested_vmx_run(struct kvm_vcpu *vcpu, bool launch)
1051610517
* for misconfigurations which will anyway be caught by the processor
1051710518
* when using the merged vmcs02.
1051810519
*/
10520+
if (interrupt_shadow & KVM_X86_SHADOW_INT_MOV_SS) {
10521+
nested_vmx_failValid(vcpu,
10522+
VMXERR_ENTRY_EVENTS_BLOCKED_BY_MOV_SS);
10523+
goto out;
10524+
}
10525+
1051910526
if (vmcs12->launch_state == launch) {
1052010527
nested_vmx_failValid(vcpu,
1052110528
launch ? VMXERR_VMLAUNCH_NONCLEAR_VMCS

0 commit comments

Comments
 (0)