[CRIU] [PATCH 12/16] parasite: Don't inject code out of blob

Cyrill Gorcunov gorcunov at openvz.org
Mon Feb 13 14:26:35 EST 2012


It actually not a problem since we never reach a tail
out of blob, but better to be on a safe side (after
all there is no guarantee that .data section will not
end up exactly at blob final bytes).

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 parasite-syscall.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/parasite-syscall.c b/parasite-syscall.c
index b2fc926..40bcea6 100644
--- a/parasite-syscall.c
+++ b/parasite-syscall.c
@@ -592,7 +592,7 @@ struct parasite_ctl *parasite_infect_seized(pid_t pid, int pid_dir, struct list_
 	}
 
 	pr_info("Putting parasite blob into %p->%p\n", ctl->local_map, ctl->remote_map);
-	memcpy(ctl->local_map, parasite_blob, parasite_size);
+	memcpy(ctl->local_map, parasite_blob, sizeof(parasite_blob));
 
 	jerr(ptrace(PTRACE_SETREGS, pid, NULL, &regs_orig), err_munmap_restore);
 
-- 
1.7.7.6



More information about the CRIU mailing list