qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] cd892a: io: fix decoding when multiple websoc


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] cd892a: io: fix decoding when multiple websockets frames a...
Date: Fri, 03 Mar 2017 06:15:10 -0800

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: cd892a2efc47bf45d058578fb557ba6db235a3a8
      
https://github.com/qemu/qemu/commit/cd892a2efc47bf45d058578fb557ba6db235a3a8
  Author: Daniel P. Berrange <address@hidden>
  Date:   2017-02-28 (Tue, 28 Feb 2017)

  Changed paths:
    M io/channel-websock.c

  Log Message:
  -----------
  io: fix decoding when multiple websockets frames arrive at once

The qio_channel_websock_read_wire() method will read upto 4096
bytes off the socket and then decode the websockets header and
payload. The code was only decoding a single websockets frame,
even if the buffered data contained multiple frames. This meant
that decoding of subsequent frames was delayed until further
input arrived on the socket. This backlog of delayed frames
gets worse & worse over time.

Symptom was that when connecting to the VNC server via the
built-in websockets server, mouse/keyboard interaction would
start out fine, but slowly get more & more delayed until it
was unusable.

Signed-off-by: Daniel P. Berrange <address@hidden>


  Commit: e3d90312b3748431ca7c1ecb10cd4614f32f0ae3
      
https://github.com/qemu/qemu/commit/e3d90312b3748431ca7c1ecb10cd4614f32f0ae3
  Author: Marc-André Lureau <address@hidden>
  Date:   2017-02-28 (Tue, 28 Feb 2017)

  Changed paths:
    M tests/test-io-channel-command.c

  Log Message:
  -----------
  tests: fix leaks in test-io-channel-command

No need for strdup, fix leaks when socat is missing.

Spotted by ASAN.

Signed-off-by: Marc-André Lureau <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>


  Commit: 07e95cd529af345fdeea230913f68eff5b925bb6
      
https://github.com/qemu/qemu/commit/07e95cd529af345fdeea230913f68eff5b925bb6
  Author: Daniel P. Berrange <address@hidden>
  Date:   2017-02-28 (Tue, 28 Feb 2017)

  Changed paths:
    M io/channel-websock.c

  Log Message:
  -----------
  io: fully parse & validate HTTP headers for websocket protocol handshake

The current websockets protocol handshake code is very relaxed, just
doing crude string searching across the HTTP header data. This causes
it to both reject valid connections and fail to reject invalid
connections. For example, according to the RFC 6455 it:

 - MUST reject any method other than "GET"
 - MUST reject any HTTP version less than "HTTP/1.1"
 - MUST reject Connection header without "Upgrade" listed
 - MUST reject Upgrade header which is not 'websocket'
 - MUST reject missing Host header
 - MUST treat HTTP header names as case insensitive

To do all this validation correctly requires that we fully parse the
HTTP headers, populating a data structure containing the header
fields.

After this change, we also reject any path other than '/'

Signed-off-by: Daniel P. Berrange <address@hidden>


  Commit: 1ec2dca691470d15d222a969891e467909739279
      
https://github.com/qemu/qemu/commit/1ec2dca691470d15d222a969891e467909739279
  Author: Peter Maydell <address@hidden>
  Date:   2017-03-03 (Fri, 03 Mar 2017)

  Changed paths:
    M io/channel-websock.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/berrange/tags/pull-qio-2017-02-27-2' 
into staging

Merge qio 2017/02/27 v2

# gpg: Signature made Thu 02 Mar 2017 16:09:27 GMT
# gpg:                using RSA key 0xBE86EBB415104FDF
# gpg: Good signature from "Daniel P. Berrange <address@hidden>"
# gpg:                 aka "Daniel P. Berrange <address@hidden>"
# Primary key fingerprint: DAF3 A6FD B26B 6291 2D0E  8E3F BE86 EBB4 1510 4FDF

* remotes/berrange/tags/pull-qio-2017-02-27-2:
  io: fully parse & validate HTTP headers for websocket protocol handshake
  tests: fix leaks in test-io-channel-command
  io: fix decoding when multiple websockets frames arrive at once

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/508e038a5d72...1ec2dca69147

reply via email to

[Prev in Thread] Current Thread [Next in Thread]