[CRIU] [PATCH 2/2] mem: Don't assume guard page is returned in procfs with new kernels

Andrey Ryabinin aryabinin at virtuozzo.com
Wed Jun 21 15:59:50 MSK 2017



On 06/21/2017 12:42 AM, Cyrill Gorcunov wrote:
roc_parse.c
> index 041d4512413d..6ca9984058aa 100644
> --- a/criu/proc_parse.c
> +++ b/criu/proc_parse.c
> @@ -25,6 +25,7 @@
>  #include "kerndat.h"
>  #include "vdso.h"
>  #include "vma.h"
> +#include "mem.h"
>  #include "bfd.h"
>  #include "proc_parse.h"
>  #include "fdinfo.h"
> @@ -637,9 +638,10 @@ static int vma_list_add(struct vma_area *vma_area,
>  	}
>  
>  	/* Add a guard page only if here is enough space for it */
> -	if ((vma_area->e->flags & MAP_GROWSDOWN) &&
> +	if (vma_has_guard_gap_hidden(vma_area) &&
>  	    *prev_end < vma_area->e->start)
> -		vma_area->e->start -= PAGE_SIZE; /* Guard page */
> +		if (kdat.stack_guard_gap_hidden)

This already checked in vma_has_guard_gap_hidden().

> +			vma_area->e->start -= PAGE_SIZE; /* Guard page */
>  	*prev_end = vma_area->e->end;
>  
>  	list_add_tail(&vma_area->list, &vma_area_list->h);
> 


More information about the CRIU mailing list