mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-04 08:17:46 +00:00
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>
This commit is contained in:
parent
d2ddd1c483
commit
081bca0e6b
1 changed files with 5 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue