Skip to content
Snippets Groups Projects
  1. Apr 20, 2022
  2. Apr 19, 2022
  3. Apr 13, 2022
    • Peter Maydell's avatar
      target/i386: Remove unused XMMReg, YMMReg types and CPUState fields · c9e28ae7
      Peter Maydell authored
      
      In commit b7711471 in 2014 we refactored the handling of the x86
      vector registers so that instead of separate structs XMMReg, YMMReg
      and ZMMReg for representing the 16-byte, 32-byte and 64-byte width
      vector registers and multiple fields in the CPU state, we have a
      single type (XMMReg, later renamed to ZMMReg) and a single struct
      field (xmm_regs).  However, in 2017 in commit c97d6d2c some of
      the old struct types and CPU state fields got added back, when we
      merged in the hvf support (which had developed in a separate fork
      that had presumably not had the refactoring of b7711471), as part
      of code handling xsave.  Commit f585195e then almost immediately
      dropped that xsave code again in favour of sharing the xsave handling
      with KVM, but forgot to remove the now unused CPU state fields and
      struct types.
      
      Delete the unused types and CPUState fields.
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Message-Id: <20220412110047.1497190-1-peter.maydell@linaro.org>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      c9e28ae7
    • Paolo Bonzini's avatar
      target/i386: do not access beyond the low 128 bits of SSE registers · d22697dd
      Paolo Bonzini authored
      
      The i386 target consolidates all vector registers so that instead of
      XMMReg, YMMReg and ZMMReg structs there is a single ZMMReg that can
      fit all of SSE, AVX and AVX512.
      
      When TCG copies data from and to the SSE registers, it uses the
      full 64-byte width.  This is not a correctness issue because TCG
      never lets guest code see beyond the first 128 bits of the ZMM
      registers, however it causes uninitialized stack memory to
      make it to the CPU's migration stream.
      
      Fix it by only copying the low 16 bytes of the ZMMReg union into
      the destination register.
      
      Reviewed-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      d22697dd
  4. Apr 12, 2022
  5. Apr 08, 2022
    • Wentao Liang's avatar
      virtio-iommu: use-after-free fix · 4bf58c72
      Wentao Liang authored
      
      A potential Use-after-free was reported in virtio_iommu_handle_command
      when using virtio-iommu:
      
      > I find a potential Use-after-free in QEMU 6.2.0, which is in
      > virtio_iommu_handle_command() (./hw/virtio/virtio-iommu.c).
      >
      >
      > Specifically, in the loop body, the variable 'buf' allocated at line 639 can be
      > freed by g_free() at line 659. However, if the execution path enters the loop
      > body again and the if branch takes true at line 616, the control will directly
      > jump to 'out' at line 651. At this time, 'buf' is a freed pointer, which is not
      > assigned with an allocated memory but used at line 653. As a result, a UAF bug
      > is triggered.
      >
      >
      >
      > 599     for (;;) {
      > ...
      > 615         sz = iov_to_buf(iov, iov_cnt, 0, &head, sizeof(head));
      > 616         if (unlikely(sz != sizeof(head))) {
      > 617             tail.status = VIRTIO_IOMMU_S_DEVERR;
      > 618             goto out;
      > 619         }
      > ...
      > 639             buf = g_malloc0(output_size);
      > ...
      > 651 out:
      > 652         sz = iov_from_buf(elem->in_sg, elem->in_num, 0,
      > 653                           buf ? buf : &tail, output_size);
      > ...
      > 659         g_free(buf);
      >
      > We can fix it by set ‘buf‘ to NULL after freeing it:
      >
      >
      > 651 out:
      > 652         sz = iov_from_buf(elem->in_sg, elem->in_num, 0,
      > 653                           buf ? buf : &tail, output_size);
      > ...
      > 659         g_free(buf);
      > +++ buf = NULL;
      > 660     }
      
      Fix as suggested by the reporter.
      
      Signed-off-by: default avatarWentao Liang <Wentao_Liang_g@163.com>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Message-id: 20220407095047.50371-1-mst@redhat.com
      Message-ID: <20220406040445-mutt-send-email-mst@kernel.org>
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      4bf58c72
    • Peter Maydell's avatar
      Merge tag 'fixes-20220408-pull-request' of git://git.kraxel.org/qemu into staging · dde8689d
      Peter Maydell authored
      two cursor/qxl related security fixes.
      
      # gpg: Signature made Fri 08 Apr 2022 05:37:16 BST
      # gpg:                using RSA key A0328CFFB93A17A79901FE7D4CB6D8EED3E87138
      # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" [full]
      # gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>" [full]
      # gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>" [full]
      # Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138
      
      * tag 'fixes-20220408-pull-request' of git://git.kraxel.org/qemu
      
      :
        ui/cursor: fix integer overflow in cursor_alloc (CVE-2021-4206)
        display/qxl-render: fix race condition in qxl_cursor (CVE-2021-4207)
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      dde8689d
  6. Apr 07, 2022
  7. Apr 06, 2022
Loading