Skip to content

ui: avoid dynamic stack allocations

Peter Maydell qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3ui/spice-display: Avoid dynamic stack allocationui/spice-display.c+2 -11 reply
2/3ui/vnc-enc-hextile: Use static rather than dynamic length stack arrayui/vnc-enc-hextile-template.h+7 -12 replies
3/3ui/vnc-enc-tight: Avoid dynamic stack allocationui/vnc-enc-tight.c+6 -51 reply

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchPhilippe Mathieu-DaudéFrancisco Iglesias
1/3R-b
2/3R-b
3/3R-b

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

Read the v1 thread

Cover letter [PATCH 0/3] ui: avoid dynamic stack allocations

The codebase has very few VLAs, and if we can get rid of them all we can make the compiler error on new additions. This is a defensive measure against security bugs where an on-stack dynamic allocation isn't correctly size-checked (e.g. CVE-2021-3527).

This patchset fixes some places in the spice and vnc UI frontends that were doing on-stack allocations. For the vnc-enc-hextile case we can make the array fixed size; for the other two places we switch to a heap allocation.

Disclaimer: tested only with compile + make check, which doesn't actually exercise the UI frontends.

thanks
-- PMM

Peter Maydell (2):
ui/spice-display: Avoid dynamic stack allocation ui/vnc-enc-hextile: Use static rather than dynamic length stack array

Philippe Mathieu-Daudé (1):
ui/vnc-enc-tight: Avoid dynamic stack allocation

 ui/vnc-enc-hextile-template.h |  8 +++++++-
 ui/spice-display.c            |  3 ++-
 ui/vnc-enc-tight.c            | 11 ++++++-----
 3 files changed, 15 insertions(+), 7 deletions(-)
Signature · 1 line
2.34.1