]> xenbits.xensource.com Git - xen.git/commit
x86/VMX: sanitize rIP before re-entering guest
authorJan Beulich <jbeulich@suse.com>
Wed, 17 Feb 2016 15:18:08 +0000 (16:18 +0100)
committerJan Beulich <jbeulich@suse.com>
Wed, 17 Feb 2016 15:18:08 +0000 (16:18 +0100)
commitffbbfda37782a2408953af1a3e00ada80bb141bc
tree75eb9df2878496a99b58eb87445f46214908ee24
parentc61a6f74f80eb36ed83a82f713db3143159b9009
x86/VMX: sanitize rIP before re-entering guest

... to prevent guest user mode arranging for a guest crash (due to
failed VM entry). (On the AMD system I checked, hardware is doing
exactly the canonicalization being added here.)

Note that fixing this in an architecturally correct way would be quite
a bit more involved: Making the x86 instruction emulator check all
branch targets for validity, plus dealing with invalid rIP resulting
from update_guest_eip() or incoming directly during a VM exit. The only
way to get the latter right would be by not having hardware do the
injection.

Note further that there are a two early returns from
vmx_vmexit_handler(): One (through vmx_failed_vmentry()) leads to
domain_crash() anyway, and the other covers real mode only and can
neither occur with a non-canonical rIP nor result in an altered rIP,
so we don't need to force those paths through the checking logic.

This is CVE-2016-2271 / XSA-170.

Reported-by: 刘令 <liuling-it@360.cn>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/hvm/vmx/vmx.c