[CRIU] [PATCH] lazy-pages: fix stack detection

Andrei Vagin avagin at gmail.com
Tue May 21 10:17:15 MSK 2019


Applied, thanks!

On Tue, May 14, 2019 at 11:34:22AM +0300, Mike Rapoport wrote:
> The commit 5432a964dcc7 ("lazy-pages: don't mark current stack page as
> lazy") tried to make the pages surrounding the stack pointers non-lazy.
> Unfortunately, it used a wrong mask for the detection.
> 
> Fix it.
> 
> Signed-off-by: Mike Rapoport <rppt at linux.ibm.com>
> ---
>  criu/mem.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/criu/mem.c b/criu/mem.c
> index 8015a7e..df87ed5 100644
> --- a/criu/mem.c
> +++ b/criu/mem.c
> @@ -149,7 +149,7 @@ static bool is_stack(struct pstree_item *item, unsigned long vaddr)
>  	for (i = 0; i < item->nr_threads; i++) {
>  		uint64_t sp = dmpi(item)->thread_sp[i];
>  
> -		if (!((sp ^ vaddr) & PAGE_MASK))
> +		if (!((sp ^ vaddr) & ~PAGE_MASK))
>  			return true;
>  	}
>  
> -- 
> 2.7.4
> 
> _______________________________________________
> CRIU mailing list
> CRIU at openvz.org
> https://lists.openvz.org/mailman/listinfo/criu


More information about the CRIU mailing list