From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: [PATCH v2 2/2] KVM: x86 emulator: do not perform address calculations on linear addresses Date: Wed, 17 Nov 2010 15:28:22 +0200 Message-ID: <1290000502-28669-3-git-send-email-avi@redhat.com> References: <1290000502-28669-1-git-send-email-avi@redhat.com> To: Marcelo Tosatti , kvm@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:9106 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757404Ab0KQN2X (ORCPT ); Wed, 17 Nov 2010 08:28:23 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id oAHDSN95004412 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 17 Nov 2010 08:28:23 -0500 Received: from cleopatra.tlv.redhat.com (cleopatra.tlv.redhat.com [10.35.255.11]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id oAHDSMi5027785 for ; Wed, 17 Nov 2010 08:28:23 -0500 In-Reply-To: <1290000502-28669-1-git-send-email-avi@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 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 --- arch/x86/kvm/emulate.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index e967055..bdbbb18 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -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; } -- 1.7.3.1