Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bf0b682c authored by Nadav Amit's avatar Nadav Amit Committed by Paolo Bonzini
Browse files

KVM: x86: Sysexit emulation does not mask RIP/RSP



If the operand size is not 64-bit, then the sysexit instruction should assign
ECX to RSP and EDX to RIP.  The current code assigns the full 64-bits.

Fix it by masking.

Signed-off-by: default avatarNadav Amit <namit@cs.technion.ac.il>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 58b7075d
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -2417,6 +2417,8 @@ static int em_sysexit(struct x86_emulate_ctxt *ctxt)
		if ((msr_data & 0xfffc) == 0x0)
			return emulate_gp(ctxt, 0);
		ss_sel = (u16)(msr_data + 24);
		rcx = (u32)rcx;
		rdx = (u32)rdx;
		break;
	case X86EMUL_MODE_PROT64:
		cs_sel = (u16)(msr_data + 32);