[CRIU] [PATCH] pagema-cache: Don't exceed task size on hight bound

Pavel Emelyanov xemul at parallels.com
Tue Feb 18 07:23:52 PST 2014


On 02/18/2014 05:29 PM, Cyrill Gorcunov wrote:
> If area is close to TASK_SIZE limit the high address
> may exceed it returning error once we try to read
> pagemap file. So limit the high address.

Does it fix the error I sent to you?

> Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
> ---
>  pagemap-cache.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/pagemap-cache.c b/pagemap-cache.c
> index 904347fc9ded..b102345cae6e 100644
> --- a/pagemap-cache.c
> +++ b/pagemap-cache.c
> @@ -66,6 +66,9 @@ static int pmc_fill_cache(pmc_t *pmc, struct vma_area *vma)
>  	size_t len = vma_area_len(vma);
>  	size_t size_map;
>  
> +	if (high > TASK_SIZE)
> +		high = TASK_SIZE;

Is it the proper place? What if we attach yet another vma and move the
pmc->end right, should we limit it as well?

> +
>  	pmc->start = vma->e->start;
>  	pmc->end = vma->e->end;
>  
> 




More information about the CRIU mailing list