]> xenbits.xensource.com Git - people/dariof/xen.git/commitdiff
xen/arm: vgic-v3-its: Make vgic_v3_its_free_domain idempotent
authorJulien Grall <julien.grall@arm.com>
Tue, 4 Sep 2018 19:21:53 +0000 (20:21 +0100)
committerJulien Grall <julien.grall@arm.com>
Mon, 1 Oct 2018 11:04:16 +0000 (12:04 +0100)
vgic_v3_its_free_domain may be called before vgic_v3_its_init_domain if
the vGIC was failing to initalize itself. This means the list would be
unitialized and result in a crash.

Thankfully, we only allow ITS for the hardware domain. So the crash is
not a security issue. Fix it by checking whether the list the NULL.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
xen/arch/arm/vgic-v3-its.c

index 32061c6b03a909c8c1db8cc4da5a78dd8f863dd3..9edd97c4e742af1303f557a8bc54702d9b25a6b2 100644 (file)
@@ -1548,6 +1548,10 @@ void vgic_v3_its_free_domain(struct domain *d)
 {
     struct virt_its *pos, *temp;
 
+    /* Cope with unitialized vITS */
+    if ( list_head_is_null(&d->arch.vgic.vits_list) )
+        return;
+
     list_for_each_entry_safe( pos, temp, &d->arch.vgic.vits_list, vits_list )
     {
         list_del(&pos->vits_list);