All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Reset runstate_guest handles on soft reset
@ 2016-01-28  9:34 Vitaly Kuznetsov
  2016-01-28 12:45 ` Jan Beulich
  0 siblings, 1 reply; 2+ messages in thread
From: Vitaly Kuznetsov @ 2016-01-28  9:34 UTC (permalink / raw)
  To: xen-devel; +Cc: Keir Fraser, Ian Jackson, Ian Campbell, Jan Beulich, Tim Deegan

runstate_guest handles need to be reset to prevent update_runstate_area()
corrupting guest's memory after we resume the guest.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
---
 xen/common/domain.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index 2979c1b..6b2b7dc 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -1074,7 +1074,10 @@ int domain_soft_reset(struct domain *d)
     grant_table_warn_active_grants(d);
 
     for_each_vcpu ( d, v )
+    {
+        memset(&runstate_guest(v), 0, sizeof(runstate_guest(v)));
         unmap_vcpu_info(v);
+    }
 
     rc = arch_domain_soft_reset(d);
     if ( !rc )
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Reset runstate_guest handles on soft reset
  2016-01-28  9:34 [PATCH] Reset runstate_guest handles on soft reset Vitaly Kuznetsov
@ 2016-01-28 12:45 ` Jan Beulich
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Beulich @ 2016-01-28 12:45 UTC (permalink / raw)
  To: Vitaly Kuznetsov
  Cc: Keir Fraser, Tim Deegan, Ian Jackson, Ian Campbell, xen-devel

>>> On 28.01.16 at 10:34, <vkuznets@redhat.com> wrote:
> --- a/xen/common/domain.c
> +++ b/xen/common/domain.c
> @@ -1074,7 +1074,10 @@ int domain_soft_reset(struct domain *d)
>      grant_table_warn_active_grants(d);
>  
>      for_each_vcpu ( d, v )
> +    {
> +        memset(&runstate_guest(v), 0, sizeof(runstate_guest(v)));
>          unmap_vcpu_info(v);
> +    }

Well, the idea seems okay, but using memset() looks bogus: Why
can't you use guest_handle_from_pointer(NULL, ...) or
set_xen_guest_handle(..., NULL)?

Jan

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-01-28 12:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-28  9:34 [PATCH] Reset runstate_guest handles on soft reset Vitaly Kuznetsov
2016-01-28 12:45 ` Jan Beulich

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.