* [PULL for-10.1 0/1] Trivial patches for 2025-07-25
@ 2025-07-25 15:55 Michael Tokarev
2025-07-25 15:55 ` [PULL 1/1] hw/display/qxl-render.c: fix qxl_unpack_chunks() chunk size calculation Michael Tokarev
2025-07-28 15:19 ` [PULL for-10.1 0/1] Trivial patches for 2025-07-25 Stefan Hajnoczi
0 siblings, 2 replies; 3+ messages in thread
From: Michael Tokarev @ 2025-07-25 15:55 UTC (permalink / raw)
To: qemu-devel; +Cc: Michael Tokarev, qemu-trivial
The following changes since commit 9e601684dc24a521bb1d23215a63e5c6e79ea0bb:
Update version for the v10.1.0-rc0 release (2025-07-22 15:48:48 -0400)
are available in the Git repository at:
https://gitlab.com/mjt0k/qemu.git tags/pull-trivial-patches
for you to fetch changes up to b8882becd572d3afb888c836a6ffc7f92c17d1c5:
hw/display/qxl-render.c: fix qxl_unpack_chunks() chunk size calculation (2025-07-25 09:42:11 +0300)
----------------------------------------------------------------
trivial patches for 2025-07-25
There's a single patch in this pullreq, fixing a longstanding
bug in qxl. The change, while isn't exactly trivial, is clear
enough, hopefully, to go through trivial-patches. This area in
qemu is basically unmaintained.
----------------------------------------------------------------
Michael Tokarev (1):
hw/display/qxl-render.c: fix qxl_unpack_chunks() chunk size calculation
hw/display/qxl-render.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PULL 1/1] hw/display/qxl-render.c: fix qxl_unpack_chunks() chunk size calculation
2025-07-25 15:55 [PULL for-10.1 0/1] Trivial patches for 2025-07-25 Michael Tokarev
@ 2025-07-25 15:55 ` Michael Tokarev
2025-07-28 15:19 ` [PULL for-10.1 0/1] Trivial patches for 2025-07-25 Stefan Hajnoczi
1 sibling, 0 replies; 3+ messages in thread
From: Michael Tokarev @ 2025-07-25 15:55 UTC (permalink / raw)
To: qemu-devel; +Cc: Michael Tokarev, qemu-trivial
In case of multiple chunks, code in qxl_unpack_chunks() takes size of the
wrong (next in the chain) chunk, instead of using current chunk size.
This leads to wrong number of bytes being copied, and to crashes if next
chunk size is larger than the current one.
Based on the code by Gao Yong.
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1628
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Thomas Huth <thuth@redhat.com>
---
hw/display/qxl-render.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/hw/display/qxl-render.c b/hw/display/qxl-render.c
index eda6d3de37..c6a9ac1da1 100644
--- a/hw/display/qxl-render.c
+++ b/hw/display/qxl-render.c
@@ -222,6 +222,7 @@ static void qxl_unpack_chunks(void *dest, size_t size, PCIQXLDevice *qxl,
uint32_t max_chunks = 32;
size_t offset = 0;
size_t bytes;
+ QXLPHYSICAL next_chunk_phys = 0;
for (;;) {
bytes = MIN(size - offset, chunk->data_size);
@@ -230,7 +231,15 @@ static void qxl_unpack_chunks(void *dest, size_t size, PCIQXLDevice *qxl,
if (offset == size) {
return;
}
- chunk = qxl_phys2virt(qxl, chunk->next_chunk, group_id,
+ next_chunk_phys = chunk->next_chunk;
+ /* fist time, only get the next chunk's data size */
+ chunk = qxl_phys2virt(qxl, next_chunk_phys, group_id,
+ sizeof(QXLDataChunk));
+ if (!chunk) {
+ return;
+ }
+ /* second time, check data size and get data */
+ chunk = qxl_phys2virt(qxl, next_chunk_phys, group_id,
sizeof(QXLDataChunk) + chunk->data_size);
if (!chunk) {
return;
--
2.47.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PULL for-10.1 0/1] Trivial patches for 2025-07-25
2025-07-25 15:55 [PULL for-10.1 0/1] Trivial patches for 2025-07-25 Michael Tokarev
2025-07-25 15:55 ` [PULL 1/1] hw/display/qxl-render.c: fix qxl_unpack_chunks() chunk size calculation Michael Tokarev
@ 2025-07-28 15:19 ` Stefan Hajnoczi
1 sibling, 0 replies; 3+ messages in thread
From: Stefan Hajnoczi @ 2025-07-28 15:19 UTC (permalink / raw)
To: Michael Tokarev; +Cc: qemu-devel, Michael Tokarev, qemu-trivial
[-- Attachment #1: Type: text/plain, Size: 116 bytes --]
Applied, thanks.
Please update the changelog at https://wiki.qemu.org/ChangeLog/10.1 for any user-visible changes.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-07-28 15:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-25 15:55 [PULL for-10.1 0/1] Trivial patches for 2025-07-25 Michael Tokarev
2025-07-25 15:55 ` [PULL 1/1] hw/display/qxl-render.c: fix qxl_unpack_chunks() chunk size calculation Michael Tokarev
2025-07-28 15:19 ` [PULL for-10.1 0/1] Trivial patches for 2025-07-25 Stefan Hajnoczi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).