* [Qemu-devel] [PATCHv2] vhost: fix double free on device stop
@ 2011-06-21 17:34 Michael S. Tsirkin
2011-06-21 17:49 ` Chris Wright
2011-06-22 3:04 ` Jason Wang
0 siblings, 2 replies; 3+ messages in thread
From: Michael S. Tsirkin @ 2011-06-21 17:34 UTC (permalink / raw)
To: qemu-devel, Jason Wang, armbru, chrisw
vhost dev stop failed to clear the log field.
Typically not an issue as dev start overwrites this field,
but if logging gets disabled before the following start,
it doesn't so this causes a double free.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
hw/vhost.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/hw/vhost.c b/hw/vhost.c
index 80f771e..c3d8821 100644
--- a/hw/vhost.c
+++ b/hw/vhost.c
@@ -784,5 +784,6 @@ void vhost_dev_stop(struct vhost_dev *hdev, VirtIODevice *vdev)
hdev->started = false;
qemu_free(hdev->log);
+ hdev->log = NULL;
hdev->log_size = 0;
}
--
1.7.5.53.gc233e
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCHv2] vhost: fix double free on device stop
2011-06-21 17:34 [Qemu-devel] [PATCHv2] vhost: fix double free on device stop Michael S. Tsirkin
@ 2011-06-21 17:49 ` Chris Wright
2011-06-22 3:04 ` Jason Wang
1 sibling, 0 replies; 3+ messages in thread
From: Chris Wright @ 2011-06-21 17:49 UTC (permalink / raw)
To: Michael S. Tsirkin; +Cc: chrisw, Jason Wang, qemu-devel, armbru
* Michael S. Tsirkin (mst@redhat.com) wrote:
> vhost dev stop failed to clear the log field.
> Typically not an issue as dev start overwrites this field,
> but if logging gets disabled before the following start,
> it doesn't so this causes a double free.
>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Chris Wright <chrisw@redhat.com>
thanks,
-chris
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCHv2] vhost: fix double free on device stop
2011-06-21 17:34 [Qemu-devel] [PATCHv2] vhost: fix double free on device stop Michael S. Tsirkin
2011-06-21 17:49 ` Chris Wright
@ 2011-06-22 3:04 ` Jason Wang
1 sibling, 0 replies; 3+ messages in thread
From: Jason Wang @ 2011-06-22 3:04 UTC (permalink / raw)
To: Michael S. Tsirkin; +Cc: chrisw, qemu-devel, armbru
On 06/22/2011 01:34 AM, Michael S. Tsirkin wrote:
> vhost dev stop failed to clear the log field.
> Typically not an issue as dev start overwrites this field,
> but if logging gets disabled before the following start,
> it doesn't so this causes a double free.
>
> Signed-off-by: Michael S. Tsirkin<mst@redhat.com>
> ---
Acked-by: Jason Wang <jasowang@redhat.com>
> hw/vhost.c | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/hw/vhost.c b/hw/vhost.c
> index 80f771e..c3d8821 100644
> --- a/hw/vhost.c
> +++ b/hw/vhost.c
> @@ -784,5 +784,6 @@ void vhost_dev_stop(struct vhost_dev *hdev, VirtIODevice *vdev)
>
> hdev->started = false;
> qemu_free(hdev->log);
> + hdev->log = NULL;
> hdev->log_size = 0;
> }
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-06-22 3:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-21 17:34 [Qemu-devel] [PATCHv2] vhost: fix double free on device stop Michael S. Tsirkin
2011-06-21 17:49 ` Chris Wright
2011-06-22 3:04 ` Jason Wang
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).