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