[CRIU] [crtools-bot for Cyrill Gorcunov ] parasite: Don't inject code out of blob

Cyrill Gorcunov gorcunov at openvz.org
Tue Feb 14 08:18:09 EST 2012


The commit is pushed to "master" and will appear on git://github.com/cyrillos/crtools.git
------>
commit 12b38e7692bf57f9f5f60af4941eae431cdef7b9
Author: Cyrill Gorcunov <gorcunov at openvz.org>
Date:   Mon Feb 13 21:49:18 2012 +0400

    parasite: Don't inject code out of blob
    
    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>
    Acked-by: Pavel Emelyanov <xemul at parallels.com>
---
 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);
 


More information about the CRIU mailing list