M68k for 11.2.0 patches
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
[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
@@ -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
Peter Maydell
Reviewed-byRe: [PULL 1/1] hw/char/goldfish_tty: Fix signed data length
Quoted 20 lines · Laurent Vivier
The guest-controlled
data_lenregister isuint32_t, but was copied into a signed int. A value of0xffffffffconsequently 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
Signed-off-by Laurent Vivier <[email protected]>Message-ID: <[email protected]>
--- hw/char/goldfish_tty.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)hw/char/goldfish_tty.c +0
-0
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
Richard Henderson
AppliedQuoted 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-requestfor 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~