From fa11d76cab396e35f5f77f7dac95c8c6ef70e239 Mon Sep 17 00:00:00 2001 From: Andrey Vagin Date: Sat, 7 Apr 2012 00:22:00 +0400 Subject: [PATCH] restore: check that a restorer vma doesn't intersect with target vma-s [ xemul: The fix effectively is -- stop scanning the 2nd vma list once we see, that the hint's end hits the next vma ] Signed-off-by: Andrey Vagin Signed-off-by: Pavel Emelyanov --- cr-restore.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cr-restore.c b/cr-restore.c index e2892cefd..27d7fcdca 100644 --- a/cr-restore.c +++ b/cr-restore.c @@ -881,6 +881,8 @@ static long restorer_get_vma_hint(pid_t pid, struct list_head *tgt_vma_list, unsigned long prev_vma_end2 = 0; list_for_each_entry(s_vma, self_vma_list, list) { + if (prev_vma_end2 + vma_len > t_vma->vma.start) + break; if (prev_vma_end2 && (prev_vma_end2 >= prev_vma_end) && ((s_vma->vma.start - prev_vma_end2) > vma_len)) return prev_vma_end2;