[CRIU] [PATCH] cr-service: feature check core dumps if criu_req->criu_opts is empty

Andrei Vagin avagin at virtuozzo.com
Tue Feb 14 18:25:06 PST 2017


Applied. Thanks!

On Tue, Feb 14, 2017 at 06:34:55PM +0100, Adrian Reber wrote:
> From: Adrian Reber <areber at redhat.com>
> 
> Trying to use the FEATURE_CHECK RPC with criu_req->criu_opts set to NULL
> makes CRIU segfault. Technically there is no reason to have a valid
> criu_req->criu_opt during feature check. The only reason was to set the
> image directory for setproctitle(). This removes the segfault and the
> unnecessary requirement of setting criu_req->criu_opts.
> 
> Another possible solution would have been to return an error if
> criu_req->criu_opts is NULL but so far it seems unnecessary to have
> criu_req->criu_opts during feature check.
> 
> Signed-off-by: Adrian Reber <areber at redhat.com>
> ---
>  criu/cr-service.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/criu/cr-service.c b/criu/cr-service.c
> index fd41450..ff5a7a8 100644
> --- a/criu/cr-service.c
> +++ b/criu/cr-service.c
> @@ -859,16 +859,13 @@ static int handle_feature_check(int sk, CriuReq * msg)
>  	if (pid == 0) {
>  		int ret = 1;
>  
> -		if (setup_opts_from_req(sk, msg->opts))
> -			goto cout;
> -
> -		setproctitle("feature-check --rpc -D %s", images_dir);
> +		setproctitle("feature-check --rpc");
>  
>  		kerndat_get_dirty_track();
>  
>  		if (kdat.has_dirty_track)
>  			ret = 0;
> -cout:
> +
>  		exit(ret);
>  	}
>  
> -- 
> 2.9.3
> 
> _______________________________________________
> CRIU mailing list
> CRIU at openvz.org
> https://lists.openvz.org/mailman/listinfo/criu


More information about the CRIU mailing list