From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:56189) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvWiK-0007az-B8 for qemu-devel@nongnu.org; Wed, 16 Jan 2013 12:23:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TvWiI-0006an-E2 for qemu-devel@nongnu.org; Wed, 16 Jan 2013 12:23:48 -0500 Received: from mx1.redhat.com ([209.132.183.28]:14680) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvWiI-0006ad-5U for qemu-devel@nongnu.org; Wed, 16 Jan 2013 12:23:46 -0500 Message-ID: <50F6E21E.2050801@redhat.com> Date: Wed, 16 Jan 2013 10:23:42 -0700 From: Eric Blake MIME-Version: 1.0 References: <1358349851-20960-1-git-send-email-ehabkost@redhat.com> <1358349851-20960-6-git-send-email-ehabkost@redhat.com> In-Reply-To: <1358349851-20960-6-git-send-email-ehabkost@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2NAQDMDNBMCIGOBIQWNHS" Subject: Re: [Qemu-devel] [PATCH 5/8] vl.c: numa_add(): Validate nodeid before using it List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost Cc: Chegu Vinod , qemu-devel@nongnu.org, Anthony Liguori This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2NAQDMDNBMCIGOBIQWNHS Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 01/16/2013 08:24 AM, Eduardo Habkost wrote: > Without this check, QEMU will corrupt memory if a too-large nodeid is > provided in the command-line. e.g.: >=20 > -numa node,mem=3D...,cpus=3D...,nodeid=3D65 >=20 > This changes nodenr to unsigned long long, to avoid integer conversion > issues when converting the strtoull() result to int. >=20 > Signed-off-by: Eduardo Habkost > --- > Changes v2: > - Implement change without creation of numa_node_add() function > =20 > + if (nodenr >=3D MAX_NODES) { > + fprintf(stderr, "qemu: invalid NUMA nodeid: %d\n", nodenr)= ; %lld (I see you later fixed that in 6/8, but you should rebase that hunk into the patch that first needs it). --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org ------enig2NAQDMDNBMCIGOBIQWNHS Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJQ9uIeAAoJEKeha0olJ0NqgKIH/intAvDC3KGwKPsNpc2dYGOz f92p5/KVDwPxTRz1yKqX7Hgnik14cgl3FeDVzDgjPnIfp/WRiVJlwA5YoFUVHjWL 794ywh+5GZP4Jg6g9C7gUbdoELKiuLmExO09ABGIKMOIcbi8NOAMEpS6WlwODyEv citmtKK6kesSPwbJmfXRPF3Uhxmp6X3FK7XsuAx1Xkd2iwbVC5mWpvcrQ9VXAjQM OPqAbxyYND79le5zSUQnqlE2kAwa+Hera5017limrVUCbeg0mfTurELckA3CSvDP JpuzNVBsbN9SbtGFiJUhhvMVEYMuQc2X09RmESTMNQHYvT5ODUpC2tKw7Ljk9hk= =yR5H -----END PGP SIGNATURE----- ------enig2NAQDMDNBMCIGOBIQWNHS--