Commit 3f6cce98 authored by Dmitry Safonov's avatar Dmitry Safonov Committed by Andrei Vagin

vdso/restorer: Don't map compatible vdso if it was unmapped

If there is no vdso in images - we don't need to map it.
Signed-off-by: 's avatarDmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent 8459a3de
......@@ -1134,24 +1134,29 @@ static int wait_zombies(struct task_restore_args *task_args)
return 0;
}
static bool vdso_needs_parking(struct task_restore_args *args)
static bool vdso_unmapped(struct task_restore_args *args)
{
unsigned int i;
/* Compatible vDSO will be mapped, not moved */
if (args->compatible_mode)
return false;
/* Don't park rt-vdso or rt-vvar if dumpee doesn't have them */
for (i = 0; i < args->vmas_n; i++) {
VmaEntry *vma = &args->vmas[i];
if (vma_entry_is(vma, VMA_AREA_VDSO) ||
vma_entry_is(vma, VMA_AREA_VVAR))
return true;
return false;
}
return false;
return true;
}
static bool vdso_needs_parking(struct task_restore_args *args)
{
/* Compatible vDSO will be mapped, not moved */
if (args->compatible_mode)
return false;
return !vdso_unmapped(args);
}
/*
......@@ -1222,8 +1227,10 @@ long __export_restore_task(struct task_restore_args *args)
goto core_restore_end;
/* Map compatible vdso */
if (args->compatible_mode && vdso_map_compat(args->vdso_rt_parked_at))
goto core_restore_end;
if (!vdso_unmapped(args) && args->compatible_mode) {
if (vdso_map_compat(args->vdso_rt_parked_at))
goto core_restore_end;
}
/* Shift private vma-s to the left */
for (i = 0; i < args->vmas_n; i++) {
......
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