]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
x86/shim: zap runstate and time area handles during shutdown
authorJan Beulich <jbeulich@suse.com>
Mon, 2 Oct 2023 15:11:19 +0000 (17:11 +0200)
committerJulien Grall <jgrall@amazon.com>
Thu, 5 Oct 2023 13:08:26 +0000 (14:08 +0100)
While likely the guest would just re-register the same areas after
a possible resume, let's not take this for granted and avoid the risk of
otherwise corrupting guest memory.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Roger Pau Monné <roger.pau@citrix.com>
Release-acked-by: Henry Wang <Henry.Wang@arm.com>
xen/arch/x86/pv/shim.c

index ca0e639db323eeca6144f7d86767c206c99d44c5..7e4bacf7ae400244194a1fcc145b18beb88d1cc6 100644 (file)
@@ -385,6 +385,10 @@ int pv_shim_shutdown(uint8_t reason)
         /* Unmap guest vcpu_info pages. */
         unmap_vcpu_info(v);
 
+        /* Zap runstate and time area handles. */
+        set_xen_guest_handle(runstate_guest(v), NULL);
+        set_xen_guest_handle(v->arch.time_info_guest, NULL);
+
         /* Reset the periodic timer to the default value. */
         vcpu_set_periodic_timer(v, MILLISECS(10));
         /* Stop the singleshot timer. */