1. 10 9月, 2016 11 次提交
  2. 24 8月, 2016 2 次提交
  3. 15 8月, 2016 1 次提交
  4. 12 8月, 2016 1 次提交
  5. 10 8月, 2016 2 次提交
    • P
      vhost-user: Attempt to fix a race with set_mem_table. · 28ed5ef1
      Prerna Saxena 提交于
      The set_mem_table command currently does not seek a reply. Hence, there is
      no easy way for a remote application to notify to QEMU when it finished
      setting up memory, or if there were errors doing so.
      
      As an example:
      (1) Qemu sends a SET_MEM_TABLE to the backend (eg, a vhost-user net
      application). SET_MEM_TABLE does not require a reply according to the spec.
      (2) Qemu commits the memory to the guest.
      (3) Guest issues an I/O operation over a new memory region which was configured on (1).
      (4) The application has not yet remapped the memory, but it sees the I/O request.
      (5) The application cannot satisfy the request because it does not know about those GPAs.
      
      While a guaranteed fix would require a protocol extension (committed separately),
      a best-effort workaround for existing applications is to send a GET_FEATURES
      message before completing the vhost_user_set_mem_table() call.
      Since GET_FEATURES requires a reply, an application that processes vhost-user
      messages synchronously would probably have completed the SET_MEM_TABLE before replying.
      Signed-off-by: NPrerna Saxena <prerna.saxena@nutanix.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      28ed5ef1
    • P
      vhost-user: Introduce a new protocol feature REPLY_ACK. · ca525ce5
      Prerna Saxena 提交于
      This introduces the VHOST_USER_PROTOCOL_F_REPLY_ACK.
      
      If negotiated, client applications should send a u64 payload in
      response to any message that contains the "need_reply" bit set
      on the message flags. Setting the payload to "zero" indicates the
      command finished successfully. Likewise, setting it to "non-zero"
      indicates an error.
      
      Currently implemented only for SET_MEM_TABLE.
      Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      Signed-off-by: NPrerna Saxena <prerna.saxena@nutanix.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      ca525ce5
  6. 29 7月, 2016 18 次提交
  7. 27 7月, 2016 1 次提交
    • S
      virtio: error out if guest exceeds virtqueue size · afd9096e
      Stefan Hajnoczi 提交于
      A broken or malicious guest can submit more requests than the virtqueue
      size permits, causing unbounded memory allocation in QEMU.
      
      The guest can submit requests without bothering to wait for completion
      and is therefore not bound by virtqueue size.  This requires reusing
      vring descriptors in more than one request, which is not allowed by the
      VIRTIO 1.0 specification.
      
      In "3.2.1 Supplying Buffers to The Device", the VIRTIO 1.0 specification
      says:
      
        1. The driver places the buffer into free descriptor(s) in the
           descriptor table, chaining as necessary
      
      and
      
        Note that the above code does not take precautions against the
        available ring buffer wrapping around: this is not possible since the
        ring buffer is the same size as the descriptor table, so step (1) will
        prevent such a condition.
      
      This implies that placing more buffers into the virtqueue than the
      descriptor table size is not allowed.
      
      QEMU is missing the check to prevent this case.  Processing a request
      allocates a VirtQueueElement leading to unbounded memory allocation
      controlled by the guest.
      
      Exit with an error if the guest provides more requests than the
      virtqueue size permits.  This bounds memory allocation and makes the
      buggy guest visible to the user.
      
      This patch fixes CVE-2016-5403 and was reported by Zhenhao Hong from 360
      Marvel Team, China.
      Reported-by: NZhenhao Hong <hongzhenhao@360.cn>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      afd9096e
  8. 22 7月, 2016 4 次提交