mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-29 13:28:27 +00:00
vdso: Separate checks for {vdso, vvar}-alikeness
No functional change expected. Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
This commit is contained in:
parent
8da2d8f282
commit
c7eb920fe1
31
criu/vdso.c
31
criu/vdso.c
@ -89,6 +89,26 @@ static int check_vdso_by_pfn(int pagemap_fd, struct vma_area *vma,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool not_vvar_or_vdso(struct vma_area *vma)
|
||||||
|
{
|
||||||
|
if (!vma_area_is(vma, VMA_AREA_REGULAR))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
if (vma_area_is(vma, VMA_FILE_SHARED))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
if (vma_area_is(vma, VMA_FILE_PRIVATE))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
if (vma->e->start > kdat.task_size)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
if (vma->e->flags & MAP_GROWSDOWN)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The VMAs list might have proxy vdso/vvar areas left
|
* The VMAs list might have proxy vdso/vvar areas left
|
||||||
* from previous dump/restore cycle so we need to detect
|
* from previous dump/restore cycle so we need to detect
|
||||||
@ -119,12 +139,9 @@ int parasite_fixup_vdso(struct parasite_ctl *ctl, pid_t pid,
|
|||||||
list_for_each_entry(vma, &vma_area_list->h, list) {
|
list_for_each_entry(vma, &vma_area_list->h, list) {
|
||||||
bool has_vdso_pfn = false;
|
bool has_vdso_pfn = false;
|
||||||
|
|
||||||
if (!vma_area_is(vma, VMA_AREA_REGULAR))
|
if (not_vvar_or_vdso(vma))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (vma_area_is(vma, VMA_FILE_SHARED) ||
|
|
||||||
vma_area_is(vma, VMA_FILE_PRIVATE))
|
|
||||||
continue;
|
|
||||||
/*
|
/*
|
||||||
* It might be possible VVAR area from marked
|
* It might be possible VVAR area from marked
|
||||||
* vDSO zone, we need to detect it earlier than
|
* vDSO zone, we need to detect it earlier than
|
||||||
@ -146,12 +163,6 @@ int parasite_fixup_vdso(struct parasite_ctl *ctl, pid_t pid,
|
|||||||
if ((vma->e->prot & VDSO_PROT) != VDSO_PROT)
|
if ((vma->e->prot & VDSO_PROT) != VDSO_PROT)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (vma->e->start > kdat.task_size)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (vma->e->flags & MAP_GROWSDOWN)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* I need to poke every potentially marked vma,
|
* I need to poke every potentially marked vma,
|
||||||
* otherwise if task never called for vdso functions
|
* otherwise if task never called for vdso functions
|
||||||
|
Loading…
x
Reference in New Issue
Block a user