Patch for a memory leak issue in share mode locking.

Volker Lendecke Volker.Lendecke at SerNet.DE
Wed May 25 08:27:04 UTC 2016


On Wed, May 25, 2016 at 06:37:59AM +0000, Hemanth Thummala wrote:
> Hi All,
> 
> We have found a memory leak issue in share mode locking.
> 
> I have created bug and updated my findings.
> https://bugzilla.samba.org/show_bug.cgi?id=11934
> 
> Attached patch resolves the issue for us. Please let me know if this looks good.

This is a great finding, thanks!

However, I don't fully understand why this is not cleaned up in
unparse_share_modes via the share_mode_memcache_delete() call. If I get
the talloc hierarchy right then the data blob is a talloc child of "d",
and sure, the memcache_add_talloc moves "d" to the NULL context.  But the
hierarchy below should stay intact. So the share_mode_memcache_delete
should delete any previous blob via the hierarchy.

Of course we don't need the blob after the store, so your fix is
right. But the real long-term leak must be somewhere else, your fix will
only band-aid the deeper issue.

Volker

-- 
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de, mailto:kontakt at sernet.de

SerNet & BSI laden ein: 29. Juni 2016,
2. IT-Grundschutztag 2016, BPA Berlin.
Anmeldung: https://www.sernet.de/gstag



More information about the samba-technical mailing list