Commit ac97f907 authored by Alexander Kartashov's avatar Alexander Kartashov Committed by Pavel Emelyanov

parasite-syscall.c: don't infect a VMA above TASK_SIZE

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: 's avatarAlexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent bd10da78
...@@ -47,7 +47,7 @@ static struct vma_area *get_vma_by_ip(struct list_head *vma_area_list, unsigned ...@@ -47,7 +47,7 @@ static struct vma_area *get_vma_by_ip(struct list_head *vma_area_list, unsigned
struct vma_area *vma_area; struct vma_area *vma_area;
list_for_each_entry(vma_area, vma_area_list, list) { list_for_each_entry(vma_area, vma_area_list, list) {
if (!in_vma_area(vma_area, ip)) if (vma_area->vma.start >= TASK_SIZE)
continue; continue;
if (!(vma_area->vma.prot & PROT_EXEC)) if (!(vma_area->vma.prot & PROT_EXEC))
continue; continue;
......
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