[CRIU] [PATCH 7/9] parasite-syscall.c: don't infect a VMA above TASK_SIZE

Pavel Emelyanov xemul at parallels.com
Wed Jan 16 10:14:58 EST 2013


On 01/16/2013 12:28 PM, Alexander Kartashov wrote:
> If a task executes a non-userspace code (that sometimes takes place on ARM)
> while being seized the subsequent infection with the syscall blob fails
> because ptrace fails to write to the VMA the PC is in.
> 
> The patch modifies the function get_vma_by_ip() to check the PC of the task
> being seized is below the TASK_SIZE boundary. If the check fails
> the first suitable VMA is infected.
> 
> Signed-off-by: Alexander Kartashov <alekskartashov at parallels.com>
> ---
>  parasite-syscall.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/parasite-syscall.c b/parasite-syscall.c
> index 9518d58..eaa342c 100644
> --- a/parasite-syscall.c
> +++ b/parasite-syscall.c
> @@ -47,7 +47,7 @@ static struct vma_area *get_vma_by_ip(struct list_head *vma_area_list, unsigned
>  	struct vma_area *vma_area;
>  
>  	list_for_each_entry(vma_area, vma_area_list, list) {
> -		if (!in_vma_area(vma_area, ip))
> +		if (ip < TASK_SIZE && !in_vma_area(vma_area, ip))

The only vma passing through this check is ((ip > TASK_SIZE) || (ip in vma))
which is not what is written in comment.

>  			continue;
>  		if (!(vma_area->vma.prot & PROT_EXEC))
>  			continue;
> 




More information about the CRIU mailing list