[libvirt] [PATCH] command: avoid deadlock on EPIPE situation

Eric Blake eblake at redhat.com
Mon Jun 4 21:49:31 UTC 2012


On 06/02/2012 02:12 AM, Michal Privoznik wrote:
> On 01.06.2012 17:41, Eric Blake wrote:
>> It is possible to deadlock libvirt by having a domain with XML
>> longer than PIPE_BUF, and by writing a hook script that closes
>> stdin early.  This is because libvirt was keeping a copy of the
>> child's stdin read fd open, which means the write fd in the
>> parent will never see EPIPE (remember, libvirt should always be
>> run with SIGPIPE ignored, so we should never get a SIGPIPE signal).
>> Since there is no error, libvirt blocks waiting for a write to
>> complete, even though the only reader is also libvirt.  The
>> solution is to ensure that only the child can act as a reader
>> before the parent does any writes; and then dealing with the
>> fallout of dealing with EPIPE.
>>

> 
> So we have now covered this case in tests. Awesome.
> 
> ACK

Thanks; pushed.

-- 
Eric Blake   eblake at redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 620 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120604/1b594a70/attachment-0001.sig>


More information about the libvir-list mailing list