qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] dc2dea: hw/display/virtio-gpu: Fix memory lea


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] dc2dea: hw/display/virtio-gpu: Fix memory leak (CID 1453811)
Date: Fri, 23 Jul 2021 07:26:57 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: dc2deaba4852e3324a4558a8bd29c58ce3299699
      
https://github.com/qemu/qemu/commit/dc2deaba4852e3324a4558a8bd29c58ce3299699
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2021-07-22 (Thu, 22 Jul 2021)

  Changed paths:
    M hw/display/virtio-gpu.c

  Log Message:
  -----------
  hw/display/virtio-gpu: Fix memory leak (CID 1453811)

To avoid leaking memory on the error path, reorder the
code as:
- check the parameters first
- check resource already existing
- finally allocate memory

Reported-by: Coverity (CID 1453811: RESOURCE_LEAK)
Fixes: e0933d91b1c ("virtio-gpu: Add virtio_gpu_resource_create_blob")
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20210531101928.1662732-1-philmd@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>


  Commit: 39b8a183e2f399d19f3ab6a3db44c7c74774dabd
      
https://github.com/qemu/qemu/commit/39b8a183e2f399d19f3ab6a3db44c7c74774dabd
  Author: Gerd Hoffmann <kraxel@redhat.com>
  Date:   2021-07-22 (Thu, 22 Jul 2021)

  Changed paths:
    M hw/display/qxl.c

  Log Message:
  -----------
  qxl: remove assert in qxl_pre_save.

Since commit 551dbd0846d2 ("migration: check pre_save return in
vmstate_save_state") the pre_save hook can fail.  So lets finally
use that to drop the guest-triggerable assert in qxl_pre_save().

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20210721093347.338536-2-kraxel@redhat.com>


  Commit: dcc5fc2a3adb9ec4b196f82ebe4079bc88f3c91e
      
https://github.com/qemu/qemu/commit/dcc5fc2a3adb9ec4b196f82ebe4079bc88f3c91e
  Author: Gerd Hoffmann <kraxel@redhat.com>
  Date:   2021-07-22 (Thu, 22 Jul 2021)

  Changed paths:
    M hw/display/qxl.c
    M hw/display/qxl.h

  Log Message:
  -----------
  Revert "qxl: add migration blocker to avoid pre-save assert"

This reverts commit 86dbcdd9c7590d06db89ca256c5eaf0b4aba8858.

The pre-save assert is gone now, so the migration blocker
is not needed any more.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20210721093347.338536-3-kraxel@redhat.com>


  Commit: 02f9725f3df8a0e8f0a209d7436fad04e1ac190e
      
https://github.com/qemu/qemu/commit/02f9725f3df8a0e8f0a209d7436fad04e1ac190e
  Author: Marc-André Lureau <marcandre.lureau@redhat.com>
  Date:   2021-07-22 (Thu, 22 Jul 2021)

  Changed paths:
    M hw/display/virtio-gpu-gl.c

  Log Message:
  -----------
  hw/display: fail early when multiple virgl devices are requested

This avoids failing to initialize virgl and crashing later on, and clear
the user expectations.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Message-Id: <20210705104218.1161101-1-marcandre.lureau@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>


  Commit: f29d52611c73347a2fc0fcea62e6197383b18fd1
      
https://github.com/qemu/qemu/commit/f29d52611c73347a2fc0fcea62e6197383b18fd1
  Author: Marc-André Lureau <marcandre.lureau@redhat.com>
  Date:   2021-07-22 (Thu, 22 Jul 2021)

  Changed paths:
    M softmmu/vl.c

  Log Message:
  -----------
  vl: add virtio-vga-gl to the default_list

Do not instantiate an extra default VGA device if -device virtio-vga-gl
is provided.

Related to commit b36eb8860f8f4a9c6f131c3fd380116a3017e022 ("virtio-gpu:
add virtio-vga-gl")

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20210701062421.721414-1-marcandre.lureau@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>


  Commit: 8a13b9bc0f283caff4333c75bc396a963f47ce5c
      
https://github.com/qemu/qemu/commit/8a13b9bc0f283caff4333c75bc396a963f47ce5c
  Author: Marc-André Lureau <marcandre.lureau@redhat.com>
  Date:   2021-07-22 (Thu, 22 Jul 2021)

  Changed paths:
    M hw/display/virtio-gpu-gl.c
    M hw/display/virtio-gpu-virgl.c
    M include/hw/virtio/virtio-gpu.h

  Log Message:
  -----------
  hw/display: fix virgl reset regression

Before commit 49afbca3b00e8e517d54964229a794b51768deaf ("virtio-gpu: drop
use_virgl_renderer"), use_virgl_renderer was preventing calling GL
functions from non-GL context threads. The innocuously looking

  g->parent_obj.use_virgl_renderer = false;

was set the first time virtio_gpu_gl_reset() was called, during
pc_machine_reset() in the main thread. Further virtio_gpu_gl_reset()
calls in IO threads, without associated GL context, were thus skipping
GL calls and avoided warnings or crashes (see also
https://gitlab.freedesktop.org/virgl/virglrenderer/-/issues/226).

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20210702123221.942432-1-marcandre.lureau@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>


  Commit: a146af86c8247f41b641783428b95ee71eb0e43f
      
https://github.com/qemu/qemu/commit/a146af86c8247f41b641783428b95ee71eb0e43f
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2021-07-23 (Fri, 23 Jul 2021)

  Changed paths:
    M hw/display/qxl.c
    M hw/display/qxl.h
    M hw/display/virtio-gpu-gl.c
    M hw/display/virtio-gpu-virgl.c
    M hw/display/virtio-gpu.c
    M include/hw/virtio/virtio-gpu.h
    M softmmu/vl.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/kraxel/tags/vga-20210723-pull-request' 
into staging

vga: fixes for qxl and virtio-gpu

# gpg: Signature made Fri 23 Jul 2021 06:54:34 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

* remotes/kraxel/tags/vga-20210723-pull-request:
  hw/display: fix virgl reset regression
  vl: add virtio-vga-gl to the default_list
  hw/display: fail early when multiple virgl devices are requested
  Revert "qxl: add migration blocker to avoid pre-save assert"
  qxl: remove assert in qxl_pre_save.
  hw/display/virtio-gpu: Fix memory leak (CID 1453811)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>


Compare: https://github.com/qemu/qemu/compare/7b7ca8ebde4e...a146af86c824



reply via email to

[Prev in Thread] Current Thread [Next in Thread]