diff mbox series

[v4,1/9] x86/shim: zap runstate and time area handles during shutdown

Message ID 91db0bae-5485-680c-ef95-7316328583a2@suse.com (mailing list archive)
State New, archived
Headers show
Series runstate/time area registration by (guest) physical address | expand

Commit Message

Jan Beulich Sept. 28, 2023, 7:01 a.m. UTC
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>
---
v4: New.

Comments

Roger Pau Monne Sept. 28, 2023, 9:27 a.m. UTC | #1
On Thu, Sep 28, 2023 at 09:01:53AM +0200, Jan Beulich wrote:
> 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>

Thanks, Roger.
diff mbox series

Patch

--- a/xen/arch/x86/pv/shim.c
+++ b/xen/arch/x86/pv/shim.c
@@ -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. */