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

Pavel Hrdina phrdina at redhat.com
Mon Nov 18 16:09:31 UTC 2013


On 15.11.2013 17:20, 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>

[...]

> diff --git a/src/lxc/lxc_fuse.c b/src/lxc/lxc_fuse.c
> index 9d12832..88e122e 100644
> --- a/src/lxc/lxc_fuse.c
> +++ b/src/lxc/lxc_fuse.c

[...]

> @@ -364,6 +369,10 @@ int lxcSetupFuse(virLXCFusePtr *f ATTRIBUTE_UNUSED,
>       return 0;
>   }
>
> +int lxcStartFuse(virLXCFusePtr f ATTRIBUTE_UNUSED)
> +{
> +}
> +
>   void lxcFreeFuse(virLXCFusePtr *f ATTRIBUTE_UNUSED)
>   {
>   }

Hi Daniel,

This hunk breaks the build on RHEL-6.4.
lxc/lxc_fuse.c:374: error: control reaches end of non-void function 
[-Wreturn-type]

Pavel




More information about the libvir-list mailing list