Skip to content

hw/display/ati: fix HOST_DATA accumulator overflow and bpp==0 crashes

Junjie Cao qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest2 patches 4 repliesIn review

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2hw/display/ati: reset host_data.next in write handler after flushhw/display/ati.c hw/display/ati_2d.c+2 -11 reply
2/2hw/display/ati: guard against zero bpp in ati_host_data_flushhw/display/ati_2d.c+5 -01 reply

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchChad Jablonski
SeriesR-b
1/2R-b
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/2] hw/display/ati: fix HOST_DATA accumulator overflow and bpp==0 crashes

Two guest-triggerable crashes in the ati-vga HOST_DATA blit path, independently found via fuzzing (generic-fuzz with ASan/UBSan).

Patch 1 fixes the heap-buffer-overflow: when ati_host_data_flush() returns early, host_data.next was not reset, causing subsequent HOST_DATA writes to index past acc[3]. The fix moves the reset into the write handler as suggested by Chad Jablonski in the v1 discussion.

Patch 2 fixes division-by-zero (SIGFPE) and g_assert_not_reached() when ati_bpp_from_datatype() returns 0 for invalid dp_datatype values.

Based on Feifan Qian's v1 report and the subsequent design discussion between BALATON Zoltan and Chad Jablonski.

v1: https://lore.kernel.org/qemu-devel/Czyl6yVfL6sHl_o1kRk8N_LpwXMMRVhO9vgz1qCVJFagn9D4nHSKuiux39iOLty0Q3acxQq_FeovPhTQvSKus2htwjI9lTajLZmqovr0Wxs=@proton.me/

Junjie Cao (2):
hw/display/ati: reset host_data.next in write handler after flush hw/display/ati: guard against zero bpp in ati_host_data_flush

 hw/display/ati.c    | 2 ++
 hw/display/ati_2d.c | 6 +++++-
 2 files changed, 7 insertions(+), 1 deletion(-)
Signature · 1 line
2.43.0