[libvirt] [PATCH 1/4] rpc: Don't leak fd via CreateXMLWithFiles

Cole Robinson crobinso at redhat.com
Fri Apr 29 10:47:26 UTC 2016


On 04/28/2016 02:55 AM, Pavel Hrdina wrote:
> On Wed, Apr 27, 2016 at 06:33:58PM -0400, Cole Robinson wrote:
>> From: Ben Gray <ben.r.gray at gmail.com>
>>
>> FD passing APIs like CreateXMLWithFiles or OpenGraphicsFD will leak
>> file descriptors. The user passes in an fd, which is dup()'d in
>> virNetClientProgramCall. The new fd is what is transfered to the
>> server virNetClientIOWriteMessage.
>>
>> Once all the fds have been written though, the parent msg->fds list
>> is immediately free'd, so the individual fds are never closed.
>>
>> This closes each FD as its send to the server, so all fds have been
>> closed by the time msg->fds is free'd.
>>
>> https://bugzilla.redhat.com/show_bug.cgi?id=1159766
>> ---
> 
> ACK and safe for release.  Sorry for the noise with previous patch.  I've
> reviewed the code closely and we are leaking the FD for the client side.
> 

No worries, pushed now

- Cole




More information about the libvir-list mailing list