[CRIU] [PATCH] lazy-pages: fix searching for the page at #PF time

Mike Rapoport rppt at linux.vnet.ibm.com
Tue Nov 29 03:45:19 PST 2016


After commit a97d6d3f1609 (pagemap: replace seek_page with seek_pagemap
method), uffd only searches the pagemap containing the faulting page, but
it not for the page itself. For local restore it causes wrong data to be
read from pages*img and subsequent crash of the restored process.
Adding a call to pr->skip_pages fixes the problem.

Signed-off-by: Mike Rapoport <rppt at linux.vnet.ibm.com>
---
 criu/uffd.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/criu/uffd.c b/criu/uffd.c
index be452ce..b7bffc1 100644
--- a/criu/uffd.c
+++ b/criu/uffd.c
@@ -604,6 +604,8 @@ static int uffd_seek_or_zero_pages(struct lazy_pages_info *lpi, __u64 address,
 	if (pagemap_zero(lpi->pr.pe))
 		return uffd_zero(lpi, address, nr);
 
+	lpi->pr.skip_pages(&lpi->pr, address - lpi->pr.pe->vaddr);
+
 	return 1;
 }
 
-- 
1.9.1



More information about the CRIU mailing list