]> git.ipfire.org Git - thirdparty/libvirt.git/commit
Avoid async signal safety problem in glibc's setxid
authorDaniel P. Berrange <berrange@redhat.com>
Fri, 15 Nov 2013 16:15:59 +0000 (16:15 +0000)
committerDaniel P. Berrange <berrange@redhat.com>
Mon, 18 Nov 2013 15:36:23 +0000 (15:36 +0000)
commit3563c51d3e95e6a90cb5d933afdeff7e51c9bc1d
tree259b725cc54675c5b9335038571d60028231c9e2
parent8c41794af8db3786577f4a29f29f0a561be2fc6b
Avoid async signal safety problem in glibc's setxid

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@redhat.com>
src/lxc/lxc_controller.c
src/lxc/lxc_fuse.c
src/lxc/lxc_fuse.h