Re: [PATCH 3/3] meson: Enable -Wvla

2024-02-22 Thread Clément Chigot
On Wed, Feb 21, 2024 at 6:27 PM Philippe Mathieu-Daudé wrote: > > On 21/2/24 17:59, Thomas Huth wrote: > > On 21/02/2024 17.26, Thomas Huth wrote: > >> From: Peter Maydell > >> > >> QEMU has historically used variable length arrays only very rarely. > >> Variable length arrays are a potential sec

Re: [PATCH 3/3] meson: Enable -Wvla

2024-02-21 Thread Thomas Huth
On 21/02/2024 17.59, Thomas Huth wrote: On 21/02/2024 17.26, Thomas Huth wrote: From: Peter Maydell QEMU has historically used variable length arrays only very rarely. Variable length arrays are a potential security issue where an on-stack dynamic allocation isn't correctly size-checked, espec

Re: [PATCH 3/3] meson: Enable -Wvla

2024-02-21 Thread Philippe Mathieu-Daudé
On 21/2/24 18:27, Philippe Mathieu-Daudé wrote: Clément, ResetData::entry isn't used, so we can simplify removing the whole ResetData structure, but I'm not sure this is intended: -- >8 -- diff --git a/hw/sparc/leon3.c b/hw/sparc/leon3.c index 4873b59b6c..1ff6b5d63d 100644 --- a/hw/sparc/leon3.

Re: [PATCH 3/3] meson: Enable -Wvla

2024-02-21 Thread Philippe Mathieu-Daudé
On 21/2/24 17:59, Thomas Huth wrote: On 21/02/2024 17.26, Thomas Huth wrote: From: Peter Maydell QEMU has historically used variable length arrays only very rarely. Variable length arrays are a potential security issue where an on-stack dynamic allocation isn't correctly size-checked, especial

Re: [PATCH 3/3] meson: Enable -Wvla

2024-02-21 Thread Thomas Huth
On 21/02/2024 17.26, Thomas Huth wrote: From: Peter Maydell QEMU has historically used variable length arrays only very rarely. Variable length arrays are a potential security issue where an on-stack dynamic allocation isn't correctly size-checked, especially when the size comes from the guest.

[PATCH 3/3] meson: Enable -Wvla

2024-02-21 Thread Thomas Huth
From: Peter Maydell QEMU has historically used variable length arrays only very rarely. Variable length arrays are a potential security issue where an on-stack dynamic allocation isn't correctly size-checked, especially when the size comes from the guest. (An example problem of this kind from th