From: "Jan Beulich" Subject: Re: [PATCH v3 2/2] x86/hvm: Don't intercept #UD exceptions in general Date: Mon, 01 Feb 2016 05:23:00 -0700 Message-ID: <56AF5C3402000078000CCEFD@prv-mh.provo.novell.com> References: <56AA09D002000078000CBF7A@prv-mh.provo.novell.com> <1454095066-14295-1-git-send-email-andrew.cooper3@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1454095066-14295-1-git-send-email-andrew.cooper3@citrix.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andrew Cooper Cc: Kevin Tian , Aravind Gopalakrishnan , Jun Nakajima , Suravee Suthikulpanit , Xen-devel List-Id: xen-devel@lists.xenproject.org >>> On 29.01.16 at 20:17, wrote: > c/s 0f1cb96e "x86 hvm: Allow cross-vendor migration" caused HVM domains to > unconditionally intercept #UD exceptions. While cross-vendor migration is > cool as a demo, it is extremely niche. > > Intercepting #UD allows userspace code in a multi-vcpu guest to execute > arbitrary instructions in the x86 emulator by having one thread execute a > ud2a > instruction, and having a second thread rewrite the instruction before the > emulator performs an instruction fetch. > > XSAs 105, 106 and 110 are all examples where guest userspace can use bugs in > the x86 emulator to compromise security of the domain, either by privilege > escalation or causing a crash. > > c/s 2d67a7a4 "x86: synchronize PCI config space access decoding" > introduced (amongst other things) a per-domain vendor, based on the guests > cpuid policy. > > Use the per-guest vendor to enable #UD interception only when a domain is > configured for a vendor different to the current hardware. (#UD > interception > is also enabled if hvm_fep is specified on the Xen command line. This is a > debug-only option whose entire purpose is for testing the x86 emulator.) > > As a result, the overwhelming majority of usecases now have #UD interception > disabled, removing an attack surface for malicious guest userspace. > > Signed-off-by: Andrew Cooper > Reviewed-by: Boris Ostrovsky Reviewed-by: Jan Beulich