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