1. 14 6月, 2016 2 次提交
  2. 07 6月, 2016 1 次提交
  3. 06 6月, 2016 5 次提交
    • G
      virtio-gpu: add live migration support · 0c244e50
      Gerd Hoffmann 提交于
      Store some additional state for cursor and resource backing storage,
      so we can write out and reload things.  Implement vmsave+vmload for
      2d mode.  Continue blocking live migration in 3d/virgl mode.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      Message-id: 1464009727-7753-1-git-send-email-kraxel@redhat.com
      0c244e50
    • G
      vmsvga: don't process more than 1024 fifo commands at once · 4e68a0ee
      Gerd Hoffmann 提交于
      vmsvga_fifo_run is called in regular intervals (on each display update)
      and will resume where it left off.  So we can simply exit the loop,
      without having to worry about how processing will continue.
      
      Fixes: CVE-2016-4453
      Cc: qemu-stable@nongnu.org
      Cc: P J P <ppandit@redhat.com>
      Reported-by: N李强 <liqiang6-s@360.cn>
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      Message-id: 1464592161-18348-5-git-send-email-kraxel@redhat.com
      4e68a0ee
    • G
      vmsvga: shadow fifo registers · 7e486f75
      Gerd Hoffmann 提交于
      The fifo is normal ram.  So kvm vcpu threads and qemu iothread can
      access the fifo in parallel without syncronization.  Which in turn
      implies we can't use the fifo pointers in-place because the guest
      can try changing them underneath us.  So add shadows for them, to
      make sure the guest can't modify them after we've applied sanity
      checks.
      
      Fixes: CVE-2016-4454
      Cc: qemu-stable@nongnu.org
      Cc: P J P <ppandit@redhat.com>
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      Message-id: 1464592161-18348-4-git-send-email-kraxel@redhat.com
      7e486f75
    • G
      vmsvga: add more fifo checks · c2e3c54d
      Gerd Hoffmann 提交于
      Make sure all fifo ptrs are within range.
      
      Fixes: CVE-2016-4454
      Cc: qemu-stable@nongnu.org
      Cc: P J P <ppandit@redhat.com>
      Reported-by: N李强 <liqiang6-s@360.cn>
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      Message-id: 1464592161-18348-3-git-send-email-kraxel@redhat.com
      c2e3c54d
    • G
      vmsvga: move fifo sanity checks to vmsvga_fifo_length · 52136026
      Gerd Hoffmann 提交于
      Sanity checks are applied when the fifo is enabled by the guest
      (SVGA_REG_CONFIG_DONE write).  Which doesn't help much if the guest
      changes the fifo registers afterwards.  Move the checks to
      vmsvga_fifo_length so they are done each time qemu is about to read
      from the fifo.
      
      Fixes: CVE-2016-4454
      Cc: qemu-stable@nongnu.org
      Cc: P J P <ppandit@redhat.com>
      Reported-by: N李强 <liqiang6-s@360.cn>
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      Message-id: 1464592161-18348-2-git-send-email-kraxel@redhat.com
      52136026
  4. 03 6月, 2016 1 次提交
    • G
      virtio-gpu: fix scanout rectangles · fa06e5cb
      Gerd Hoffmann 提交于
      Commit "ca58b45f ui/virtio-gpu: add and use qemu_create_displaysurface_pixman"
      breaks scanouts which use a region of the underlying resource only.
      
      So, we need another way to handle the underlying issue.  Lets create a
      new pixman image, grab a reference on the pixman providing the
      underlying storage, hook up a destroy callback which releases the
      reference.  That way regions work again and releasing the backing
      storage should still be impossible thanks to the extra reference we are
      holding.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      Message-id: 1464597655-26341-1-git-send-email-kraxel@redhat.com
      fa06e5cb
  5. 23 5月, 2016 7 次提交
  6. 19 5月, 2016 3 次提交
  7. 13 5月, 2016 1 次提交
  8. 12 5月, 2016 5 次提交
  9. 02 5月, 2016 5 次提交
    • G
      vga: make sure vga register setup for vbe stays intact (CVE-2016-3712). · fd3c136b
      Gerd Hoffmann 提交于
      Call vbe_update_vgaregs() when the guest touches GFX, SEQ or CRT
      registers, to make sure the vga registers will always have the
      values needed by vbe mode.  This makes sure the sanity checks
      applied by vbe_fixup_regs() are effective.
      
      Without this guests can muck with shift_control, can turn on planar
      vga modes or text mode emulation while VBE is active, making qemu
      take code paths meant for CGA compatibility, but with the very
      large display widths and heigts settable using VBE registers.
      
      Which is good for one or another buffer overflow.  Not that
      critical as they typically read overflows happening somewhere
      in the display code.  So guests can DoS by crashing qemu with a
      segfault, but it is probably not possible to break out of the VM.
      
      Fixes: CVE-2016-3712
      Reported-by: NZuozhi Fzz <zuozhi.fzz@alibaba-inc.com>
      Reported-by: NP J P <ppandit@redhat.com>
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      fd3c136b
    • G
      vga: update vga register setup on vbe changes · 2068192d
      Gerd Hoffmann 提交于
      Call the new vbe_update_vgaregs() function on vbe configuration
      changes, to make sure vga registers are up-to-date.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      2068192d
    • G
      vga: factor out vga register setup · 7fa5c2c5
      Gerd Hoffmann 提交于
      When enabling vbe mode qemu will setup a bunch of vga registers to make
      sure the vga emulation operates in correct mode for a linear
      framebuffer.  Move that code to a separate function so we can call it
      from other places too.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      7fa5c2c5
    • G
      vga: add vbe_enabled() helper · bfa0f151
      Gerd Hoffmann 提交于
      Makes code a bit easier to read.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      bfa0f151
    • G
      vga: fix banked access bounds checking (CVE-2016-3710) · 3bf18170
      Gerd Hoffmann 提交于
      vga allows banked access to video memory using the window at 0xa00000
      and it supports a different access modes with different address
      calculations.
      
      The VBE bochs extentions support banked access too, using the
      VBE_DISPI_INDEX_BANK register.  The code tries to take the different
      address calculations into account and applies different limits to
      VBE_DISPI_INDEX_BANK depending on the current access mode.
      
      Which is probably effective in stopping misprogramming by accident.
      But from a security point of view completely useless as an attacker
      can easily change access modes after setting the bank register.
      
      Drop the bogus check, add range checks to vga_mem_{readb,writeb}
      instead.
      
      Fixes: CVE-2016-3710
      Reported-by: NQinghao Tang <luodalongde@gmail.com>
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      3bf18170
  10. 13 4月, 2016 1 次提交
  11. 11 4月, 2016 2 次提交
    • G
      virtio-gpu: block live migration · fa49e465
      Gerd Hoffmann 提交于
      Feeling a bit nervous putting the full live migration support
      patch (https://patchwork.ozlabs.org/patch/606902/) in that
      late in the 2.6 devel cycle as it carries some non-trivial
      changes.  So disable migration in case virtio-gpu is present
      for now.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      fa49e465
    • G
      ui/virtio-gpu: add and use qemu_create_displaysurface_pixman · ca58b45f
      Gerd Hoffmann 提交于
      Add a the new qemu_create_displaysurface_pixman function, to create
      a DisplaySurface backed by an existing pixman image.  In that case
      there is no need to create a new pixman image pointing to the same
      backing storage.  We can just use the existing image directly.
      
      This does not only simplify things a bit, but most importantly it
      gets the reference counting right, so the backing storage for the
      pixman image wouldn't be released underneath us.
      
      Use new function in virtio-gpu, where using it actually fixes
      use-after-free crashes.
      
      Cc: qemu-stable@nongnu.org
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      Message-id: 1459499240-742-1-git-send-email-kraxel@redhat.com
      ca58b45f
  12. 23 3月, 2016 3 次提交
    • R
      Replaced get_tick_per_sec() by NANOSECONDS_PER_SECOND · 73bcb24d
      Rutuja Shah 提交于
      This patch replaces get_ticks_per_sec() calls with the macro
      NANOSECONDS_PER_SECOND. Also, as there are no callers, get_ticks_per_sec()
      is then removed.  This replacement improves the readability and
      understandability of code.
      
      For example,
      
          timer_mod(fdctrl->result_timer,
      	      qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + (get_ticks_per_sec() / 50));
      
      NANOSECONDS_PER_SECOND makes it obvious that qemu_clock_get_ns
      matches the unit of the expression on the right side of the plus.
      Signed-off-by: NRutuja Shah <rutu.shah.26@gmail.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      73bcb24d
    • P
      hw: explicitly include qemu-common.h and cpu.h · 4771d756
      Paolo Bonzini 提交于
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      4771d756
    • M
      include/qemu/osdep.h: Don't include qapi/error.h · da34e65c
      Markus Armbruster 提交于
      Commit 57cb38b3 included qapi/error.h into qemu/osdep.h to get the
      Error typedef.  Since then, we've moved to include qemu/osdep.h
      everywhere.  Its file comment explains: "To avoid getting into
      possible circular include dependencies, this file should not include
      any other QEMU headers, with the exceptions of config-host.h,
      compiler.h, os-posix.h and os-win32.h, all of which are doing a
      similar job to this file and are under similar constraints."
      qapi/error.h doesn't do a similar job, and it doesn't adhere to
      similar constraints: it includes qapi-types.h.  That's in excess of
      100KiB of crap most .c files don't actually need.
      
      Add the typedef to qemu/typedefs.h, and include that instead of
      qapi/error.h.  Include qapi/error.h in .c files that need it and don't
      get it now.  Include qapi-types.h in qom/object.h for uint16List.
      
      Update scripts/clean-includes accordingly.  Update it further to match
      reality: replace config.h by config-target.h, add sysemu/os-posix.h,
      sysemu/os-win32.h.  Update the list of includes in the qemu/osdep.h
      comment quoted above similarly.
      
      This reduces the number of objects depending on qapi/error.h from "all
      of them" to less than a third.  Unfortunately, the number depending on
      qapi-types.h shrinks only a little.  More work is needed for that one.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      [Fix compilation without the spice devel packages. - Paolo]
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      da34e65c
  13. 17 3月, 2016 1 次提交
  14. 01 3月, 2016 2 次提交
  15. 23 2月, 2016 1 次提交