* [PATCH] KVM: x86 emulator: refuse SrcMemFAddr (e.g. LDS) with register operand
@ 2010-08-26 8:06 Avi Kivity
2010-08-26 17:34 ` Marcelo Tosatti
0 siblings, 1 reply; 2+ messages in thread
From: Avi Kivity @ 2010-08-26 8:06 UTC (permalink / raw)
To: Marcelo Tosatti, kvm
SrcMemFAddr is not defined with the modrm operand designating a register
instead of a memory address.
Signed-off-by: Avi Kivity <avi@redhat.com>
---
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 d613690..36b0e29 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -2957,6 +2957,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);
--
1.7.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] KVM: x86 emulator: refuse SrcMemFAddr (e.g. LDS) with register operand
2010-08-26 8:06 [PATCH] KVM: x86 emulator: refuse SrcMemFAddr (e.g. LDS) with register operand Avi Kivity
@ 2010-08-26 17:34 ` Marcelo Tosatti
0 siblings, 0 replies; 2+ messages in thread
From: Marcelo Tosatti @ 2010-08-26 17:34 UTC (permalink / raw)
To: Avi Kivity; +Cc: kvm
On Thu, Aug 26, 2010 at 11:06:15AM +0300, Avi Kivity wrote:
> SrcMemFAddr is not defined with the modrm operand designating a register
> instead of a memory address.
>
> Signed-off-by: Avi Kivity <avi@redhat.com>
> ---
> arch/x86/kvm/emulate.c | 5 +++++
> 1 files changed, 5 insertions(+), 0 deletions(-)
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-08-26 19:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-26 8:06 [PATCH] KVM: x86 emulator: refuse SrcMemFAddr (e.g. LDS) with register operand Avi Kivity
2010-08-26 17:34 ` Marcelo Tosatti
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).