Commit 450981ca authored by Mike Rapoport's avatar Mike Rapoport Committed by Andrei Vagin

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: 's avatarMike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent c89a22a8
...@@ -604,6 +604,8 @@ static int uffd_seek_or_zero_pages(struct lazy_pages_info *lpi, __u64 address, ...@@ -604,6 +604,8 @@ static int uffd_seek_or_zero_pages(struct lazy_pages_info *lpi, __u64 address,
if (pagemap_zero(lpi->pr.pe)) if (pagemap_zero(lpi->pr.pe))
return uffd_zero(lpi, address, nr); return uffd_zero(lpi, address, nr);
lpi->pr.skip_pages(&lpi->pr, address - lpi->pr.pe->vaddr);
return 1; return 1;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment