public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* KVM: fix cleanup_srcu_struct use-after-free
@ 2010-01-16  2:00 Marcelo Tosatti
  2010-01-17 12:28 ` Avi Kivity
  2010-01-19 13:50 ` Jan Kiszka
  0 siblings, 2 replies; 4+ messages in thread
From: Marcelo Tosatti @ 2010-01-16  2:00 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm


kvm_destroy_vm should free "struct kvm" after cleanup_srcu_struct.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>

diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index e0a591d..c828a39 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -509,8 +509,8 @@ static void kvm_destroy_vm(struct kvm *kvm)
 #else
 	kvm_arch_flush_shadow(kvm);
 #endif
-	kvm_arch_destroy_vm(kvm);
 	cleanup_srcu_struct(&kvm->srcu);
+	kvm_arch_destroy_vm(kvm);
 	hardware_disable_all();
 	mmdrop(mm);
 }

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

end of thread, other threads:[~2010-01-19 14:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-16  2:00 KVM: fix cleanup_srcu_struct use-after-free Marcelo Tosatti
2010-01-17 12:28 ` Avi Kivity
2010-01-19 13:50 ` Jan Kiszka
2010-01-19 14:45   ` KVM: fix cleanup_srcu_struct on vm destruction Marcelo Tosatti

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox