Commit c7eb920f authored by Dmitry Safonov's avatar Dmitry Safonov Committed by Andrei Vagin

vdso: Separate checks for {vdso, vvar}-alikeness

No functional change expected.
Signed-off-by: 's avatarDmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent 8da2d8f2
...@@ -89,6 +89,26 @@ static int check_vdso_by_pfn(int pagemap_fd, struct vma_area *vma, ...@@ -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, ...@@ -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, ...@@ -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
......
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