]> git.proxmox.com Git - pve-qemu.git/blame - debian/patches/extra/0021-io-monitor-encoutput-buffer-size-from-websocket-GSou.patch
bump version to 2.9.1-9
[pve-qemu.git] / debian / patches / extra / 0021-io-monitor-encoutput-buffer-size-from-websocket-GSou.patch
CommitLineData
3dcc8d3b 1From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
c53dfb57
WB
2From: "Daniel P. Berrange" <berrange@redhat.com>
3Date: Mon, 9 Oct 2017 14:43:42 +0100
3dcc8d3b 4Subject: [PATCH] io: monitor encoutput buffer size from websocket GSource
c53dfb57
WB
5
6The websocket GSource is monitoring the size of the rawoutput
7buffer to determine if the channel can accepts more writes.
8The rawoutput buffer, however, is merely a temporary staging
9buffer before data is copied into the encoutput buffer. Thus
10its size will always be zero when the GSource runs.
11
12This flaw causes the encoutput buffer to grow without bound
13if the other end of the underlying data channel doesn't
14read data being sent. This can be seen with VNC if a client
15is on a slow WAN link and the guest OS is sending many screen
16updates. A malicious VNC client can act like it is on a slow
17link by playing a video in the guest and then reading data
18very slowly, causing QEMU host memory to expand arbitrarily.
19
20This issue is assigned CVE-2017-15268, publically reported in
21
22 https://bugs.launchpad.net/qemu/+bug/1718964
23
24Reviewed-by: Eric Blake <eblake@redhat.com>
25Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
26---
27 io/channel-websock.c | 4 ++--
28 1 file changed, 2 insertions(+), 2 deletions(-)
29
30diff --git a/io/channel-websock.c b/io/channel-websock.c
31index 8fabadea2f..882bbb4cbc 100644
32--- a/io/channel-websock.c
33+++ b/io/channel-websock.c
34@@ -26,7 +26,7 @@
35 #include "trace.h"
36
37
38-/* Max amount to allow in rawinput/rawoutput buffers */
39+/* Max amount to allow in rawinput/encoutput buffers */
40 #define QIO_CHANNEL_WEBSOCK_MAX_BUFFER 8192
41
42 #define QIO_CHANNEL_WEBSOCK_CLIENT_KEY_LEN 24
43@@ -1006,7 +1006,7 @@ qio_channel_websock_source_prepare(GSource *source,
44 if (wsource->wioc->rawinput.offset) {
45 cond |= G_IO_IN;
46 }
47- if (wsource->wioc->rawoutput.offset < QIO_CHANNEL_WEBSOCK_MAX_BUFFER) {
48+ if (wsource->wioc->encoutput.offset < QIO_CHANNEL_WEBSOCK_MAX_BUFFER) {
49 cond |= G_IO_OUT;
50 }
51
52--
532.11.0
54