From: "Daniel P. Berrange" <berrange@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH v2 0/7] Limit websockets memory usage & other bug fixes
Date: Wed, 11 Oct 2017 11:09:52 +0100 [thread overview]
Message-ID: <20171011100959.29326-1-berrange@redhat.com> (raw)
The core motivation for this patch series is to fix a security
issue publically reported, where websockets code can consume
arbitrary amounts of RAM with slow clients:
https://bugs.launchpad.net/qemu/+bug/1718964
I've asked for a CVE but its not assigned yet. Since the bug
is public we might as well get on with code review while waiting
for the CVE number.
The first patch is the minimum required to fix the actual CVE
in git master, taking advantage of how we know the VNC server
will call us. The 5th patch lets us tighten up buffer limiting
of writes further, so we're not making assumptions about VNC
server code.
The websockets code is broken right back to the day it was
merged in QEMU 1.2.1
The fix in patch 1 can apply to stable branches from 2.6 -> 2.10
inclusive, provided another fix from master is cherry-picked
first
commit eefa3d8ef649f9055611361e2201cca49f8c3433
Author: Brandon Carpenter <brandon.carpenter@cypherpath.com>
Date: Tue Sep 12 08:21:48 2017 -0700
io: Small updates in preparation for websocket changes
since that refactors code duplication in the GSource impl.
Once we merge for master, I'll send a patch to qemu-stable.
Versions prior to 2.6 would require a fix to be done in
the ui/vnc.c file vnc_update_client method instead. It
would need to check vs->ws_output buffer size. I'm not
intending to write any such patch - this is just info in
case anyone is stuck on such ancient versions and needs
to figure out a fix.
Changed in v2:
- Correctly index the struct iovec array when encoding (Eric)
- Change ping_remain to pong_remain (Eric)
- Misc typos (Eric)
Daniel P. Berrange (7):
io: monitor encoutput buffer size from websocket GSource
io: simplify websocket ping reply handling
io: get rid of qio_channel_websock_encode helper method
io: pass a struct iovec into qio_channel_websock_encode
io: get rid of bounce buffering in websock write path
io: cope with websock 'Connection' header having multiple values
io: add trace points for websocket HTTP protocol headers
include/io/channel-websock.h | 3 +-
io/channel-websock.c | 163 ++++++++++++++++++++++++-------------------
io/trace-events | 2 +
3 files changed, 93 insertions(+), 75 deletions(-)
--
2.13.5
next reply other threads:[~2017-10-11 10:10 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-11 10:09 Daniel P. Berrange [this message]
2017-10-11 10:09 ` [Qemu-devel] [PATCH v2 1/7] io: monitor encoutput buffer size from websocket GSource Daniel P. Berrange
2017-10-11 10:09 ` [Qemu-devel] [PATCH v2 2/7] io: simplify websocket ping reply handling Daniel P. Berrange
2017-10-11 10:09 ` [Qemu-devel] [PATCH v2 3/7] io: get rid of qio_channel_websock_encode helper method Daniel P. Berrange
2017-10-11 10:09 ` [Qemu-devel] [PATCH v2 4/7] io: pass a struct iovec into qio_channel_websock_encode Daniel P. Berrange
2017-10-11 12:28 ` Eric Blake
2017-10-11 12:30 ` Eric Blake
2017-10-11 12:31 ` Daniel P. Berrange
2017-10-11 10:09 ` [Qemu-devel] [PATCH v2 5/7] io: get rid of bounce buffering in websock write path Daniel P. Berrange
2017-10-11 12:58 ` Eric Blake
2017-10-11 10:09 ` [Qemu-devel] [PATCH v2 6/7] io: cope with websock 'Connection' header having multiple values Daniel P. Berrange
2017-10-11 10:09 ` [Qemu-devel] [PATCH v2 7/7] io: add trace points for websocket HTTP protocol headers Daniel P. Berrange
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171011100959.29326-1-berrange@redhat.com \
--to=berrange@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).