[libvirt] [PATCH] Avoid async signal safety problem in glibc's setxid

Eric Blake eblake at redhat.com
Fri Nov 15 17:37:53 UTC 2013


On 11/15/2013 09:20 AM, Daniel P. Berrange wrote:
> The glibc setxid is supposed to be async signal safe, but
> libc developers confirm that it is not. This causes a problem
> when libvirt_lxc starts the FUSE thread and then runs clone()
> to start the container. If the clone() was done before the
> FUSE thread has completely started up, then the container
> will hang in setxid after clone().
> 
> The fix is to avoid creating any threads until after the
> container has been clone()'d. By avoiding any threads in
> the parent, the child is no longer required to run in an
> async signal safe context, and we thus avoid the glibc
> bug.
> 
> Signed-off-by: Daniel P. Berrange <berrange at redhat.com>
> ---
>  src/lxc/lxc_controller.c | 11 +++++++++--
>  src/lxc/lxc_fuse.c       | 21 +++++++++++++++------
>  src/lxc/lxc_fuse.h       |  1 +
>  3 files changed, 25 insertions(+), 8 deletions(-)

I can review the code, but I'd feel better if this also got field
testing as resolving the problem before you push it.

ACK.

-- 
Eric Blake   eblake 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: 621 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20131115/e6bc615b/attachment-0001.sig>


More information about the libvir-list mailing list