[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH RFC 03/14] qemu-char: avoid potential double-free
From: |
marcandre . lureau |
Subject: |
[Qemu-devel] [PATCH RFC 03/14] qemu-char: avoid potential double-free |
Date: |
Wed, 9 Sep 2015 01:09:55 +0200 |
From: Marc-André Lureau <address@hidden>
If tcp_set_msgfds() is called several time with NULL fds, this
could lead to double-free.
Signed-off-by: Marc-André Lureau <address@hidden>
---
qemu-char.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/qemu-char.c b/qemu-char.c
index d956f8d..bc37628 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -2713,6 +2713,7 @@ static int tcp_set_msgfds(CharDriverState *chr, int *fds,
int num)
/* clear old pending fd array */
if (s->write_msgfds) {
g_free(s->write_msgfds);
+ s->write_msgfds = NULL;
}
if (num) {
--
2.4.3
- [Qemu-devel] [PATCH RFC 00/14] vhost-user: shutdown and reconnection, marcandre . lureau, 2015/09/08
- [Qemu-devel] [PATCH RFC 02/14] vhost-user: remove useless is_server field, marcandre . lureau, 2015/09/08
- [Qemu-devel] [PATCH RFC 01/14] vhost-user: Add ability to know vhost-user backend disconnection, marcandre . lureau, 2015/09/08
- [Qemu-devel] [PATCH RFC 03/14] qemu-char: avoid potential double-free,
marcandre . lureau <=
- [Qemu-devel] [PATCH RFC 04/14] qemu-char: remove all msgfds on disconnect, marcandre . lureau, 2015/09/08
- [Qemu-devel] [PATCH RFC 05/14] qemu-char: make tcp_chr_disconnect() reentrant-safe, marcandre . lureau, 2015/09/08
- [Qemu-devel] [PATCH RFC 07/14] virtio-net: enable tx notification if up and vhost started, marcandre . lureau, 2015/09/08
- [Qemu-devel] [PATCH RFC 06/14] vhost-net: keep VIRTIO_NET_F_STATUS for vhost-user, marcandre . lureau, 2015/09/08
- [Qemu-devel] [PATCH RFC 08/14] vhost: add vhost_dev stop callback, marcandre . lureau, 2015/09/08
- [Qemu-devel] [PATCH RFC 09/14] vhost-user: add vhost_user to hold the chr, marcandre . lureau, 2015/09/08
- [Qemu-devel] [PATCH RFC 10/14] qemu-char: add qemu_chr_free(), marcandre . lureau, 2015/09/08
- [Qemu-devel] [PATCH RFC 12/14] vhost-user: add shutdown support, marcandre . lureau, 2015/09/08
- [Qemu-devel] [PATCH RFC 11/14] vhost-user: add slave-fd support, marcandre . lureau, 2015/09/08
- [Qemu-devel] [PATCH RFC 13/14] qemu-char: Add qemu_chr_disconnect to close a fd accepted by listen fd, marcandre . lureau, 2015/09/08