dcavalca / rpms / qemu

Forked from rpms/qemu 11 months ago
Clone

Blame 0002-audio-release-capture-buffers.patch

335584
From: Gerd Hoffmann <kraxel@redhat.com>
335584
Date: Fri, 28 Apr 2017 09:56:12 +0200
335584
Subject: [PATCH] audio: release capture buffers
335584
335584
AUD_add_capture() allocates two buffers which are never released.
335584
Add the missing calls to AUD_del_capture().
335584
335584
Impact: Allows vnc clients to exhaust host memory by repeatedly
335584
starting and stopping audio capture.
335584
335584
Fixes: CVE-2017-8309
335584
Cc: P J P <ppandit@redhat.com>
335584
Cc: Huawei PSIRT <PSIRT@huawei.com>
335584
Reported-by: "Jiangxin (hunter, SCC)" <jiangxin1@huawei.com>
335584
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
335584
Reviewed-by: Prasad J Pandit <pjp@fedoraproject.org>
335584
Message-id: 20170428075612.9997-1-kraxel@redhat.com
335584
(cherry picked from commit 3268a845f41253fb55852a8429c32b50f36f349a)
335584
---
335584
 audio/audio.c | 2 ++
335584
 1 file changed, 2 insertions(+)
335584
335584
diff --git a/audio/audio.c b/audio/audio.c
335584
index c8898d8422..beafed209b 100644
335584
--- a/audio/audio.c
335584
+++ b/audio/audio.c
335584
@@ -2028,6 +2028,8 @@ void AUD_del_capture (CaptureVoiceOut *cap, void *cb_opaque)
335584
                     sw = sw1;
335584
                 }
335584
                 QLIST_REMOVE (cap, entries);
335584
+                g_free (cap->hw.mix_buf);
335584
+                g_free (cap->buf);
335584
                 g_free (cap);
335584
             }
335584
             return;