1. 16 3月, 2017 6 次提交
    • G
      cirrus: stop passing around dst pointers in the blitter · 026aeffc
      Gerd Hoffmann 提交于
      Instead pass around the address (aka offset into vga memory).  Calculate
      the pointer in the rop_* functions, after applying the mask to the
      address, to make sure the address stays within the valid range.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      Message-id: 1489574872-8679-1-git-send-email-kraxel@redhat.com
      026aeffc
    • G
      cirrus: fix cirrus_invalidate_region · e048dac6
      Gerd Hoffmann 提交于
      off_cur_end is exclusive, so off_cur_end == cirrus_addr_mask is valid.
      Fix calculation to make sure to allow that, otherwise the assert added
      by commit f153b563 can trigger for valid
      blits.
      
      Test case: boot windows nt 4.0
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      Message-id: 1489579606-26020-1-git-send-email-kraxel@redhat.com
      e048dac6
    • G
      cirrus: add option to disable blitter · 827bd517
      Gerd Hoffmann 提交于
      Ok, we have this beast in the cirrus code which is not used at all by
      modern guests, except when you try to find security holes in qemu.  So,
      add an option to disable blitter altogether.  Guests released within
      the last ten years should not show any rendering issues if you turn off
      blitter support.
      
      There are no known bugs in the cirrus blitter code.  But in the past we
      hoped a few times already that we've finally nailed the last issue.  So
      having some easy way to mitigate in case yet another blitter issue shows
      up certainly makes me sleep a bit better at night.
      
      For completeness:  The by far better way to mitigate is to switch away
      from cirrus and use stdvga instead.  Or something more modern like
      virtio-vga in case your guest has support for it.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      Message-id: 1489494540-15745-1-git-send-email-kraxel@redhat.com
      827bd517
    • G
      cirrus: switch to 4 MB video memory by default · 73c14813
      Gerd Hoffmann 提交于
      Quoting cirrus source code:
         Follow real hardware, cirrus card emulated has 4 MB video memory.
         Also accept 8 MB/16 MB for backward compatibility.
      
      So just use 4MB by default.  We decided to leave that at 8MB by default
      a while ago, for live migration compatibility reasons.  But we have
      compat properties to handle that, so that isn't a compeling reason.
      
      This also removes some sanity check inconsistencies in the cirrus code.
      Some places check against the allocated video memory, some places check
      against the 4MB physical hardware has.  Guest code can trigger asserts
      because of that.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      Message-id: 1489494514-15606-1-git-send-email-kraxel@redhat.com
      73c14813
    • G
      cirrus/vnc: zap bitblit support from console code. · 50628d34
      Gerd Hoffmann 提交于
      There is a special code path (dpy_gfx_copy) to allow graphic emulation
      notify user interface code about bitblit operations carryed out by
      guests.  It is supported by cirrus and vnc server.  The intended purpose
      is to optimize display scrolls and just send over the scroll op instead
      of a full display update.
      
      This is rarely used these days though because modern guests simply don't
      use the cirrus blitter any more.  Any linux guest using the cirrus drm
      driver doesn't.  Any windows guest newer than winxp doesn't ship with a
      cirrus driver any more and thus uses the cirrus as simple framebuffer.
      
      So this code tends to bitrot and bugs can go unnoticed for a long time.
      See for example commit "3e10c3ec vnc: fix qemu crash because of SIGSEGV"
      which fixes a bug lingering in the code for almost a year, added by
      commit "c7628bff vnc: only alloc server surface with clients connected".
      
      Also the vnc server will throttle the frame rate in case it figures the
      network can't keep up (send buffers are full).  This doesn't work with
      dpy_gfx_copy, for any copy operation sent to the vnc client we have to
      send all outstanding updates beforehand, otherwise the vnc client might
      run the client side blit on outdated data and thereby corrupt the
      display.  So this dpy_gfx_copy "optimization" might even make things
      worse on slow network links.
      
      Lets kill it once for all.
      
      Oh, and one more reason: Turns out (after writing the patch) we have a
      security bug in that code path ...
      
      Fixes: CVE-2016-9603
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      Message-id: 1489494419-14340-1-git-send-email-kraxel@redhat.com
      50628d34
    • H
      fix :cirrus_vga fix OOB read case qemu Segmentation fault · 215902d7
      hangaohuai 提交于
      check the validity of parameters in cirrus_bitblt_rop_fwd_transp_xxx
      and cirrus_bitblt_rop_fwd_xxx to avoid the OOB read which causes qemu Segmentation fault.
      
      After the fix, we will touch the assert in
      cirrus_invalidate_region:
      assert(off_cur_end >= off_cur);
      Signed-off-by: Nfangying <fangying1@huawei.com>
      Signed-off-by: Nhangaohuai <hangaohuai@huawei.com>
      Message-id: 20170314063919.16200-1-hangaohuai@huawei.com
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      215902d7
  2. 09 3月, 2017 1 次提交
  3. 28 2月, 2017 1 次提交
  4. 27 2月, 2017 2 次提交
  5. 24 2月, 2017 1 次提交
  6. 14 2月, 2017 1 次提交
  7. 10 2月, 2017 6 次提交
  8. 02 2月, 2017 1 次提交
    • L
      cirrus: fix oob access issue (CVE-2017-2615) · 62d4c6bd
      Li Qiang 提交于
      When doing bitblt copy in backward mode, we should minus the
      blt width first just like the adding in the forward mode. This
      can avoid the oob access of the front of vga's vram.
      Signed-off-by: NLi Qiang <liqiang6-s@360.cn>
      
      { kraxel: with backward blits (negative pitch) addr is the topmost
                address, so check it as-is against vram size ]
      
      Cc: qemu-stable@nongnu.org
      Cc: P J P <ppandit@redhat.com>
      Cc: Laszlo Ersek <lersek@redhat.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Wolfgang Bumiller <w.bumiller@proxmox.com>
      Fixes: d3532a0d (CVE-2014-8106)
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      Message-id: 1485938101-26602-1-git-send-email-kraxel@redhat.com
      Reviewed-by: NLaszlo Ersek <lersek@redhat.com>
      62d4c6bd
  9. 01 2月, 2017 4 次提交
  10. 31 1月, 2017 1 次提交
  11. 28 1月, 2017 1 次提交
  12. 25 1月, 2017 5 次提交
  13. 11 1月, 2017 5 次提交
  14. 09 1月, 2017 1 次提交
  15. 03 1月, 2017 3 次提交
  16. 20 12月, 2016 1 次提交
    • G
      virtio-gpu: track and limit host memory allocations · 9b7621bc
      Gerd Hoffmann 提交于
      This patch makes virtio-gpu track host memory allocations for ressources
      and applies a limit (configurable 256M by default).  When exceeding the
      limit virtio-gpu throws VIRTIO_GPU_RESP_ERR_OUT_OF_MEMORY errors (like
      it already does today when pixman image allocations fail).
      
      This patch covers 2d mode only.  For 3d mode we have to figure how we
      are going to handle this best.  qemu doesn't track resources in case
      virglrenderer is used, so I guess we should extend virglrenderer to
      allow setting a limit, then let qemu set the limit and catch
      virgl_renderer_resource_create failures.
      
      Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
      Cc: Dave Airlie <airlied@redhat.com>
      Cc: 李强 <liqiang6-s@360.cn>
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      Message-id: 1480423356-22255-1-git-send-email-kraxel@redhat.com
      9b7621bc