From: "Marc-André Lureau" <marcandre.lureau@redhat.com>
To: qemu-devel@nongnu.org
Cc: stefanha@redhat.com, "Michael S. Tsirkin" <mst@redhat.com>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Akihiko Odaki" <odaki@rsg.ci.i.u-tokyo.ac.jp>,
"Dmitry Osipenko" <dmitry.osipenko@collabora.com>
Subject: [GIT PULL 8/9] hw/display/virtio-gpu: Unmap DMA regions on reset
Date: Tue, 04 Aug 2026 11:18:57 +0400 [thread overview]
Message-ID: <20260804-fix-v1-8-0c2be5390809@redhat.com> (raw)
In-Reply-To: <20260804-fix-v1-0-0c2be5390809@redhat.com>
From: Bin Guo <guobin@linux.alibaba.com>
virtio_gpu_reset() freed in-flight commands without unmapping the
DMA regions acquired by virtqueue_pop(). Call virtqueue_detach_element()
before g_free() in both drain loops.
Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/3467
Cc: qemu-stable@nongnu.org
Signed-off-by: Bin Guo <guobin@linux.alibaba.com>
Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-ID: <20260803082158.62998-1-guobin@linux.alibaba.com>
---
hw/display/virtio-gpu.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c
index c15d4b527d0e..fbb6fec7a0ad 100644
--- a/hw/display/virtio-gpu.c
+++ b/hw/display/virtio-gpu.c
@@ -1725,12 +1725,14 @@ void virtio_gpu_reset(VirtIODevice *vdev)
while (!QTAILQ_EMPTY(&g->cmdq)) {
cmd = QTAILQ_FIRST(&g->cmdq);
QTAILQ_REMOVE(&g->cmdq, cmd, next);
+ virtqueue_detach_element(cmd->vq, &cmd->elem, 0);
g_free(cmd);
}
while (!QTAILQ_EMPTY(&g->fenceq)) {
cmd = QTAILQ_FIRST(&g->fenceq);
QTAILQ_REMOVE(&g->fenceq, cmd, next);
+ virtqueue_detach_element(cmd->vq, &cmd->elem, 0);
g->inflight--;
g_free(cmd);
}
--
2.55.0
next prev parent reply other threads:[~2026-08-04 7:21 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-04 7:18 [GIT PULL 0/9] Fixes for 11.1-rc Marc-André Lureau
2026-08-04 7:18 ` [GIT PULL 1/9] hw/display/virtio-gpu: validate blob iov size Marc-André Lureau
2026-08-04 7:18 ` [GIT PULL 2/9] hw/display/vga: fix panning_buf OOB after text/graphics switch Marc-André Lureau
2026-08-04 7:18 ` [GIT PULL 3/9] vhost-user-gpu: fix integer overflow in buffer allocation Marc-André Lureau
2026-08-04 7:18 ` [GIT PULL 4/9] hw/display/virtio-gpu: fix offset wraparound in scanout_blob_to_fb Marc-André Lureau
2026-08-04 7:18 ` [GIT PULL 5/9] hw/display/virtio-gpu: drop redundant node->value NULL checks Marc-André Lureau
2026-08-04 7:18 ` [GIT PULL 6/9] virtio-gpu: reject requests with short/truncated control headers Marc-André Lureau
2026-08-04 7:18 ` [GIT PULL 7/9] hw/display/virtio-gpu: Always reject invalid scanout bounds Marc-André Lureau
2026-08-04 7:18 ` Marc-André Lureau [this message]
2026-08-04 7:18 ` [GIT PULL 9/9] qapi/dump: add allowed-by-guest feature to win-dmp Marc-André Lureau
2026-08-04 19:07 ` [GIT PULL 0/9] Fixes for 11.1-rc Marc-André Lureau
2026-08-04 19:21 ` [GIT PULL v2 " Marc-André Lureau
2026-08-04 19:21 ` [GIT PULL v2 1/9] hw/display/virtio-gpu: validate blob iov size Marc-André Lureau
2026-08-04 19:21 ` [GIT PULL v2 2/9] hw/display/vga: fix panning_buf OOB after text/graphics switch Marc-André Lureau
2026-08-04 19:21 ` [GIT PULL v2 3/9] vhost-user-gpu: fix integer overflow in buffer allocation Marc-André Lureau
2026-08-04 19:21 ` [GIT PULL v2 4/9] hw/display/virtio-gpu: fix offset wraparound in scanout_blob_to_fb Marc-André Lureau
2026-08-04 19:21 ` [GIT PULL v2 5/9] hw/display/virtio-gpu: drop redundant node->value NULL checks Marc-André Lureau
2026-08-04 19:21 ` [GIT PULL v2 6/9] virtio-gpu: reject requests with short/truncated control headers Marc-André Lureau
2026-08-04 19:21 ` [GIT PULL v2 7/9] hw/display/virtio-gpu: Always reject invalid scanout bounds Marc-André Lureau
2026-08-04 19:21 ` [GIT PULL v2 8/9] hw/display/virtio-gpu: Unmap DMA regions on reset Marc-André Lureau
2026-08-04 19:21 ` [GIT PULL v2 9/9] qapi/dump: add allowed-by-guest feature to win-dmp Marc-André Lureau
2026-08-05 0:55 ` [GIT PULL v2 0/9] Fixes for 11.1-rc Stefan Hajnoczi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260804-fix-v1-8-0c2be5390809@redhat.com \
--to=marcandre.lureau@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=dmitry.osipenko@collabora.com \
--cc=mst@redhat.com \
--cc=odaki@rsg.ci.i.u-tokyo.ac.jp \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.