Commit fa11d76c authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov

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: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 7d3a8997
......@@ -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;
......
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