[CRIU] [PATCH] Fix dumping of /proc folder

Cyrill Gorcunov gorcunov at gmail.com
Tue Jun 28 00:49:51 PDT 2016


On Tue, Jun 28, 2016 at 10:02:22AM +0300, Andrei Tuicu wrote:
> CRIU fails to dump processes that have a file descriptor pointing
> to the /proc folder, because check_path_remap returns error code
> in that case. Fix: return 0 instead.
> 
> Signed-off-by: Andrei Tuicu <andrei.tuicu at gmail.com>
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/criu/files-reg.c b/criu/files-reg.c
> index 899dcf6..0fcef6d 100644
> --- a/criu/files-reg.c
> +++ b/criu/files-reg.c
> @@ -975,8 +975,8 @@ static int check_path_remap(struct fd_link *link, const struct fd_parms *parms,
>  		if (!start)
>  			return -1;
>  		start = strstr(start + 1, "/");
> -		if (!start)
> -			return -1;
> +		if (!start) /* it's /proc */
> +			return 0;
>  		pid = strtol(start + 1, &end, 10);
>  
>  		/* If strtol didn't convert anything, then we are looking at

What if the process sitting in some mountnamespace with procfs mounted inside,
then instead of exiting early we've to fallthrough and check for ns root, ie
down to line mntns_root = mntns_get_root_fd(nsid);, if only I'm not missing
somthing obvious. avagin@?


More information about the CRIU mailing list