From: Avi Kivity Date: Thu, 26 Aug 2010 08:06:15 +0000 (+0300) Subject: KVM: x86 emulator: refuse SrcMemFAddr (e.g. LDS) with register operand X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=081bca0e6b87d0c7b9ade7ffee1f44aca336a8fa;p=linux-beck.git KVM: x86 emulator: refuse SrcMemFAddr (e.g. LDS) with register operand SrcMemFAddr is not defined with the modrm operand designating a register instead of a memory address. Signed-off-by: Avi Kivity Signed-off-by: Marcelo Tosatti --- diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index ec35a71d8b5d..2b9b0feabdba 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -2974,6 +2974,11 @@ x86_emulate_insn(struct x86_emulate_ctxt *ctxt) goto done; } + if ((c->d & SrcMask) == SrcMemFAddr && c->src.type != OP_MEM) { + emulate_ud(ctxt); + goto done; + } + /* Privileged instruction can be executed only in CPL=0 */ if ((c->d & Priv) && ops->cpl(ctxt->vcpu)) { emulate_gp(ctxt, 0);