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

Alexander Kartashov alekskartashov at parallels.com
Fri Jan 18 02:08:36 EST 2013


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 c3510d8..ec45090 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 (vma_area->vma.start >= TASK_SIZE)
 			continue;
 		if (!(vma_area->vma.prot & PROT_EXEC))
 			continue;
-- 
1.7.10.4



More information about the CRIU mailing list