qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] nvme: avoid dynamic stack allocations
@ 2023-08-11 17:47 Peter Maydell
  2023-08-11 17:47 ` [PATCH 1/2] hw/nvme: Use #define to avoid variable length array Peter Maydell
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Peter Maydell @ 2023-08-11 17:47 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-block, Philippe Mathieu-Daudé, Keith Busch,
	Klaus Jensen

The QEMU codebase has very few C variable length arrays, 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).

We last had a go at this a few years ago, when Philippe wrote
patches for this:
https://patchew.org/QEMU/20210505211047.1496765-1-philmd@redhat.com/
Some of the fixes made it into the tree, but some didn't (either
because of lack of review or because review found some changes
that needed to be made). I'm going through the remainder as a
non-urgent Friday afternoon task...

This patchset deals with two VLAs in the NVME code.

thanks
-- PMM

Peter Maydell (1):
  hw/nvme: Avoid dynamic stack allocation

Philippe Mathieu-Daudé (1):
  hw/nvme: Use #define to avoid variable length array

 hw/nvme/ctrl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

-- 
2.34.1



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

end of thread, other threads:[~2023-09-12 14:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-11 17:47 [PATCH 0/2] nvme: avoid dynamic stack allocations Peter Maydell
2023-08-11 17:47 ` [PATCH 1/2] hw/nvme: Use #define to avoid variable length array Peter Maydell
2023-08-11 17:47 ` [PATCH 2/2] hw/nvme: Avoid dynamic stack allocation Peter Maydell
2023-08-14  7:09 ` [PATCH 0/2] nvme: avoid dynamic stack allocations Klaus Jensen
2023-09-12 14:15   ` Peter Maydell
2023-09-12 14:19     ` Klaus Jensen
2023-08-16  9:47 ` Philippe Mathieu-Daudé

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