summary refs log tree commit diff stats
path: root/docs/devel/secure-coding-practices.rst
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <philmd@redhat.com>2023-08-11 18:52:29 +0100
committerKevin Wolf <kwolf@redhat.com>2023-09-08 17:03:09 +0200
commit3c2c599c79eea9cebd7280140a5901fe3734e94e (patch)
treefb47cc53bace6356f2350d9cd169bbdefe7952f3 /docs/devel/secure-coding-practices.rst
parent13d9f6dca08a38e9258b6328f3ad61bdb8e19619 (diff)
downloadfocaccia-qemu-3c2c599c79eea9cebd7280140a5901fe3734e94e.tar.gz
focaccia-qemu-3c2c599c79eea9cebd7280140a5901fe3734e94e.zip
block/vpc: Avoid dynamic stack allocation
Use autofree heap allocation instead of variable-length array on the
stack. Here we don't expect the bitmap size to be enormous, and
since we're about to read/write it to disk the overhead of the
allocation should be fine.

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

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
[PMM: expanded commit message]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-ID: <20230811175229.808139-1-peter.maydell@linaro.org>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Francisco Iglesias <frasse.iglesias@gmail.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'docs/devel/secure-coding-practices.rst')
0 files changed, 0 insertions, 0 deletions