All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86 vm_event: reset monitor in vm_event_cleanup_domain()
@ 2016-01-27 19:42 Razvan Cojocaru
  2016-01-27 19:45 ` Andrew Cooper
  2016-01-27 19:58 ` Tamas K Lengyel
  0 siblings, 2 replies; 3+ messages in thread
From: Razvan Cojocaru @ 2016-01-27 19:42 UTC (permalink / raw)
  To: xen-devel; +Cc: andrew.cooper3, tamas, keir, Razvan Cojocaru, jbeulich

It is currently possible to leave a monitor flag enabled even
after vm_event_cleanup_domain() has been called, potentially
leading to a crash in hvm_msr_write_intercept() and hvm_set_crX()
(when v->arch.vm_event has become NULL, but the corresponding
corresponding v->domain->arch.monitor flag is non-zero).
This patch zeroes out arch.monitor in vm_event_cleanup_domain().

Signed-off-by: Razvan Cojocaru <rcojocaru@bitdefender.com>
---
 xen/arch/x86/vm_event.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/arch/x86/vm_event.c b/xen/arch/x86/vm_event.c
index 9677ecc..08d678a 100644
--- a/xen/arch/x86/vm_event.c
+++ b/xen/arch/x86/vm_event.c
@@ -56,6 +56,7 @@ void vm_event_cleanup_domain(struct domain *d)
     }
 
     d->arch.mem_access_emulate_each_rep = 0;
+    memset(&d->arch.monitor, 0, sizeof(d->arch.monitor));
 }
 
 void vm_event_toggle_singlestep(struct domain *d, struct vcpu *v)
-- 
2.7.0

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

end of thread, other threads:[~2016-01-27 19:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-27 19:42 [PATCH] x86 vm_event: reset monitor in vm_event_cleanup_domain() Razvan Cojocaru
2016-01-27 19:45 ` Andrew Cooper
2016-01-27 19:58 ` Tamas K Lengyel

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.