Skip to content
Snippets Groups Projects
  1. Dec 12, 2018
  2. Dec 04, 2018
    • Jason Wang's avatar
      net: hub: suppress warnings of no host network for qtest · 56512e1d
      Jason Wang authored
      
      If we want to qtest through hub, it would be much more simpler and
      safer to configure the hub without host network. So silent this
      warnings for qtest.
      
      Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
      Reviewed-by: default avatarThomas Huth <thuth@redhat.com>
      Message-id: 20181204035347.6148-3-jasowang@redhat.com
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      56512e1d
    • Jason Wang's avatar
      net: drop too large packet early · 25c01bd1
      Jason Wang authored
      
      We try to detect and drop too large packet (>INT_MAX) in 1592a994
      ("net: ignore packet size greater than INT_MAX") during packet
      delivering. Unfortunately, this is not sufficient as we may hit
      another integer overflow when trying to queue such large packet in
      qemu_net_queue_append_iov():
      
      - size of the allocation may overflow on 32bit
      - packet->size is integer which may overflow even on 64bit
      
      Fixing this by moving the check to qemu_sendv_packet_async() which is
      the entrance of all networking codes and reduce the limit to
      NET_BUFSIZE to be more conservative. This works since:
      
      - For the callers that call qemu_sendv_packet_async() directly, they
        only care about if zero is returned to determine whether to prevent
        the source from producing more packets. A callback will be triggered
        if peer can accept more then source could be enabled. This is
        usually used by high speed networking implementation like virtio-net
        or netmap.
      - For the callers that call qemu_sendv_packet() that calls
        qemu_sendv_packet_async() indirectly, they often ignore the return
        value. In this case qemu will just the drop packets if peer can't
        receive.
      
      Qemu will copy the packet if it was queued. So it was safe for both
      kinds of the callers to assume the packet was sent.
      
      Since we move the check from qemu_deliver_packet_iov() to
      qemu_sendv_packet_async(), it would be safer to make
      qemu_deliver_packet_iov() static to prevent any external user in the
      future.
      
      This is a revised patch of CVE-2018-17963.
      
      Cc: qemu-stable@nongnu.org
      Cc: Li Qiang <liq3ea@163.com>
      Fixes: 1592a994 ("net: ignore packet size greater than INT_MAX")
      Reported-by: default avatarLi Qiang <liq3ea@gmail.com>
      Reviewed-by: default avatarLi Qiang <liq3ea@gmail.com>
      Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
      Reviewed-by: default avatarThomas Huth <thuth@redhat.com>
      Message-id: 20181204035347.6148-2-jasowang@redhat.com
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      25c01bd1
  3. Nov 16, 2018
  4. Oct 21, 2018
  5. Oct 19, 2018
  6. Oct 03, 2018
    • Marc-André Lureau's avatar
      chardev: mark the calls that allow an implicit mux monitor · 95e30b2a
      Marc-André Lureau authored
      
      This is mostly for readability of the code. Let's make it clear which
      callers can create an implicit monitor when the chardev is muxed.
      
      This will also enforce a safer behaviour, as we don't really support
      creating monitor anywhere/anytime at the moment. Add an assert() to
      make sure the programmer explicitely wanted that behaviour.
      
      There are documented cases, such as: -serial/-parallel/-virtioconsole
      and to less extent -debugcon.
      
      Less obvious and questionable ones are -gdb, SLIRP -guestfwd and Xen
      console. Add a FIXME note for those, but keep the support for now.
      
      Other qemu_chr_new() callers either have a fixed parameter/filename
      string or do not need it, such as -qtest:
      
      * qtest.c: qtest_init()
        Afaik, only used by tests/libqtest.c, without mux. I don't think we
        support it outside of qemu testing: drop support for implicit mux
        monitor (qemu_chr_new() call: no implicit mux now).
      
      * hw/
        All with literal @filename argument that doesn't enable mux monitor.
      
      * tests/
        All with @filename argument that doesn't enable mux monitor.
      
      On a related note, the list of monitor creation places:
      
      - the chardev creators listed above: all from command line (except
        perhaps Xen console?)
      
      - -gdb & hmp gdbserver will create a "GDB monitor command" chardev
        that is wired to an HMP monitor.
      
      - -mon command line option
      
      From this short study, I would like to think that a monitor may only
      be created in the main thread today, though I remain skeptical :)
      
      Signed-off-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      Reviewed-by: default avatarMarkus Armbruster <armbru@redhat.com>
      95e30b2a
  7. Sep 25, 2018
  8. Aug 31, 2018
  9. Jul 20, 2018
  10. Jun 15, 2018
  11. Jun 12, 2018
    • Marc-André Lureau's avatar
      object: fix OBJ_PROP_LINK_UNREF_ON_RELEASE ambivalence · 265b578c
      Marc-André Lureau authored
      
      A link property can be set during creation, with
      object_property_add_link() and later with object_property_set_link().
      
      add_link() doesn't add a reference to the target object, while
      set_link() does.
      
      Furthemore, OBJ_PROP_LINK_UNREF_ON_RELEASE flags, set during add_link,
      says whether a reference must be released when the property is destroyed.
      This can lead to leaks if the property was later set_link(), as the
      added reference is never released.
      
      Instead, rename OBJ_PROP_LINK_UNREF_ON_RELEASE to OBJ_PROP_LINK_STRONG
      and use that has an indication on how the link handle reference
      management in set_link().
      
      Signed-off-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      Message-id: 20180531195119.22021-3-marcandre.lureau@redhat.com
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      265b578c
  12. Jun 01, 2018
  13. May 31, 2018
  14. May 24, 2018
  15. May 23, 2018
  16. May 14, 2018
  17. Mar 26, 2018
  18. Mar 05, 2018
Loading