Skip to contentSkip to conversation

M68k for 11.2.0 patches

GIT PULL Applied Laurent Vivier 3 participants 4 messages Nov 27 – Nov 29

lore
Share & tools
lore
#0 lore raw

The following changes since commit 9751c62358073580cbf330a4df22077a7c6a407c:

Update version for v11.2.0-rc2 release (2026-11-25 21:39:27 -0800)

are available in the Git repository at:

https://gitlab.com/laurent_vivier/qemu.git tags/m68k-for-11.2.0-pull-request

for you to fetch changes up to 20a2f956153e82b84fcb1be5b3a6ed2906f75e55:

hw/char/goldfish_tty: Fix signed data length (2026-11-27 11:33:21 +0100)

----------------------------------------------------------------
One goldfish fix

----------------------------------------------------------------

Laurent Vivier (1):
hw/char/goldfish_tty: Fix signed data length

 hw/char/goldfish_tty.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Signature · 1 line
2.56.0
#1 lore raw

[PULL 1/1] hw/char/goldfish_tty: Fix signed data length

The guest-controlled data_len register is uint32_t, but was copied into a signed int. A value of 0xffffffff consequently became -1, allowing the DMA transfer size to exceed the 128-byte stack buffer.

Use an unsigned length variable so that each transfer remains bounded by GOLFISH_TTY_BUFFER_SIZE.

Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/4245

Message-ID: <[email protected]>

---
 hw/char/goldfish_tty.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/char/goldfish_tty.c +1 -1
index 8e1e9228c78b..f64527f50a02 100644
@@ -71,7 +71,7 @@ static void goldfish_tty_cmd(GoldfishTTYState *s, uint32_t cmd)
 {
     uint32_t to_copy;
     uint8_t data_out[GOLFISH_TTY_BUFFER_SIZE];
-    int len;
+    unsigned int len;
     uint64_t ptr;
 
     switch (cmd) {
Signature · 1 line
2.56.0
Reviewed-by
#2 lore raw

Re: [PULL 1/1] hw/char/goldfish_tty: Fix signed data length

Quoted 20 lines · Laurent Vivier

The guest-controlled data_len register is uint32_t, but was copied into a signed int. A value of 0xffffffff consequently became -1, allowing the DMA transfer size to exceed the 128-byte stack buffer.

Use an unsigned length variable so that each transfer remains bounded by GOLFISH_TTY_BUFFER_SIZE.

Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/4245

Message-ID: <[email protected]>

---
 hw/char/goldfish_tty.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/char/goldfish_tty.c +0 -0
index 8e1e9228c78b..f64527f50a02 100644

hw/char/goldfish_tty.c static void goldfish_tty_cmd(GoldfishTTYState *s, uint32_t cmd) · line 75

Quoted 6 lines
hw/char/goldfish_tty.c +1 -1
@@ -71,7 +71,7 @@ static void goldfish_tty_cmd(GoldfishTTYState *s, uint32_t cmd)
 {
     uint32_t to_copy;
     uint8_t data_out[GOLFISH_TTY_BUFFER_SIZE];
-    int len;
+    unsigned int len;
     uint64_t ptr;

uint32_t would be preferable (matching the type of s->data_len and to_copy and the 'max' argument to fifo8_pop_bufptr()).

But either way

thanks
-- PMM

#3 lore raw
In reply to Laurent Vivier
Quoted 6 lines · Laurent Vivier

The following changes since commit 9751c62358073580cbf330a4df22077a7c6a407c:

   Update version for v11.2.0-rc2 release (2026-11-25 21:39:27 -0800)

are available in the Git repository at:

Quoted 8 lines
   https://gitlab.com/laurent_vivier/qemu.git tags/m68k-for-11.2.0-pull-request

for you to fetch changes up to 20a2f956153e82b84fcb1be5b3a6ed2906f75e55:

   hw/char/goldfish_tty: Fix signed data length (2026-11-27 11:33:21 +0100)

----------------------------------------------------------------
One goldfish fix

Applied, thanks.

r~