[CRIU] [PATCH] criu: fix two issue with possible out-of-bound access

Andrei Vagin avagin at virtuozzo.com
Wed Jan 31 21:32:40 MSK 2018


Applied
On Thu, Jan 25, 2018 at 05:27:19PM -0800, Andrei Vagin wrote:
> Signed-off-by: Andrei Vagin <avagin at openvz.org>
> ---
>  criu/kerndat.c      | 2 +-
>  criu/pie/parasite.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/criu/kerndat.c b/criu/kerndat.c
> index b71df1c7c..d60be5287 100644
> --- a/criu/kerndat.c
> +++ b/criu/kerndat.c
> @@ -197,7 +197,7 @@ int kerndat_files_stat(bool early)
>  				buf[ret] = '\0';
>  				max_files = atol(buf);
>  			}
> -			ret = read(fd2, buf, sizeof(buf));
> +			ret = read(fd2, buf, sizeof(buf) - 1);
>  			if (ret > 0) {
>  				buf[ret] = '\0';
>  				nr_open = atol(buf);
> diff --git a/criu/pie/parasite.c b/criu/pie/parasite.c
> index 12b8cb981..7a48f324e 100644
> --- a/criu/pie/parasite.c
> +++ b/criu/pie/parasite.c
> @@ -630,7 +630,7 @@ static int parasite_dump_cgroup(struct parasite_dump_cgroup_args *args)
>  		return -1;
>  	}
>  
> -	if (len == sizeof(*args)) {
> +	if (len == sizeof(args->contents)) {
>  		pr_warn("/proc/self/cgroup was bigger than the page size\n");
>  		return -1;
>  	}
> -- 
> 2.13.6
> 


More information about the CRIU mailing list