Skip to content

Commit

Permalink
KVM: x86 emulator: do not perform address calculations on linear addr…
Browse files Browse the repository at this point in the history
…esses

Linear addresses are supposed to already have segment checks performed on them;
if we play with these addresses the checks become invalid.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
  • Loading branch information
avikivity committed Jan 12, 2011
1 parent 90de84f commit 30b31ab
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arch/x86/kvm/emulate.c
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,8 @@ static int read_descriptor(struct x86_emulate_ctxt *ctxt,
ctxt->vcpu, NULL);
if (rc != X86EMUL_CONTINUE)
return rc;
rc = ops->read_std(linear(ctxt, addr) + 2, address, op_bytes,
addr.ea += 2;
rc = ops->read_std(linear(ctxt, addr), address, op_bytes,
ctxt->vcpu, NULL);
return rc;
}
Expand Down

0 comments on commit 30b31ab

Please sign in to comment.