Searched hist:b3c82467 (Results 1 – 1 of 1) sorted by relevance
/openbmc/qemu/hw/nvme/ |
H A D | ctrl.c | b3c82467 Fri Aug 11 12:47:51 CDT 2023 Peter Maydell <peter.maydell@linaro.org> hw/nvme: Avoid dynamic stack allocation
Instead of using a variable-length array in nvme_map_prp(), allocate on the stack with a g_autofree pointer.
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: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
|