[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 1/9] x86/shim: zap runstate and time area handles during shutdown
- To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Thu, 28 Sep 2023 09:01:53 +0200
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=oufazdANeZ9w0vDBuU2Z3ztqUcCD/UC60JbgAsH595s=; b=fnQEwAcdIkG/EshODfg5GrHITaUesvJiyX7YeVFq2mRziu/3KfZ3d4TCMbydFqbiYN9m8DSfHqFwqtnIjYH+wH6PAUyuBHCWY7eKXi0aMiKHxDMPRoylW5CLOzs0/mZFXQAhiFvVkTMYz5PesJhPJKOgu2vZUVKK1JqNjJfmhJnvG2WNpi72vbaRvzm4RgwnaZs+OZObQfV18icoXo5AgQur2GgVAO7wZ8DA0S1IU1eY2+RxwGiF8rMpRpAQb0Ljg9FBEmqNTaJaQ+x92tLCozPOpggr4YSh+Z6zU/icFUk2ES3CwmZRTrml0xLA9ADUf/XvD8f4g3s41VBxfR6A7g==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=F8OP2uujbZjt2hEsXLa1W7apm8GJO4oJtqTVfK+aZycEEMZ8CkGKN8lYfbds6ONfng1eyRbsNPt+bCEU3M5Bf5k5eb8B5MqEbx+ifr9JGuRKiXupWZiY+dO157MkRYMsNws9jzIpspO+Sz99mVPoKyBkUgn+L6cB0uO4HSVZgsrl5NMDV6rJJY5rHBRbb1xJ1Dk/A8kU5QsHCF2OHY597PuIAmnReNfir7qeLBllbtSvMcDWz7RTzrQP1GT9qpKySqzjXcR0cTxgrdJH+0YwI+Wmu0Vsr8B5U4IMQT0j2JcT5CGanumJ/8p/HgpiBvt0AjZJiQL6yarUTWITTMdyoQ==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
- Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Henry Wang <Henry.Wang@xxxxxxx>
- Delivery-date: Thu, 28 Sep 2023 07:02:04 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
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@xxxxxxxx>
---
v4: New.
--- 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. */
|