x86: also zap secondary time area handles during soft reset

Just like domain_soft_reset() properly zaps runstate area handles, the
secondary time area ones also need discarding to prevent guest memory
corruption once the guest is re-started.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Release-acked-by: Henry Wang <Henry.Wang@arm.com>
This commit is contained in:
Jan Beulich committed 2022-10-27 11:49:09 +02:00
1 parent 2ca833688a
commit b80d4f8d2e
1 file changed
+6
+6
View File
@@ -951,6 +951,7 @@ int arch_domain_soft_reset(struct domain *d)
struct page_info *page = virt_to_page(d->shared_info), *new_page;
int ret = 0;
struct domain *owner;
struct vcpu *v;
mfn_t mfn;
gfn_t gfn;
p2m_type_t p2mt;
@@ -1030,7 +1031,12 @@ int arch_domain_soft_reset(struct domain *d)
"Failed to add a page to replace %pd's shared_info frame %"PRI_gfn"\n",
d, gfn_x(gfn));
free_domheap_page(new_page);
goto exit_put_gfn;
}
for_each_vcpu ( d, v )
set_xen_guest_handle(v->arch.time_info_guest, NULL);
exit_put_gfn:
put_gfn(d, gfn_x(gfn));
exit_put_page:
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.