[CRIU] Re: [PATCH 3/4] pipes: Set fowners for both pipe ends

Pavel Emelyanov xemul at parallels.com
Thu Apr 12 06:18:42 EDT 2012


On 04/12/2012 01:45 PM, Cyrill Gorcunov wrote:
> Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
> ---
>  pipes.c |    7 ++++---
>  1 files changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/pipes.c b/pipes.c
> index 3ebad92..99672d1 100644
> --- a/pipes.c
> +++ b/pipes.c
> @@ -261,6 +261,10 @@ static int open_pipe(struct file_desc *d)
>  		return -1;
>  	}
>  
> +	if (restore_fown(pfd[0], &pi->pe.fown) ||
> +	    restore_fown(pfd[1], &pi->pe.fown))
> +		return -1;
> +

No, this is wrong. The restore_fown for the other end should
occur in recv fn, since it reopens the struct file.

>  	ret = restore_pipe_data(pfd[1], pi);
>  
>  	sock = socket(PF_UNIX, SOCK_DGRAM, 0);
> @@ -291,8 +295,5 @@ out:
>  	if (ret < 0)
>  		return -1;
>  
> -	if (restore_fown(tmp, &pi->pe.fown))
> -		return -1;
> -
>  	return tmp;
>  }



More information about the CRIU mailing list