mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-29 13:28:27 +00:00
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: Dmitry Safonov <dsafonov@virtuozzo.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
This commit is contained in:
parent
8459a3de9d
commit
3f6cce9850
@ -1134,24 +1134,29 @@ static int wait_zombies(struct task_restore_args *task_args)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool vdso_needs_parking(struct task_restore_args *args)
|
static bool vdso_unmapped(struct task_restore_args *args)
|
||||||
{
|
{
|
||||||
unsigned int i;
|
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 */
|
/* Don't park rt-vdso or rt-vvar if dumpee doesn't have them */
|
||||||
for (i = 0; i < args->vmas_n; i++) {
|
for (i = 0; i < args->vmas_n; i++) {
|
||||||
VmaEntry *vma = &args->vmas[i];
|
VmaEntry *vma = &args->vmas[i];
|
||||||
|
|
||||||
if (vma_entry_is(vma, VMA_AREA_VDSO) ||
|
if (vma_entry_is(vma, VMA_AREA_VDSO) ||
|
||||||
vma_entry_is(vma, VMA_AREA_VVAR))
|
vma_entry_is(vma, VMA_AREA_VVAR))
|
||||||
return true;
|
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 false;
|
||||||
|
|
||||||
|
return !vdso_unmapped(args);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1222,8 +1227,10 @@ long __export_restore_task(struct task_restore_args *args)
|
|||||||
goto core_restore_end;
|
goto core_restore_end;
|
||||||
|
|
||||||
/* Map compatible vdso */
|
/* Map compatible vdso */
|
||||||
if (args->compatible_mode && vdso_map_compat(args->vdso_rt_parked_at))
|
if (!vdso_unmapped(args) && args->compatible_mode) {
|
||||||
|
if (vdso_map_compat(args->vdso_rt_parked_at))
|
||||||
goto core_restore_end;
|
goto core_restore_end;
|
||||||
|
}
|
||||||
|
|
||||||
/* Shift private vma-s to the left */
|
/* Shift private vma-s to the left */
|
||||||
for (i = 0; i < args->vmas_n; i++) {
|
for (i = 0; i < args->vmas_n; i++) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user