diff options
author | Avi Kivity <avi@redhat.com> | 2010-08-26 04:06:15 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2010-10-24 04:51:35 -0400 |
commit | 081bca0e6b87d0c7b9ade7ffee1f44aca336a8fa (patch) | |
tree | ecb4c0ef30dfab8ac6c9c40b1406b237e37e4fd4 /arch/x86/kvm/emulate.c | |
parent | d2ddd1c48364e4161052d6089f06b2cf3c50496b (diff) |
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 <avi@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86/kvm/emulate.c')
-rw-r--r-- | arch/x86/kvm/emulate.c | 5 |
1 files changed, 5 insertions, 0 deletions
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) | |||
2974 | goto done; | 2974 | goto done; |
2975 | } | 2975 | } |
2976 | 2976 | ||
2977 | if ((c->d & SrcMask) == SrcMemFAddr && c->src.type != OP_MEM) { | ||
2978 | emulate_ud(ctxt); | ||
2979 | goto done; | ||
2980 | } | ||
2981 | |||
2977 | /* Privileged instruction can be executed only in CPL=0 */ | 2982 | /* Privileged instruction can be executed only in CPL=0 */ |
2978 | if ((c->d & Priv) && ops->cpl(ctxt->vcpu)) { | 2983 | if ((c->d & Priv) && ops->cpl(ctxt->vcpu)) { |
2979 | emulate_gp(ctxt, 0); | 2984 | emulate_gp(ctxt, 0); |