From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Moritz Haase <Moritz.Haase@bmw.de>,
qemu-devel@nongnu.org, petrosagg@resin.io, nghiant2710@gmail.com,
forumi0721@gmail.com, laurent@vivier.eu
Subject: Re: [PATCH] linux-user: add option to intercept execve() syscalls
Date: Tue, 25 Nov 2025 13:23:19 +0000 [thread overview]
Message-ID: <aSWtx_eqAXecxAYX@redhat.com> (raw)
In-Reply-To: <CAFEAcA9M4jpWnUuPuz8AxnSuPn2go3yL5eKBdzNd6UawXTaD8Q@mail.gmail.com>
On Tue, Nov 25, 2025 at 01:14:23PM +0000, Peter Maydell wrote:
> On Tue, 25 Nov 2025 at 12:20, Daniel P. Berrangé <berrange@redhat.com> wrote:
> >
> > On Tue, Nov 25, 2025 at 11:38:59AM +0100, Moritz Haase wrote:
> > > + if (i_arg) {
> > > + new_argv = g_alloca(sizeof(void *));
> > > + new_argv[0] = i_arg;
> >
> > FYI, use of g_alloca() is no longer permitted in QEMU code.
> >
> > I thought we blocked that with -Walloca, but it seems we do not.
> > We ought to fix that gap.
>
> We don't because we haven't yet eradicated all existing uses
> of alloca type functions. We did that for the system emulation
> code, but didn't find a way to add the -Walloca warning only
> for the non-linux-user code:
>
> https://lore.kernel.org/qemu-devel/20250901132626.28639-1-philmd@linaro.org/
>
> There are still a handful of alloca() calls in linux-user/
> and bsd-user/ which ideally we would convert but which haven't
> been very high priority to clean up (because a linux user
> guest can scribble all over QEMU memory anyway if it likes,
> so being able to overrun the stack by passing a large value
> into an alloca size doesn't let it do anything it couldn't
> do by other means).
I think we can fix that with a pragma. eg Add -Walloca to meson.build
for everything, then add _Pragma("GCC diagnostic ignored -Walloca") to
only linux-user/syscall.c and bsd-user/os-syscall.c files.
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
next prev parent reply other threads:[~2025-11-25 13:24 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-25 10:38 [PATCH] linux-user: add option to intercept execve() syscalls Moritz Haase
2025-11-25 11:17 ` Michael Tokarev
2025-11-25 12:19 ` Daniel P. Berrangé
2025-11-25 13:14 ` Peter Maydell
2025-11-25 13:23 ` Daniel P. Berrangé [this message]
2025-11-25 14:33 ` Haase Moritz, JD-61
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=aSWtx_eqAXecxAYX@redhat.com \
--to=berrange@redhat.com \
--cc=Moritz.Haase@bmw.de \
--cc=forumi0721@gmail.com \
--cc=laurent@vivier.eu \
--cc=nghiant2710@gmail.com \
--cc=peter.maydell@linaro.org \
--cc=petrosagg@resin.io \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.