Skip to content
Snippets Groups Projects
  1. Oct 16, 2017
    • Daniel P. Berrangé's avatar
      io: pass a struct iovec into qio_channel_websock_encode · fb74e590
      Daniel P. Berrangé authored
      
      Instead of requiring use of another Buffer, pass a struct iovec
      into qio_channel_websock_encode, which gives callers more
      flexibility in how they process data.
      
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Signed-off-by: default avatarDaniel P. Berrange <berrange@redhat.com>
      fb74e590
    • Daniel P. Berrangé's avatar
      io: get rid of qio_channel_websock_encode helper method · bac6c954
      Daniel P. Berrangé authored
      
      The qio_channel_websock_encode method is only used in one place,
      everything else calls qio_channel_websock_encode_buffer directly.
      It can also be pushed up a level into the qio_channel_websock_writev
      method, since every other caller of qio_channel_websock_write_wire
      has already filled encoutput.
      
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Signed-off-by: default avatarDaniel P. Berrange <berrange@redhat.com>
      bac6c954
    • Daniel P. Berrangé's avatar
      io: simplify websocket ping reply handling · 57b0cdf1
      Daniel P. Berrangé authored
      
      We must ensure we don't get flooded with ping replies if the outbound
      channel is slow. Currently we do this by keeping the ping reply in a
      separate temporary buffer and only writing it if the encoutput buffer
      is completely empty. This is overly pessimistic, as it is reasonable
      to add a ping reply to the encoutput buffer even if it has previous
      data in it, as long as that previous data doesn't include a ping
      reply.
      
      To track this better, put the ping reply directly into the encoutput
      buffer, and then record the size of encoutput at this time in
      pong_remain. As we write encoutput to the underlying channel, we
      can decrement the pong_remain counter. Once it hits zero, we can
      accept further ping replies for transmission.
      
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Signed-off-by: default avatarDaniel P. Berrange <berrange@redhat.com>
      57b0cdf1
    • Daniel P. Berrangé's avatar
      io: monitor encoutput buffer size from websocket GSource · a7b20a8e
      Daniel P. Berrangé authored
      The websocket GSource is monitoring the size of the rawoutput
      buffer to determine if the channel can accepts more writes.
      The rawoutput buffer, however, is merely a temporary staging
      buffer before data is copied into the encoutput buffer. Thus
      its size will always be zero when the GSource runs.
      
      This flaw causes the encoutput buffer to grow without bound
      if the other end of the underlying data channel doesn't
      read data being sent. This can be seen with VNC if a client
      is on a slow WAN link and the guest OS is sending many screen
      updates. A malicious VNC client can act like it is on a slow
      link by playing a video in the guest and then reading data
      very slowly, causing QEMU host memory to expand arbitrarily.
      
      This issue is assigned CVE-2017-15268, publically reported in
      
        https://bugs.launchpad.net/qemu/+bug/1718964
      
      
      
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Signed-off-by: default avatarDaniel P. Berrange <berrange@redhat.com>
      a7b20a8e
    • Knut Omang's avatar
      sockets: Handle race condition between binds to the same port · 9cf961bb
      Knut Omang authored
      
      If an offset of ports is specified to the inet_listen_saddr function(),
      and two or more processes tries to bind from these ports at the same time,
      occasionally more than one process may be able to bind to the same
      port. The condition is detected by listen() but too late to avoid a failure.
      
      This function is called by socket_listen() and used
      by all socket listening code in QEMU, so all cases where any form of dynamic
      port selection is used should be subject to this issue.
      
      Add code to close and re-establish the socket when this
      condition is observed, hiding the race condition from the user.
      
      Also clean up some issues with error handling to allow more
      accurate reporting of the cause of an error.
      
      This has been developed and tested by means of the
      test-listen unit test in the previous commit.
      Enable the test for make check now that it passes.
      
      Reviewed-by: default avatarBhavesh Davda <bhavesh.davda@oracle.com>
      Reviewed-by: default avatarYuval Shaia <yuval.shaia@oracle.com>
      Reviewed-by: default avatarGirish Moodalbail <girish.moodalbail@oracle.com>
      Signed-off-by: default avatarKnut Omang <knut.omang@oracle.com>
      Reviewed-by: default avatarDaniel P. Berrange <berrange@redhat.com>
      Signed-off-by: default avatarDaniel P. Berrange <berrange@redhat.com>
      9cf961bb
    • Knut Omang's avatar
      sockets: factor out create_fast_reuse_socket · 39f80521
      Knut Omang authored
      
      Another refactoring step to prepare for fixing the problem
      exposed with the test-listen test in the previous commit
      
      Signed-off-by: default avatarKnut Omang <knut.omang@oracle.com>
      Reviewed-by: default avatarDaniel P. Berrange <berrange@redhat.com>
      Signed-off-by: default avatarDaniel P. Berrange <berrange@redhat.com>
      39f80521
    • Knut Omang's avatar
      sockets: factor out a new try_bind() function · 89382c3d
      Knut Omang authored
      
      A refactoring step to prepare for the problem
      exposed by the test-listen test in the previous commit.
      
      Simplify and reorganize the IPv6 specific extra
      measures and move it out of the for loop to increase
      code readability. No semantic changes.
      
      Signed-off-by: default avatarKnut Omang <knut.omang@oracle.com>
      Reviewed-by: default avatarDaniel P. Berrange <berrange@redhat.com>
      Signed-off-by: default avatarDaniel P. Berrange <berrange@redhat.com>
      89382c3d
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/ericb/tags/pull-nbd-2017-10-14' into staging · 79b2a13a
      Peter Maydell authored
      
      nbd patches for 2017-10-14
      
      - Marc-André Lureau - NBD: use g_new() family of functions
      - Vladimir Sementsov-Ogievskiy - first half of 00/13 nbd minimal structured read
      
      # gpg: Signature made Sun 15 Oct 2017 01:38:47 BST
      # gpg:                using RSA key 0xA7A16B4A2527436A
      # gpg: Good signature from "Eric Blake <eblake@redhat.com>"
      # gpg:                 aka "Eric Blake (Free Software Programmer) <ebb9@byu.net>"
      # gpg:                 aka "[jpeg image of size 6874]"
      # Primary key fingerprint: 71C2 CC22 B1C4 6029 27D2  F3AA A7A1 6B4A 2527 436A
      
      * remotes/ericb/tags/pull-nbd-2017-10-14:
        nbd: header constants indenting
        nbd/server: simplify reply transmission
        nbd/server: refactor nbd_co_send_simple_reply parameters
        nbd/server: do not use NBDReply structure
        nbd/server: structurize simple reply header sending
        nbd: rename some simple-request related objects to be _simple_
        block/nbd-client: refactor nbd_co_receive_reply
        block/nbd-client: assert qiov len once in nbd_co_request
        NBD: use g_new() family of functions
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      79b2a13a
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging · 48ae1f60
      Peter Maydell authored
      
      # gpg: Signature made Fri 13 Oct 2017 14:49:22 BST
      # gpg:                using RSA key 0x9CA4ABB381AB73C8
      # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>"
      # gpg:                 aka "Stefan Hajnoczi <stefanha@gmail.com>"
      # Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35  775A 9CA4 ABB3 81AB 73C8
      
      * remotes/stefanha/tags/block-pull-request:
        block/throttle.c: add bdrv_co_drain_begin/end callbacks
        block: rename bdrv_co_drain to bdrv_co_drain_begin
        block: add bdrv_co_drain_end callback
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      48ae1f60
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/stefanberger/tags/pull-tpm-2017-10-04-3' into staging · 78b62d37
      Peter Maydell authored
      
      Merge tpm 2017/10/04 v3
      
      # gpg: Signature made Fri 13 Oct 2017 12:37:07 BST
      # gpg:                using RSA key 0x75AD65802A0B4211
      # gpg: Good signature from "Stefan Berger <stefanb@linux.vnet.ibm.com>"
      # gpg: WARNING: This key is not certified with a trusted signature!
      # gpg:          There is no indication that the signature belongs to the owner.
      # Primary key fingerprint: B818 B9CA DF90 89C2 D5CE  C66B 75AD 6580 2A0B 4211
      
      * remotes/stefanberger/tags/pull-tpm-2017-10-04-3:
        specs: Describe the TPM support in QEMU
        tpm: Move tpm_cleanup() to right place
        tpm: Added support for TPM emulator
        tpm-passthrough: move reusable code to utils
        tpm-backend: Move realloc_buffer() implementation to tpm-tis model
        tpm-backend: Add new API to read backend TpmInfo
        tpm-backend: Made few interface methods optional
        tpm-backend: Initialize and free data members in it's own methods
        tpm-backend: Move thread handling inside TPMBackend
        tpm-backend: Remove unneeded member variable from backend class
        tpm: Use EMSGSIZE instead of EBADMSG to compile on OpenBSD
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      78b62d37
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/elmarco/tags/vu-pull-request' into staging · 40a1e8ac
      Peter Maydell authored
      
      # gpg: Signature made Thu 12 Oct 2017 21:52:28 BST
      # gpg:                using RSA key 0xDAE8E10975969CE5
      # gpg: Good signature from "Marc-André Lureau <marcandre.lureau@redhat.com>"
      # gpg:                 aka "Marc-André Lureau <marcandre.lureau@gmail.com>"
      # gpg: WARNING: This key is not certified with sufficiently trusted signatures!
      # gpg:          It is not certain that the signature belongs to the owner.
      # Primary key fingerprint: 87A9 BD93 3F87 C606 D276  F62D DAE8 E109 7596 9CE5
      
      * remotes/elmarco/tags/vu-pull-request:
        libvhost-user: Support VHOST_USER_SET_SLAVE_REQ_FD
        libvhost-user: Update and fix feature and request lists
        vhost-user-bridge: Only process received packets on started queues
        libvhost-user: vu_queue_started
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      40a1e8ac
  2. Oct 13, 2017
  3. Oct 12, 2017
Loading