Commit 6382ec4e authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov

parasite: prep_ctl doesn't search place for syscall if vma_list is NULL

This feature will be used for unmaping restorer blobs. All reqired code
will be in the blob.
Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent f9f69026
......@@ -885,6 +885,9 @@ int parasite_cure_seized(struct parasite_ctl *ctl)
return ret;
}
/*
* If vma_area_list is NULL, a place for injecting syscall will not be set.
*/
struct parasite_ctl *parasite_prep_ctl(pid_t pid, struct vm_area_list *vma_area_list)
{
struct parasite_ctl *ctl = NULL;
......@@ -914,6 +917,13 @@ struct parasite_ctl *parasite_prep_ctl(pid_t pid, struct vm_area_list *vma_area_
goto err;
}
ctl->pid.real = pid;
ctl->pid.virt = 0;
if (vma_area_list == NULL)
return ctl;
/* Search a place for injecting syscall */
vma_area = get_vma_by_ip(&vma_area_list->h, REG_IP(ctl->regs_orig));
if (!vma_area) {
pr_err("No suitable VMA found to run parasite "
......@@ -921,8 +931,6 @@ struct parasite_ctl *parasite_prep_ctl(pid_t pid, struct vm_area_list *vma_area_
goto err;
}
ctl->pid.real = pid;
ctl->pid.virt = 0;
ctl->syscall_ip = vma_area->vma.start;
return ctl;
......
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