From: "Jan Beulich" Subject: [PATCH] VMX: values written to MSR_IA32_SYSENTER_E[IS]P should be canonical Date: Thu, 30 Oct 2014 14:41:17 +0000 Message-ID: <54525C1D0200007800043911@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part3D08361D.1__=" Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Xjqud-0004GN-Ga for xen-devel@lists.xenproject.org; Thu, 30 Oct 2014 14:41:19 +0000 List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel Cc: Kevin Tian , Eddie Dong , Jun Nakajima List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__Part3D08361D.1__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline A recent KVM change by Nadav Amit helped spot that we have the same issue as they did. Signed-off-by: Jan Beulich Reviewed-by: Tim Deegan --- a/xen/arch/x86/hvm/vmx/vmx.c +++ b/xen/arch/x86/hvm/vmx/vmx.c @@ -2273,9 +2273,13 @@ static int vmx_msr_write_intercept(unsig __vmwrite(GUEST_SYSENTER_CS, msr_content); break; case MSR_IA32_SYSENTER_ESP: + if ( !is_canonical_address(msr_content) ) + goto gp_fault; __vmwrite(GUEST_SYSENTER_ESP, msr_content); break; case MSR_IA32_SYSENTER_EIP: + if ( !is_canonical_address(msr_content) ) + goto gp_fault; __vmwrite(GUEST_SYSENTER_EIP, msr_content); break; case MSR_IA32_DEBUGCTLMSR: { --=__Part3D08361D.1__= Content-Type: text/plain; name="VMX-sysenter-MSRs-canonical.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="VMX-sysenter-MSRs-canonical.patch" VMX: values written to MSR_IA32_SYSENTER_E[IS]P should be canonical=0A=0AA = recent KVM change by Nadav Amit helped spot=0Atha= t we have the same issue as they did.=0A=0ASigned-off-by: Jan Beulich = =0AReviewed-by: Tim Deegan =0A=0A--- = a/xen/arch/x86/hvm/vmx/vmx.c=0A+++ b/xen/arch/x86/hvm/vmx/vmx.c=0A@@ = -2273,9 +2273,13 @@ static int vmx_msr_write_intercept(unsig=0A = __vmwrite(GUEST_SYSENTER_CS, msr_content);=0A break;=0A case = MSR_IA32_SYSENTER_ESP:=0A+ if ( !is_canonical_address(msr_content) = )=0A+ goto gp_fault;=0A __vmwrite(GUEST_SYSENTER_ESP, = msr_content);=0A break;=0A case MSR_IA32_SYSENTER_EIP:=0A+ = if ( !is_canonical_address(msr_content) )=0A+ goto = gp_fault;=0A __vmwrite(GUEST_SYSENTER_EIP, msr_content);=0A = break;=0A case MSR_IA32_DEBUGCTLMSR: {=0A --=__Part3D08361D.1__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --=__Part3D08361D.1__=--