[CRIU] [PATCH] restore: Use in_vma_area helper in restore_priv_vma_content

Cyrill Gorcunov gorcunov at openvz.org
Mon Mar 25 07:18:46 EDT 2013


Because a sequence of VMAs is not obligated to not have
holes inbetween, plain vma.end check is not enough, use
in_vma_area instead to make sure that page addres we're
using to restore page contents do belong to particular
vma.

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 cr-restore.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cr-restore.c b/cr-restore.c
index 13273c1..ae66668 100644
--- a/cr-restore.c
+++ b/cr-restore.c
@@ -301,7 +301,7 @@ static int restore_priv_vma_content(pid_t pid)
 			unsigned char buf[PAGE_SIZE];
 			void *p;
 
-			while (va >= vma->vma.end) {
+			while (!(in_vma_area(vma, va))) {
 				if (vma->list.next == &rst_vmas.h)
 					goto err_addr;
 				vma = list_entry(vma->list.next, struct vma_area, list);
-- 
1.8.1.4



More information about the CRIU mailing list