From 450981caf00fced04f39486ec08f0dea67409aec Mon Sep 17 00:00:00 2001 From: Mike Rapoport Date: Tue, 29 Nov 2016 14:45:00 +0300 Subject: [PATCH] lazy-pages: fix searching for the page at #PF time 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. travis-ci: success for lazy-pages: fix searching for the page at #PF time Signed-off-by: Mike Rapoport Signed-off-by: Pavel Emelyanov --- criu/uffd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/criu/uffd.c b/criu/uffd.c index 99e6c65f3..99e16e87f 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; }