From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49996) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bpGc1-0003S0-8x for qemu-devel@nongnu.org; Wed, 28 Sep 2016 11:17:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bpGbw-0004in-4y for qemu-devel@nongnu.org; Wed, 28 Sep 2016 11:17:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40098) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bpGbv-0004iN-Ud for qemu-devel@nongnu.org; Wed, 28 Sep 2016 11:17:28 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (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 778498E684 for ; Wed, 28 Sep 2016 15:17:26 +0000 (UTC) References: <20160928143810.25558-1-marcandre.lureau@redhat.com> From: Laszlo Ersek Message-ID: Date: Wed, 28 Sep 2016 17:17:23 +0200 MIME-Version: 1.0 In-Reply-To: <20160928143810.25558-1-marcandre.lureau@redhat.com> Content-Type: text/plain; charset=windows-1252 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: =?UTF-8?Q?Marc-Andr=c3=a9_Lureau?= , qemu-devel@nongnu.org Cc: imammedo@redhat.com, famz@redhat.com, mst@redhat.com On 09/28/16 16:38, Marc-Andr=E9 Lureau wrote: > Since 9c5ce8db, the uuid is wrongly copied, as QemuUUID 'in' argument i= s > already a pointer. >=20 > 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' >=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 *in) > { > - 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 Reviewed-by: Laszlo Ersek 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