From: Eric Blake Subject: Re: [libvirt] [PATCH libvirt] libxl: avoid freeing an uninitialised bitmap Date: Fri, 19 Jun 2015 10:54:53 -0600 Message-ID: <5584495D.9020402__39784.0629601434$1434733030$gmane$org@redhat.com> References: <1434731610-25257-1-git-send-email-ian.campbell@citrix.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2011892532296333316==" Return-path: In-Reply-To: <1434731610-25257-1-git-send-email-ian.campbell@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell , Jim Fehlig Cc: libvir-list@redhat.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --===============2011892532296333316== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="WpWHjGEis1vp70BJPvKFs9Daaf3kmjtea" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --WpWHjGEis1vp70BJPvKFs9Daaf3kmjtea Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 06/19/2015 10:33 AM, Ian Campbell wrote: > If vm->def->cputune.nvcpupin is 0 in libxlDomainSetVcpuAffinities (as > seems to be the case on arm) then the VIR_FREE after cleanup: would be > operating on an uninitialised pointer in map.map. >=20 > Fix this by using libxl_bitmap_init and libxl_bitmap_dispose in the > appropriate places (like VIR_FREE libxl_bitmap_dispose is also s/VIR_FREE/VIR_FREE,/ > idempotent, so there is no double free on exit from the loop). >=20 > libxl_bitmap_dispose is slightly preferable since it also sets > map.size back to 0, avoiding a potential source of confusion. >=20 > This fixes the crashes we've been seeing in the Xen automated tests on > ARM. >=20 > I had a glance at the handful of other users of libxl_bitmap and none > of them looked to have a similar issue. >=20 > Signed-off-by: Ian Campbell > --- > src/libxl/libxl_domain.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) ACK. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --WpWHjGEis1vp70BJPvKFs9Daaf3kmjtea Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJVhEldAAoJEKeha0olJ0NqdRoH/A+MjxwMQL9x7BbAUP9xj6sq 2fDfFub1xRnot+MwK1Mebu7pg+bfGYKXic7mKuefkRglwDA135G5EM7crpN0xc2v W17UXAJBARDmO14hLdf2oB2ZhjhGXTgFbu1genJpuVd1SzRV/mK41vZoZenTTJhG JuoK8OiI3o1/UnHt426BCRJ8FIXgcknyau1Iuowep1pE84KaQX+ryGtqeVhoX98+ YmpecWwi/b5Frh9+4HQQyh5IlhaYBSzO+J95sMkT7Pehq/mfQ760XXlyg44Nrve3 OThT5A5g+4hXMtXwRYMWSvc2q5m2G19IQrwvLhv5i7i2ApjXb//AfrI6WJWUnDc= =07oG -----END PGP SIGNATURE----- --WpWHjGEis1vp70BJPvKFs9Daaf3kmjtea-- --===============2011892532296333316== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --===============2011892532296333316==--