Re: Is change of coroipcc.c between 1.4.2 and 1.4.5 leaking fd on error path?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dan,
good catch! Also your idea to fix issue is correct.

Can you please create + post patch?

Regards,
  Honza

Dan Clark napsal(a):
> Hi folks!
> 
> Some changes to the client library in 1.4.5 may be missing some cleanup in
> the error path based on the addition of a new dup() for the request_fd.
> 
> In particular coroipcc.c:coroipcc_service_connect() added the following
> around line 608.
> ipc_instance->user_app_fd = dup(request_fd);
> 
> Unforuntately it may be possible under conditions such as a downed corosync
> daemon or a limited memory pool to run any of the error paths associated
> with the routine labeled starting at 'error_exit:' through 'error_connect:'
> and end up only closing request_fd, but not closing off the dup!
> 
> I wonder if the error path could be improved by adding the following around
> line coroipcc.c:789
> 
> error_connect:
>> close(ipc_instance->user_app_fd);
> close(request_fd);
> 
> Additional checks may be required although on cursory inspection the
> user_app_fd should always be valid if request_fd is setup.
> 
> dan
> 
> 
> 
> _______________________________________________
> discuss mailing list
> discuss@xxxxxxxxxxxx
> http://lists.corosync.org/mailman/listinfo/discuss
> 

_______________________________________________
discuss mailing list
discuss@xxxxxxxxxxxx
http://lists.corosync.org/mailman/listinfo/discuss




[Index of Archives]     [Linux Clusters]     [Corosync Project]     [Linux USB Devel]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Linux Kernel]     [Linux SCSI]     [X.Org]

  Powered by Linux