mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
common/domain: block speculative out-of-bound accesses
When issuing a vcpu_op hypercall, guests have control over the vcpuid variable. In the old code, this allowed to perform speculative out-of-bound accesses. To block this, we make use of the domain_vcpu function. This is part of the speculative hardening effort. Signed-off-by: Norbert Manthey <nmanthey@amazon.de> Reviewed-by: Jan Beulich <jbeulich@suse.com>
This commit is contained in:
1 parent
93dfd72bdb
commit
f8303458ae
1 file changed
+1
-1
+1
-1
@@ -1364,7 +1364,7 @@ long do_vcpu_op(int cmd, unsigned int vcpuid, XEN_GUEST_HANDLE_PARAM(void) arg)
|
||||
struct vcpu *v;
|
||||
long rc = 0;
|
||||
|
||||
if ( vcpuid >= d->max_vcpus || (v = d->vcpu[vcpuid]) == NULL )
|
||||
if ( (v = domain_vcpu(d, vcpuid)) == NULL )
|
||||
return -ENOENT;
|
||||
|
||||
switch ( cmd )
|
||||
|
||||