qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Fam Zheng <famz@redhat.com>
To: Laszlo Ersek <lersek@redhat.com>
Cc: "Marc-André Lureau" <marcandre.lureau@redhat.com>,
	qemu-devel@nongnu.org, imammedo@redhat.com, mst@redhat.com
Subject: Re: [Qemu-devel] [PATCH] smbios: fix uuid copy
Date: Thu, 29 Sep 2016 11:43:46 +0800	[thread overview]
Message-ID: <20160929034346.GG6412@lemon> (raw)
In-Reply-To: <dde144be-4132-adb4-be71-b2c69823366c@redhat.com>

On Wed, 09/28 17:17, Laszlo Ersek wrote:
> On 09/28/16 16:38, Marc-André Lureau wrote:
> > Since 9c5ce8db, the uuid is wrongly copied, as QemuUUID 'in' argument is
> > already a pointer.
> > 
> > Fixes ASAN complaining:
> > hw/smbios/smbios.c:489:5: runtime error: load of address 0x7fffcdb91b00 with insufficient space for an object of type '__int128 unsigned'
> > 
> > Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> > ---
> >  hw/smbios/smbios.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/hw/smbios/smbios.c b/hw/smbios/smbios.c
> > index 9a6552a..3a96ced 100644
> > --- a/hw/smbios/smbios.c
> > +++ b/hw/smbios/smbios.c
> > @@ -486,7 +486,7 @@ static void smbios_build_type_0_table(void)
> >   */
> >  static void smbios_encode_uuid(struct smbios_uuid *uuid, QemuUUID *in)
> >  {
> > -    memcpy(uuid, &in, 16);
> > +    memcpy(uuid, in, 16);
> >      if (smbios_uuid_encoded) {
> >          uuid->time_low = bswap32(uuid->time_low);
> >          uuid->time_mid = bswap16(uuid->time_mid);
> > 
> 
> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
> 
> Also, I think the "QemuUUID.fields" structure should be decorated with
> QEMU_PACKED, for documentation purposes if nothing else. (Separate
> question / patch, of course.)
> 
> Thanks
> Laszlo

Wrapped the long line in commit message and queued for next pull request,
thanks!

Fam

      reply	other threads:[~2016-09-29  3:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-28 14:38 [Qemu-devel] [PATCH] smbios: fix uuid copy Marc-André Lureau
2016-09-28 15:17 ` Laszlo Ersek
2016-09-29  3:43   ` Fam Zheng [this message]

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=20160929034346.GG6412@lemon \
    --to=famz@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=lersek@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=mst@redhat.com \
    --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).