From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58948) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bpSGJ-0004Q2-UK for qemu-devel@nongnu.org; Wed, 28 Sep 2016 23:43:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bpSGE-0003X3-1J for qemu-devel@nongnu.org; Wed, 28 Sep 2016 23:43:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47568) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bpSGD-0003Wp-RO for qemu-devel@nongnu.org; Wed, 28 Sep 2016 23:43:49 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 25B7A4ACAF for ; Thu, 29 Sep 2016 03:43:49 +0000 (UTC) Date: Thu, 29 Sep 2016 11:43:46 +0800 From: Fam Zheng Message-ID: <20160929034346.GG6412@lemon> References: <20160928143810.25558-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] smbios: fix uuid copy List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laszlo Ersek Cc: =?iso-8859-1?Q?Marc-Andr=E9?= Lureau , qemu-devel@nongnu.org, imammedo@redhat.com, mst@redhat.com On Wed, 09/28 17:17, Laszlo Ersek wrote: > On 09/28/16 16:38, Marc-Andr=E9 Lureau wrote: > > Since 9c5ce8db, the uuid is wrongly copied, as QemuUUID 'in' argument= is > > already a pointer. > >=20 > > Fixes ASAN complaining: > > hw/smbios/smbios.c:489:5: runtime error: load of address 0x7fffcdb91b= 00 with insufficient space for an object of type '__int128 unsigned' > >=20 > > Signed-off-by: Marc-Andr=E9 Lureau > > --- > > hw/smbios/smbios.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > >=20 > > 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 *i= n) > > { > > - memcpy(uuid, &in, 16); > > + memcpy(uuid, in, 16); > > if (smbios_uuid_encoded) { > > uuid->time_low =3D bswap32(uuid->time_low); > > uuid->time_mid =3D bswap16(uuid->time_mid); > >=20 >=20 > Reviewed-by: Laszlo Ersek >=20 > Also, I think the "QemuUUID.fields" structure should be decorated with > QEMU_PACKED, for documentation purposes if nothing else. (Separate > question / patch, of course.) >=20 > Thanks > Laszlo Wrapped the long line in commit message and queued for next pull request, thanks! Fam