mirror of
https://github.com/xen-project/xen.git
synced 2026-10-30 03:00:05 +01:00
arm/vgic-v3: Fix data abort in get_vcpu_from_rdist()
Just because vcpu_id is within d->max_vcpus doesn't mean d->vcpu[vcpu_id] is
non-NULL. Use the proper accessor to look up a vcpu object.
Reported-by: Michal Orzel <michal.orzel@amd.com>
Fixes: acf65e5a25 ("xen/arm: vgic-v3: Emulate correctly the re-distributor")
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Julien Grall <julien@xen.org>
This commit is contained in:
1 parent
b83e1d9a1a
commit
7ad6cfa66f
1 file changed
+3
-3
@@ -1111,10 +1111,10 @@ static struct vcpu *get_vcpu_from_rdist(struct domain *d,
|
||||
unsigned int vcpu_id;
|
||||
|
||||
vcpu_id = region->first_cpu + ((gpa - region->base) / GICV3_GICR_SIZE);
|
||||
if ( unlikely(vcpu_id >= d->max_vcpus) )
|
||||
return NULL;
|
||||
|
||||
v = d->vcpu[vcpu_id];
|
||||
v = domain_vcpu(d, vcpu_id);
|
||||
if ( !v )
|
||||
return NULL;
|
||||
|
||||
*offset = gpa - v->arch.vgic.rdist_base;
|
||||
|
||||
|
||||