x86/soft-reset: Drop gfn reference after calling get_gfn_query()
authorAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 7 Nov 2018 12:25:19 +0000 (12:25 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 22 Nov 2018 17:58:46 +0000 (17:58 +0000)
get_gfn_query() internally takes the p2m lock, and this error path leaves it
locked.

This wasn't included in XSA-277 because the error path can only be triggered
by a carefully timed phymap operation concurrent with the domain being paused
and the toolstack issuing DOMCTL_soft_reset.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/domain.c

index 295b10c48c75611b9a58f94a62b1e8d2c7d5c58c..b4d59487ad3bb0aef96d75ddd5731dc40f946ce8 100644 (file)
@@ -725,7 +725,7 @@ int arch_domain_soft_reset(struct domain *d)
         printk(XENLOG_G_ERR "Failed to get Dom%d's shared_info GFN (%lx)\n",
                d->domain_id, gfn);
         ret = -EINVAL;
-        goto exit_put_page;
+        goto exit_put_gfn;
     }
 
     new_page = alloc_domheap_page(d, 0);