[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 11/14] net: do not use atexit for cleanup
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 11/14] net: do not use atexit for cleanup |
Date: |
Wed, 13 Jul 2016 15:26:29 +0200 |
This will be necessary in the next patch, which stops using atexit for
character devices; without it, vhost-user and the redirector filter
will cause a use-after-free. Relying on the ordering of atexit calls
is also brittle, even now that both the network and chardev
subsystems are using atexit.
Signed-off-by: Paolo Bonzini <address@hidden>
---
vl.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/vl.c b/vl.c
index 356713e..cad4da2 100644
--- a/vl.c
+++ b/vl.c
@@ -4345,9 +4345,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);
@@ -4611,5 +4608,7 @@ int main(int argc, char **argv, char **envp)
tpm_cleanup();
#endif
+ net_cleanup();
+
return 0;
}
--
1.8.3.1
- [Qemu-devel] [PULL 04/14] main-loop: check return value before using pointer, (continued)
- [Qemu-devel] [PULL 04/14] main-loop: check return value before using pointer, Paolo Bonzini, 2016/07/13
- [Qemu-devel] [PULL 03/14] Use "-s" instead of "--quiet" to resolve non-fatal build error on FreeBSD., Paolo Bonzini, 2016/07/13
- [Qemu-devel] [PULL 05/14] json-streamer: fix double-free on exiting during a parse, Paolo Bonzini, 2016/07/13
- [Qemu-devel] [PULL 06/14] disas: avoid including everything in headers compiled from C++, Paolo Bonzini, 2016/07/13
- [Qemu-devel] [PULL 08/14] util: Fix MIN_NON_ZERO, Paolo Bonzini, 2016/07/13
- [Qemu-devel] [PULL 01/14] scsi-bus: Add SCSI scanner support, Paolo Bonzini, 2016/07/13
- [Qemu-devel] [PULL 02/14] scsi-bus: Use longer sense buffer with scanners, Paolo Bonzini, 2016/07/13
- [Qemu-devel] [PULL 09/14] tap: use an exit notifier to call down_script, Paolo Bonzini, 2016/07/13
- [Qemu-devel] [PULL 07/14] qemu-sockets: use qapi_free_SocketAddress in cleanup, Paolo Bonzini, 2016/07/13
- [Qemu-devel] [PULL 10/14] slirp: use exit notifier for slirp_smb_cleanup, Paolo Bonzini, 2016/07/13
- [Qemu-devel] [PULL 11/14] net: do not use atexit for cleanup,
Paolo Bonzini <=
- [Qemu-devel] [PULL 13/14] hostmem: fix QEMU crash by 'info memdev', Paolo Bonzini, 2016/07/13
- [Qemu-devel] [PULL 12/14] char: do not use atexit cleanup handler, Paolo Bonzini, 2016/07/13
- [Qemu-devel] [PULL 14/14] hostmem: detect host backend memory is being used properly, Paolo Bonzini, 2016/07/13
- Re: [Qemu-devel] [PULL 00/14] SCSI, chardev, build fixes for 2016-07-13, Peter Maydell, 2016/07/14