Commit 09e365b46c716bcfd4890ee4c9fb85adc730990b

Authored by Nadav Amit
Committed by Greg Kroah-Hartman
1 parent c4a525417c

KVM: x86: em_ret_far overrides cpl

commit ab646f54f4fd1a8b9671b8707f0739fdd28ce2b1 upstream.

commit d50eaa18039b ("KVM: x86: Perform limit checks when assigning EIP")
mistakenly used zero as cpl on em_ret_far. Use the actual one.

Fixes: d50eaa18039b8b848c2285478d0775335ad5e930
Signed-off-by: Nadav Amit <namit@cs.technion.ac.il>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

arch/x86/kvm/emulate.c
... ... @@ -2128,7 +2128,7 @@
2128 2128 /* Outer-privilege level return is not implemented */
2129 2129 if (ctxt->mode >= X86EMUL_MODE_PROT16 && (cs & 3) > cpl)
2130 2130 return X86EMUL_UNHANDLEABLE;
2131   - rc = __load_segment_descriptor(ctxt, (u16)cs, VCPU_SREG_CS, 0, false,
  2131 + rc = __load_segment_descriptor(ctxt, (u16)cs, VCPU_SREG_CS, cpl, false,
2132 2132 &new_desc);
2133 2133 if (rc != X86EMUL_CONTINUE)
2134 2134 return rc;