summaryrefslogtreecommitdiff
path: root/net/vhost-user.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2016-06-29 15:15:33 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2016-06-29 16:49:40 +0200
commit25f0d2aa5e3d21caa1bc622b21368cc2e383f02c (patch)
tree69448740b06c79110725708b1ccdf2d777ab0b72 /net/vhost-user.c
parent634d39b4e3e5736b73c55b0fcc113e81246a7057 (diff)
downloadqemu-25f0d2aa5e3d21caa1bc622b21368cc2e383f02c.tar.gz
qemu-25f0d2aa5e3d21caa1bc622b21368cc2e383f02c.tar.bz2
qemu-25f0d2aa5e3d21caa1bc622b21368cc2e383f02c.zip
vhost-user: disable chardev handlers on close
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>
Diffstat (limited to 'net/vhost-user.c')
-rw-r--r--net/vhost-user.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/net/vhost-user.c b/net/vhost-user.c
index 636899a877..92f4cfd1b1 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);
}