]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
xen/domain: Block more speculative out-of-bound accesses
authorAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 24 Apr 2019 17:53:15 +0000 (18:53 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 13 May 2019 09:35:37 +0000 (10:35 +0100)
c/s f8303458 restricted speculative access for do_vcpu_op(), but neglected its
compat counterpart, which is reachable by guests using the 32bit ABI.

Make an identical adjustment.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Norbert Manthey <nmanthey@amazon.de>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/common/compat/domain.c

index 88bfdc836dd0527866b01a269fd38e33a59c49c9..39877b3ab23db6ee6b0d54de6caaa7ff212c207c 100644 (file)
@@ -39,7 +39,7 @@ int compat_vcpu_op(int cmd, unsigned int vcpuid, XEN_GUEST_HANDLE_PARAM(void) ar
     struct vcpu *v;
     int rc = 0;
 
-    if ( vcpuid >= d->max_vcpus || (v = d->vcpu[vcpuid]) == NULL )
+    if ( (v = domain_vcpu(d, vcpuid)) == NULL )
         return -ENOENT;
 
     switch ( cmd )