From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:48431) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TM4Aa-00079p-4u for qemu-devel@nongnu.org; Wed, 10 Oct 2012 17:50:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TM4AY-0006Zl-V3 for qemu-devel@nongnu.org; Wed, 10 Oct 2012 17:50:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:61455) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TM4AY-0006Yh-Ks for qemu-devel@nongnu.org; Wed, 10 Oct 2012 17:50:22 -0400 Message-ID: <5075ED80.3050202@redhat.com> Date: Wed, 10 Oct 2012 15:49:52 -0600 From: Eric Blake MIME-Version: 1.0 References: <1349878805-16352-1-git-send-email-coreyb@linux.vnet.ibm.com> <1349878805-16352-2-git-send-email-coreyb@linux.vnet.ibm.com> In-Reply-To: <1349878805-16352-2-git-send-email-coreyb@linux.vnet.ibm.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig3BAE172FAA2D18689CE2D2EE" Subject: Re: [Qemu-devel] [PATCH v2 1/3] monitor: Allow add-fd to any specified fd set List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Corey Bryant Cc: kwolf@redhat.com, libvir-list@redhat.com, qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig3BAE172FAA2D18689CE2D2EE Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 10/10/2012 08:20 AM, Corey Bryant wrote: > The first call to add an fd to an fd set was previously not > allowed to choose the fd set ID. The ID was generated as > the first available and ensuing calls could add more fds by > specifying the fd set ID. This change allows users to > choose the fd set ID on the first call. Unfortunately, it now allows the user to choose arbitrary integer set ids with large gaps, where previously, the user could only influence set ids by populating all intermediate ids. That is, before this patch, a user would have to create 1000000 sets to have an id of 1000000 (if they didn't run out of memory first on all the earlier sets), but now they can have an id that large with just one set. Or, taken further, previously, a user request of -9223372036854775808 would likely fail (if not, how beefy is your machine?), but now it can succeed and cause confusion because of integer wraparound. Arbitrary set ids is not necessarily bad, but I think you need to add bounds-checking on the user's requested fdset_id to make sure it is positive. --=20 Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enig3BAE172FAA2D18689CE2D2EE 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.12 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://www.enigmail.net/ iQEcBAEBCAAGBQJQde2AAAoJEKeha0olJ0NqajcH/RhHyEhWmegUvYPJfl6olJCE mmgpmzOkCn5ee6a2aWLPojZ2ls14zDgFkijqT1TWNtzq9LY9gJdCjtzdGB5A4Kye howligPYygjeNddzl9PnN54ofBu9qWwh2TKhTrMyeupRMu1PHaQDiyxkFYRhutz5 n6QCYc1yJBvDg/V2fxKF2VAx3lNbaYqydgzEuYcCKTYwdhs/Jm1DXm8EaZBppHq6 W4WGExu3q29luBstvQhRqydqdbIB3B1vdBG460ClV9ktv6jDphS+WCQtMP4wa9EA D6Q1J/wn5oe6AvH7zY8OsRITvCRh3RwYGe61IxE0v0DB4wAneph0WVhTx8qw10E= =t7aE -----END PGP SIGNATURE----- --------------enig3BAE172FAA2D18689CE2D2EE--