qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] vhost-user: disable chardev handlers on close
@ 2016-06-29 13:28 Paolo Bonzini
  2016-06-29 13:28 ` Paolo Bonzini
  0 siblings, 1 reply; 2+ messages in thread
From: Paolo Bonzini @ 2016-06-29 13:28 UTC (permalink / raw)
  To: qemu-devel; +Cc: Marc-André Lureau

This otherwise causes a use-after-free if network backend cleanup
is performed before character device cleanup.

Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
	I'm including this in the pull request too.

 net/vhost-user.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/net/vhost-user.c b/net/vhost-user.c
index 636899a..92f4cfd 100644
--- a/net/vhost-user.c
+++ b/net/vhost-user.c
@@ -151,6 +151,11 @@ static void vhost_user_cleanup(NetClientState *nc)
         vhost_net_cleanup(s->vhost_net);
         s->vhost_net = NULL;
     }
+    if (s->chr) {
+        qemu_chr_add_handlers(s->chr, NULL, NULL, NULL, NULL);
+        qemu_chr_fe_release(s->chr);
+        s->chr = NULL;
+    }
 
     qemu_purge_queued_packets(nc);
 }
-- 
1.8.3.1

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

end of thread, other threads:[~2016-06-29 13:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-29 13:28 [Qemu-devel] [PATCH] vhost-user: disable chardev handlers on close Paolo Bonzini
2016-06-29 13:28 ` 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).