Skip to content

Various audio, chardev, ui and hw fixes

Marc-André Lureau qemu-arm qemu-devel qemu-riscv xen-devel 1 version In review

Get series with b4
b4 am [email protected] change-id 20261002-issue-4560-a704c9fc737f

Versions newest first

  1. v1 Latest63 patches 13 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/63audio/ossaudio: fix ioctl passing address-of-pointer instead of pointeraudio/ossaudio.c+1 -10 replies
2/63audio/dbusaudio: fix off-by-one in volume channel assertionaudio/dbusaudio.c+2 -20 replies
3/63audio/ossaudio: fix off-by-one in mmap buffer size assertionaudio/ossaudio.c+1 -10 replies
4/63audio/paaudio: fix server string in PAConnectionaudio/paaudio.c+2 -00 replies
5/63audio/paaudio: avoid pidfile path truncationaudio/paaudio.c+2 -20 replies
6/63audio/pwaudio: fix capture buffer leak on early return pathsaudio/pwaudio.c+3 -00 replies
7/63audio/pwaudio: clamp overrun writes to remaining ring buffer spaceaudio/pwaudio.c+2 -00 replies
8/63audio/pwaudio: fix integer underflow in qpw_read()audio/pwaudio.c+5 -10 replies
9/63audio/pwaudio: handle negative avail in qpw_write and qpw_buffer_get_freeaudio/pwaudio.c+8 -10 replies
10/63audio/pwaudio: bail out on underrun in qpw_writeaudio/pwaudio.c+2 -00 replies
11/63audio/audio-mixeng-be: add upper bounds to audio settings validationaudio/audio-mixeng-be.c+2 -20 replies
12/63audio/wavcapture: prevent freq overflow and corrupted WAV headeraudio/wavcapture.c+6 -00 replies
13/63ui/clipboard: clean up vm change state handler on last peer unregisterui/clipboard.c+4 -00 replies
14/63ui/console: skip empty update regions in qemu_console_updateui/console.c+3 -00 replies
15/63ui/console: use QLIST_FOREACH_SAFE in dpy_refreshui/console.c+2 -20 replies
16/63ui/input: fix integer overflow in qemu_input_scale_axisui/input.c+7 -10 replies
17/63ui/vnc-enc-zrle: propagate zrle_compress_data errorui/vnc-enc-zrle.c+14 -50 replies
18/63ui/vnc-jobs: assert rect coordinates and dimensions in vnc_job_add_rectui/vnc-jobs.c+1 -00 replies
19/63chardev/char-pty: free pty_name in finalizechardev/char-pty.c+1 -00 replies
20/63chardev/char-ringbuf: reject zero size with is_power_of_2chardev/char-ringbuf.c+2 -10 replies
21/63chardev/char-ringbuf: use actual read length in qmp_ringbuf_readchardev/char-ringbuf.c+4 -30 replies
22/63chardev/char-udp: clarify read_poll return value with pending datachardev/char-udp.c+4 -00 replies
23/63chardev/char: fix use-after-free on mux creation failurechardev/char.c+1 -00 replies
24/63hw/audio/gusemu_mixer: fix integer overflow in volume rampinghw/audio/gusemu_mixer.c+5 -30 replies
25/63hw/audio/gusemu_mixer: use unsigned literal for IRQ bit shiftshw/audio/gusemu_mixer.c+4 -42 replies
26/63hw/char/cadence_uart: fix RX FIFO overflow handlinghw/char/cadence_uart.c+9 -71 reply
27/63hw/char/cadence_uart: use correct interrupt for TX FIFO overflowhw/char/cadence_uart.c+1 -11 reply
28/63hw/char/cadence_uart: validate FIFO indices in post_loadhw/char/cadence_uart.c+5 -01 reply
29/63hw/char/cadence_uart: fix post_load return value for invalid baud ratehw/char/cadence_uart.c+1 -21 reply
30/63hw/char/escc: validate channel register index in post_loadhw/char/escc.c+11 -00 replies
31/63hw/char/exynos4210_uart: fix baud rate calculation operator precedencehw/char/exynos4210_uart.c+1 -11 reply
32/63hw/char/exynos4210_uart: enforce 32-bit MMIO access sizehw/char/exynos4210_uart.c+4 -01 reply
33/63hw/char/ibex_uart: prevent division by zero on baud rate calculationhw/char/ibex_uart.c+6 -21 reply
34/63hw/char/imx_serial: update interrupts after status register writeshw/char/imx_serial.c+3 -00 replies
35/63hw/char/serial: clamp zero baud rate to defaulthw/char/serial.c+3 -00 replies
36/63hw/char/sh_serial: fix RDF flag clear on FIFO resethw/char/sh_serial.c+1 -11 reply
37/63hw/char/sh_serial: use rx_cnt for available FIFO spacehw/char/sh_serial.c+1 -11 reply
38/63hw/char/sh_serial: fix break detection flaghw/char/sh_serial.c+1 -11 reply
39/63hw/char/terminal3270: fix output buffer size for IAC-escaped headerhw/char/terminal3270.c+2 -20 replies
40/63hw/char/terminal3270: consume processed input datahw/char/terminal3270.c+3 -00 replies
41/63hw/char/terminal3270: fix pre-handshake outbound data checkhw/char/terminal3270.c+1 -70 replies
42/63hw/char/virtio-serial-bus: validate scatter-gather state in post_loadhw/char/virtio-serial-bus.c+6 -00 replies
43/63hw/display/ramfb: validate guest-supplied stridehw/display/ramfb.c+3 -00 replies
44/63hw/display/ramfb: fix map/unmap region size mismatchhw/display/ramfb.c+5 -20 replies
45/63hw/display/ssd0323: mask SPI data to 8 bitshw/display/ssd0323.c+1 -00 replies
46/63hw/display/ssd0323: fix signed modulo in column/row commandshw/display/ssd0323.c+4 -40 replies
47/63hw/display/xenfb: fix 24-bit pixel read in BLT macrohw/display/xenfb.c+13 -60 replies
48/63hw/input/adb: reject zero-length requestshw/input/adb.c+4 -00 replies
49/63hw/input/adb: validate devaddr on migration loadhw/input/adb.c+11 -00 replies
50/63hw/input/adb: report error when too many devices are registeredhw/input/adb.c+2 -00 replies
51/63hw/input/adb-kbd: validate WRITEREG request buffer lengthhw/input/adb-kbd.c+6 -00 replies
52/63hw/input/adb-kbd: validate ring buffer indices on migration loadhw/input/adb-kbd.c+13 -00 replies
53/63hw/input/adb-kbd: check for errors after parent realizehw/input/adb-kbd.c+6 -00 replies
54/63hw/input/adb-kbd: guard parent_unrealize against NULLhw/input/adb-kbd.c+3 -10 replies
55/63hw/input/adb-mouse: validate WRITEREG request buffer lengthhw/input/adb-mouse.c+3 -00 replies
56/63hw/input/adb-mouse: check for errors after parent realizehw/input/adb-mouse.c+6 -00 replies
57/63hw/input/adb-mouse: add unrealize handler to unregister inputhw/input/adb-mouse.c+14 -00 replies
58/63hw/input/hid: validate queue length and key count on migration loadhw/input/hid.c+7 -00 replies
59/63hw/input/hid: fix off-by-one in pointer queue access on migration loadhw/input/hid.c+1 -10 replies
60/63hw/input/pl050: remove duplicate class_init assignmenthw/input/pl050.c+0 -11 reply
61/63hw/input/stellaris_gamepad: deassert IRQs on resethw/input/stellaris_gamepad.c+3 -00 replies
62/63hw/input/virtio-input: free VirtQueueElement in error unwind pathhw/input/virtio-input.c+1 -00 replies
63/63hw/input/virtio-input: document queue preservation on device resethw/input/virtio-input.c+4 -00 replies

Reviews trailers per patch

10 of 63 patches have a Reviewed-by or Acked-by.

PatchPeter MaydellPhilippe Mathieu-DaudéYoshinori SatoAlistair Francis
1/63
2/63
3/63
4/63
5/63
6/63
7/63
8/63
9/63
10/63
11/63
12/63
13/63
14/63
15/63
16/63
17/63
18/63
19/63
20/63
21/63
22/63
23/63
24/63
25/63
26/63R-b
27/63R-b
28/63R-b
29/63R-b
30/63
31/63R-b
32/63
33/63R-b
34/63
35/63
36/63R-b
37/63R-b
38/63R-b
39/63
40/63
41/63
42/63
43/63
44/63
45/63
46/63
47/63
48/63
49/63
50/63
51/63
52/63
53/63
54/63
55/63
56/63
57/63
58/63
59/63
60/63R-b
61/63
62/63
63/63

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v1 thread

Cover letter [PATCH 00/63] Various audio, chardev, ui and hw fixes

Hi

This series addresses a collection of bugs reported by Pavee Hui at
https://gitlab.com/qemu-project/qemu/-/work_items/4560, most likley with AI assitance. None of them should deserve a confidential level, imho.

I reviewed each reported issue against the code, and wrote individual fixes, using Claude as a review assistant. Several reported issues were dropped after review as incorrect or already addressed upstream. The remaining fixes were split into bisectable commits.

---
Marc-André Lureau (63):
audio/ossaudio: fix ioctl passing address-of-pointer instead of pointer audio/dbusaudio: fix off-by-one in volume channel assertion audio/ossaudio: fix off-by-one in mmap buffer size assertion audio/paaudio: fix server string in PAConnection audio/paaudio: avoid pidfile path truncation
audio/pwaudio: fix capture buffer leak on early return paths audio/pwaudio: clamp overrun writes to remaining ring buffer space audio/pwaudio: fix integer underflow in qpw_read() audio/pwaudio: handle negative avail in qpw_write and qpw_buffer_get_free audio/pwaudio: bail out on underrun in qpw_write audio/audio-mixeng-be: add upper bounds to audio settings validation audio/wavcapture: prevent freq overflow and corrupted WAV header ui/clipboard: clean up vm change state handler on last peer unregister ui/console: skip empty update regions in qemu_console_update ui/console: use QLIST_FOREACH_SAFE in dpy_refresh
ui/input: fix integer overflow in qemu_input_scale_axis ui/vnc-enc-zrle: propagate zrle_compress_data error ui/vnc-jobs: assert rect coordinates and dimensions in vnc_job_add_rect chardev/char-pty: free pty_name in finalize chardev/char-ringbuf: reject zero size with is_power_of_2 chardev/char-ringbuf: use actual read length in qmp_ringbuf_read chardev/char-udp: clarify read_poll return value with pending data chardev/char: fix use-after-free on mux creation failure hw/audio/gusemu_mixer: fix integer overflow in volume ramping hw/audio/gusemu_mixer: use unsigned literal for IRQ bit shifts hw/char/cadence_uart: fix RX FIFO overflow handling hw/char/cadence_uart: use correct interrupt for TX FIFO overflow hw/char/cadence_uart: validate FIFO indices in post_load hw/char/cadence_uart: fix post_load return value for invalid baud rate hw/char/escc: validate channel register index in post_load hw/char/exynos4210_uart: fix baud rate calculation operator precedence hw/char/exynos4210_uart: enforce 32-bit MMIO access size hw/char/ibex_uart: prevent division by zero on baud rate calculation hw/char/imx_serial: update interrupts after status register writes hw/char/serial: clamp zero baud rate to default hw/char/sh_serial: fix RDF flag clear on FIFO reset hw/char/sh_serial: use rx_cnt for available FIFO space hw/char/sh_serial: fix break detection flag hw/char/terminal3270: fix output buffer size for IAC-escaped header hw/char/terminal3270: consume processed input data hw/char/terminal3270: fix pre-handshake outbound data check hw/char/virtio-serial-bus: validate scatter-gather state in post_load hw/display/ramfb: validate guest-supplied stride hw/display/ramfb: fix map/unmap region size mismatch hw/display/ssd0323: mask SPI data to 8 bits hw/display/ssd0323: fix signed modulo in column/row commands hw/display/xenfb: fix 24-bit pixel read in BLT macro hw/input/adb: reject zero-length requests
hw/input/adb: validate devaddr on migration load hw/input/adb: report error when too many devices are registered hw/input/adb-kbd: validate WRITEREG request buffer length hw/input/adb-kbd: validate ring buffer indices on migration load hw/input/adb-kbd: check for errors after parent realize hw/input/adb-kbd: guard parent_unrealize against NULL hw/input/adb-mouse: validate WRITEREG request buffer length hw/input/adb-mouse: check for errors after parent realize hw/input/adb-mouse: add unrealize handler to unregister input hw/input/hid: validate queue length and key count on migration load hw/input/hid: fix off-by-one in pointer queue access on migration load hw/input/pl050: remove duplicate class_init assignment hw/input/stellaris_gamepad: deassert IRQs on reset hw/input/virtio-input: free VirtQueueElement in error unwind path hw/input/virtio-input: document queue preservation on device reset

 audio/audio-mixeng-be.c      |  4 ++--
 audio/dbusaudio.c            |  4 ++--
 audio/ossaudio.c             |  4 ++--
 audio/paaudio.c              |  6 ++++--
 audio/pwaudio.c              | 22 ++++++++++++++++++++--
 audio/wavcapture.c           |  6 ++++++
 chardev/char-pty.c           |  1 +
 chardev/char-ringbuf.c       | 10 ++++++----
 chardev/char-udp.c           |  4 ++++
 chardev/char.c               |  1 +
 hw/audio/gusemu_mixer.c      | 16 +++++++++-------
 hw/char/cadence_uart.c       | 26 ++++++++++++++++----------
 hw/char/escc.c               | 11 +++++++++++
 hw/char/exynos4210_uart.c    |  6 +++++-
 hw/char/ibex_uart.c          |  8 ++++++--
 hw/char/imx_serial.c         |  3 +++
 hw/char/serial.c             |  3 +++
 hw/char/sh_serial.c          |  6 +++---
 hw/char/terminal3270.c       | 15 ++++++---------
 hw/char/virtio-serial-bus.c  |  6 ++++++
 hw/display/ramfb.c           | 10 ++++++++--
 hw/display/ssd0323.c         |  9 +++++----
 hw/display/xenfb.c           | 19 +++++++++++++------
 hw/input/adb-kbd.c           | 29 ++++++++++++++++++++++++++++-
 hw/input/adb-mouse.c         | 23 +++++++++++++++++++++++
 hw/input/adb.c               | 17 +++++++++++++++++
 hw/input/hid.c               |  9 ++++++++-
 hw/input/pl050.c             |  1 -
 hw/input/stellaris_gamepad.c |  3 +++
 hw/input/virtio-input.c      |  5 +++++
 ui/clipboard.c               |  4 ++++
 ui/console.c                 |  7 +++++--
 ui/input.c                   |  8 +++++++-
 ui/vnc-enc-zrle.c            | 19 ++++++++++++++-----
 ui/vnc-jobs.c                |  1 +
 35 files changed, 257 insertions(+), 69 deletions(-)

---
base-commit: 2a0ac9c8ac2d303ca515dc819043409aef18cab5
change-id: 20261002-issue-4560-a704c9fc737f

Best regards,

Signature · 1 line
Marc-André Lureau <[email protected]>