mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-27 12:23:53 -06:00
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>
This commit is contained in:
parent
634d39b4e3
commit
25f0d2aa5e
1 changed files with 5 additions and 0 deletions
|
@ -151,6 +151,11 @@ static void vhost_user_cleanup(NetClientState *nc)
|
||||||
vhost_net_cleanup(s->vhost_net);
|
vhost_net_cleanup(s->vhost_net);
|
||||||
s->vhost_net = NULL;
|
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);
|
qemu_purge_queued_packets(nc);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue