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

Mike Rapoport rppt at linux.ibm.com
Tue May 14 11:34:22 MSK 2019


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



More information about the CRIU mailing list