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

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

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.

Thanks; pushed.

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

Attachment: signature.asc
Description: OpenPGP digital signature

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