From: Stefan Hajnoczi <stefanha@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>,
Igor Mammedov <imammedo@redhat.com>,
Ani Sinha <anisinha@redhat.com>
Cc: Daan De Meyer <daan.j.demeyer@gmail.com>,
qemu-devel@nongnu.org, Thomas Huth <thuth@redhat.com>
Subject: Re: [PATCH] smbios: Fix buffer overrun when using path= option
Date: Tue, 8 Apr 2025 10:13:09 -0400 [thread overview]
Message-ID: <20250408141309.GA549046@fedora> (raw)
In-Reply-To: <c82ea7ec-7f53-4113-a4ee-95d215522d4d@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1443 bytes --]
On Mon, Mar 24, 2025 at 07:24:59AM +0100, Thomas Huth wrote:
> On 23/03/2025 22.35, Daan De Meyer wrote:
> > We have to make sure the array of bytes read from the path= file
> > is null-terminated, otherwise we run into a buffer overrun later on.
> >
> > Fixes: bb99f4772f54017490e3356ecbb3df25c5d4537f ("hw/smbios: support loading OEM strings values from a file")
> > Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2879
> >
> > Signed-off-by: Daan De Meyer <daan.j.demeyer@gmail.com>
> > ---
> > hw/smbios/smbios.c | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/hw/smbios/smbios.c b/hw/smbios/smbios.c
> > index 02a09eb9cd..ad4cd6721e 100644
> > --- a/hw/smbios/smbios.c
> > +++ b/hw/smbios/smbios.c
> > @@ -1285,6 +1285,9 @@ static int save_opt_one(void *opaque,
> > g_byte_array_append(data, (guint8 *)buf, ret);
> > }
> > + buf[0] = '\0';
> > + g_byte_array_append(data, (guint8 *)buf, 1);
> > +
> > qemu_close(fd);
> > *opt->dest = g_renew(char *, *opt->dest, (*opt->ndest) + 1);
>
> Please make sure to put the maintainers on CC: (done now, for the next time
> please see the MAINTAINERS file or use the scripts/get_maintainers.pl
> script), otherwise your patch might go unnoticed.
Michael, Igor, Ani: This patch is needed for QEMU 10.0. You are the
maintainers, please review this patch.
Thanks!
Stefan
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2025-04-08 14:14 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-23 21:35 [PATCH] smbios: Fix buffer overrun when using path= option Daan De Meyer
2025-03-24 6:24 ` Thomas Huth
2025-04-08 14:13 ` Stefan Hajnoczi [this message]
2025-03-24 9:12 ` Daniel P. Berrangé
2025-03-24 13:22 ` Daniel P. Berrangé
2025-03-31 22:18 ` Philippe Mathieu-Daudé
2025-04-03 19:29 ` Daan De Meyer
2025-04-03 19:37 ` Philippe Mathieu-Daudé
2025-04-04 14:46 ` Valentin David
2025-04-04 15:02 ` Philippe Mathieu-Daudé
2025-04-04 15:06 ` Valentin David
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=20250408141309.GA549046@fedora \
--to=stefanha@redhat.com \
--cc=anisinha@redhat.com \
--cc=daan.j.demeyer@gmail.com \
--cc=imammedo@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=thuth@redhat.com \
/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.