qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] net: cleanup before character devices
@ 2016-07-08 15:27 Paolo Bonzini
  2016-07-08 15:42 ` Marc-André Lureau
  2016-07-11  9:06 ` Jason Wang
  0 siblings, 2 replies; 9+ messages in thread
From: Paolo Bonzini @ 2016-07-08 15:27 UTC (permalink / raw)
  To: qemu-devel; +Cc: Jason Wang, Marc-André Lureau

Otherwise, vhost-user causes a use-after-free.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 vl.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/vl.c b/vl.c
index d0b9ff9..005162d 100644
--- a/vl.c
+++ b/vl.c
@@ -4327,9 +4327,6 @@ int main(int argc, char **argv, char **envp)
         qemu_opts_del(icount_opts);
     }
 
-    /* clean up network at qemu process termination */
-    atexit(&net_cleanup);
-
     if (default_net) {
         QemuOptsList *net = qemu_find_opts("net");
         qemu_opts_set(net, NULL, "type", "nic", &error_abort);
@@ -4596,6 +4593,9 @@ int main(int argc, char **argv, char **envp)
 #ifdef CONFIG_TPM
     tpm_cleanup();
 #endif
+
+    /* vhost-user must be cleaned up before chardevs.  */
+    net_cleanup();
     qemu_chr_cleanup();
 
     return 0;
-- 
1.8.3.1

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

end of thread, other threads:[~2016-07-11 13:02 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-08 15:27 [Qemu-devel] [PATCH] net: cleanup before character devices Paolo Bonzini
2016-07-08 15:42 ` Marc-André Lureau
2016-07-08 15:43   ` Paolo Bonzini
2016-07-11  9:06 ` Jason Wang
2016-07-11  9:18   ` Paolo Bonzini
2016-07-11 11:23     ` Jason Wang
2016-07-11 11:29       ` Paolo Bonzini
2016-07-11 12:51         ` Marc-André Lureau
2016-07-11 13:02           ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).