From: Gianni Tedesco Subject: Re: [PATCH 0 of 3] libxl: leak in uuid to string conversions Date: Mon, 16 Aug 2010 15:08:44 +0100 Message-ID: <1281967724.18490.373.camel@qabil.uk.xensource.com> References: <19557.25054.889868.859565@mariner.uk.xensource.com> <1281963100.18490.371.camel@qabil.uk.xensource.com> <1281963983.3170.737.camel@zakaz.uk.xensource.com> <1281967302.3170.741.camel@zakaz.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Stefano Stabellini Cc: Ian Campbell , "xen-devel@lists.xensource.com" , Ian Jackson List-Id: xen-devel@lists.xenproject.org On Mon, 2010-08-16 at 15:05 +0100, Stefano Stabellini wrote: > On Mon, 16 Aug 2010, Ian Campbell wrote: > > On Mon, 2010-08-16 at 14:51 +0100, Stefano Stabellini wrote: > > > On Mon, 16 Aug 2010, Ian Campbell wrote: > > > > On Mon, 2010-08-16 at 13:51 +0100, Gianni Tedesco wrote: > > > > > On Fri, 2010-08-13 at 16:16 +0100, Ian Jackson wrote: > > > > > > Ian Campbell writes ("[Xen-devel] [PATCH 0 of 3] libxl: leak in uuid to string conversions"): > > > > > > > Fix a few memory leaks in the functions which convert uuids into > > > > > > > strings. > > > > > > > > > > > > Acked-by: Ian Jackson > > > > > > > > > > > > (all three) > > > > > > > > > > > > Ian. > > > > > > > > > > I'm not sure I agree with this patch, especially 3 of 3. The callers are > > > > > inconsistent and also pointless. There's no need to allocate a uuid > > > > > string when all that's really needed is a few printf macros as in > > > > > "[PATCH,v2] xl: make libxl_uuid2string internal to libxenlight" - Also > > > > > UUID_FMT remains duplicated. > > > > > > > > > > The first two patches are probably fine but then we should just nuke > > > > > libxl_uuid2string all together. Such a function makes sense for libxl > > > > > where it's going to be constructing xenstore paths so may need to keep > > > > > such things around but xl has no use for this as far as I can see. > > > > > > > > FWIW the reason I didn't followup further with this thread (other than > > > > it being a Friday afternoon) was that I agreed with your v2 patch which > > > > added the macros and made the libxl_uuid2string fn internal to the > > > > library. AFAICT your patch also solved all the leaks I was seeing. > > > > > > > > > > I also think Gianni's libuuid series should be applied > > > > I think that's orthogonal to the particular patch we are discussing here > > though, that patch concerns the generation of UUIDs while this one > > concerns leaking strings when formatting them... > > sorry, I meant libuuid2string Well, regarding the libuuid thing, I need to re-write that incorporating Egger's suggestions about portability so it shouldn't be applied as is. My conclusion on the mini-flame-war regarding mac addresses is that that stuff is orthogonal to the part where we actually use a proper random source.