qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] ui: avoid dynamic stack allocations
@ 2023-08-18 15:10 Peter Maydell
  2023-08-18 15:10 ` [PATCH 1/3] ui/spice-display: Avoid dynamic stack allocation Peter Maydell
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Peter Maydell @ 2023-08-18 15:10 UTC (permalink / raw)
  To: qemu-devel
  Cc: Gerd Hoffmann, Marc-André Lureau,
	Philippe Mathieu-Daudé

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(-)

-- 
2.34.1



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-08-21  7:59 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-18 15:10 [PATCH 0/3] ui: avoid dynamic stack allocations Peter Maydell
2023-08-18 15:10 ` [PATCH 1/3] ui/spice-display: Avoid dynamic stack allocation Peter Maydell
2023-08-18 16:13   ` Philippe Mathieu-Daudé
2023-08-18 15:10 ` [PATCH 2/3] ui/vnc-enc-hextile: Use static rather than dynamic length stack array Peter Maydell
2023-08-18 16:16   ` Philippe Mathieu-Daudé
2023-08-21  7:59   ` Marc-André Lureau
2023-08-18 15:10 ` [PATCH 3/3] ui/vnc-enc-tight: Avoid dynamic stack allocation Peter Maydell
2023-08-21  7:26   ` Francisco Iglesias

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).