From: Peter Maydell <peter.maydell@linaro.org>
To: "Daniel P. Berrange" <berrange@redhat.com>
Cc: QEMU Developers <qemu-devel@nongnu.org>,
Gerd Hoffmann <kraxel@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 1/2] CVE-2015-1779: incrementally decode websocket frames
Date: Tue, 31 Mar 2015 19:01:37 +0100 [thread overview]
Message-ID: <CAFEAcA_ad6-yj4oDi1oAL1tmV7e8HEPjAEe0n_Wa-v8FfWWPXw@mail.gmail.com> (raw)
In-Reply-To: <1427151502-14386-2-git-send-email-berrange@redhat.com>
On 23 March 2015 at 22:58, Daniel P. Berrange <berrange@redhat.com> wrote:
> - if (*payload_size < 126) {
> - header_size = 6;
> - mask = header->u.m;
> - } else if (*payload_size == 126 && input->offset >= 8) {
> - *payload_size = be16_to_cpu(header->u.s16.l16);
> - header_size = 8;
> - mask = header->u.s16.m16;
> - } else if (*payload_size == 127 && input->offset >= 14) {
> - *payload_size = be64_to_cpu(header->u.s64.l64);
> - header_size = 14;
> - mask = header->u.s64.m64;
> + if (payload_len < 126) {
> + *payload_remain = payload_len;
> + *header_size = 6;
> + *payload_mask = header->u.m;
> + } else if (payload_len == 126 && input->offset >= 8) {
> + *payload_remain = be16_to_cpu(header->u.s16.l16);
> + *header_size = 8;
> + *payload_mask = header->u.s16.m16;
> + } else if (payload_len == 127 && input->offset >= 14) {
> + *payload_remain = be64_to_cpu(header->u.s64.l64);
> + *header_size = 14;
> + *payload_mask = header->u.s64.m64;
We were already doing this before, but if this is a 32 bit
machine then the assignment to *payload_remain in this
case is going to be assigning a 64-bit value from the datastream
to a 32-bit size_t, which doesn't seem like a great idea
to just silently do, though I suppose the datastream is in
complete control of that value anyway.
-- PMM
next prev parent reply other threads:[~2015-03-31 18:02 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-23 22:58 [Qemu-devel] [PATCH 0/2] CVE-2015-1779: fix denial of service in VNC websockets Daniel P. Berrange
2015-03-23 22:58 ` [Qemu-devel] [PATCH 1/2] CVE-2015-1779: incrementally decode websocket frames Daniel P. Berrange
2015-03-31 17:42 ` Peter Maydell
2015-04-01 13:36 ` Gerd Hoffmann
2015-04-01 13:41 ` Peter Maydell
2015-04-09 14:12 ` Daniel P. Berrange
2015-03-31 18:01 ` Peter Maydell [this message]
2015-03-23 22:58 ` [Qemu-devel] [PATCH 2/2] CVE-2015-1779: limit size of HTTP headers from websockets clients Daniel P. Berrange
2015-03-24 15:51 ` [Qemu-devel] [PATCH 0/2] CVE-2015-1779: fix denial of service in VNC websockets Gerd Hoffmann
2015-03-31 9:17 ` Peter Maydell
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=CAFEAcA_ad6-yj4oDi1oAL1tmV7e8HEPjAEe0n_Wa-v8FfWWPXw@mail.gmail.com \
--to=peter.maydell@linaro.org \
--cc=berrange@redhat.com \
--cc=kraxel@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).