qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [PULL 07/11] meson: Enable -Wvla
Date: Fri, 23 Feb 2024 20:09:59 +0100	[thread overview]
Message-ID: <20240223191003.6268-8-thuth@redhat.com> (raw)
In-Reply-To: <20240223191003.6268-1-thuth@redhat.com>

From: Peter Maydell <peter.maydell@linaro.org>

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 the past is CVE-2021-3527).  Forbidding them entirely is a
defensive measure against further bugs of this kind.

Enable -Wvla to prevent any new uses from sneaking into the codebase.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-ID: <20240125173211.1786196-3-peter.maydell@linaro.org>
[thuth: rebased to current master branch]
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20240221162636.173136-4-thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 meson.build | 1 +
 1 file changed, 1 insertion(+)

diff --git a/meson.build b/meson.build
index c1dc83e4c0..0ef1654e86 100644
--- a/meson.build
+++ b/meson.build
@@ -592,6 +592,7 @@ warn_flags = [
   '-Wstrict-prototypes',
   '-Wtype-limits',
   '-Wundef',
+  '-Wvla',
   '-Wwrite-strings',
 
   # Then disable some undesirable warnings
-- 
2.43.2



  parent reply	other threads:[~2024-02-23 19:59 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-23 19:09 [PULL 00/11] Test and misc patches Thomas Huth
2024-02-23 19:09 ` [PULL 01/11] target/m68k: Fix exception frame format for 68010 Thomas Huth
2024-02-23 19:09 ` [PULL 02/11] tests/cdrom-test: Add cdrom test for LoongArch virt machine Thomas Huth
2024-02-23 19:09 ` [PULL 03/11] tests/qtest: Fix boot-serial-test when using --without-default-devices Thomas Huth
2024-02-23 19:09 ` [PULL 04/11] tests: skip dbus-display tests that need a console Thomas Huth
2024-02-23 19:09 ` [PULL 05/11] target/ppc/kvm: Replace variable length array in kvmppc_save_htab() Thomas Huth
2024-02-23 19:09 ` [PULL 06/11] target/ppc/kvm: Replace variable length array in kvmppc_read_hptes() Thomas Huth
2024-02-23 19:09 ` Thomas Huth [this message]
2024-02-23 19:10 ` [PULL 08/11] docs: Document that 32-bit Windows is unsupported Thomas Huth
2024-02-23 19:10 ` [PULL 09/11] .gitlab-ci.d: Drop cross-win32-system job Thomas Huth
2024-02-23 19:10 ` [PULL 10/11] .gitlab-ci.d/windows.yml: Remove shared-msys2 abstraction Thomas Huth
2024-02-23 19:10 ` [PULL 11/11] target/i386: do not filter processor tracing features except on KVM Thomas Huth
2024-02-25 11:52 ` [PULL 00/11] Test and misc patches Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240223191003.6268-8-thuth@redhat.com \
    --to=thuth@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).