diff options
author | Pavel Emelyanov <xemul@virtuozzo.com> | 2016-10-17 15:04:00 +0300 |
---|---|---|
committer | Pavel Emelyanov <xemul@virtuozzo.com> | 2016-10-24 16:00:15 +0300 |
commit | 0d6e15f5e592bf9f31c8fd3b3bef554a5aa6fdc9 (patch) | |
tree | cae9cf0ebbfce19fbbef19bba3beb2e2d79712df | |
parent | 267037e8e80831193c1e5de914b82f57b1c93181 (diff) |
parasite: Relax size checking for get_exec_start()
For compel-ization it's MUCH easier to introduce single
constant, all the more so no VMAs can be shorter than
one page :)
travis-ci: success for parasite: Relax size checking for get_exec_start()
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
-rw-r--r-- | criu/include/parasite.h | 1 | ||||
-rw-r--r-- | criu/parasite-syscall.c | 4 |
2 files changed, 4 insertions, 1 deletions
diff --git a/criu/include/parasite.h b/criu/include/parasite.h index e9429b620..6ea52b187 100644 --- a/criu/include/parasite.h +++ b/criu/include/parasite.h @@ -3,6 +3,7 @@ #define PARASITE_STACK_SIZE (16 << 10) #define PARASITE_ARG_SIZE_MIN ( 1 << 12) +#define PARASITE_START_AREA_MIN (4096) #define PARASITE_MAX_SIZE (64 << 10) diff --git a/criu/parasite-syscall.c b/criu/parasite-syscall.c index 213fd5018..2c0109a27 100644 --- a/criu/parasite-syscall.c +++ b/criu/parasite-syscall.c @@ -57,7 +57,7 @@ unsigned long get_exec_start(struct vm_area_list *vmas) continue; len = vma_area_len(vma_area); - if (len < BUILTIN_SYSCALL_SIZE + MEMFD_FNAME_SZ) { + if (len < PARASITE_START_AREA_MIN) { pr_warn("Suspiciously short VMA @%#lx\n", (unsigned long)vma_area->e->start); continue; } @@ -1166,6 +1166,8 @@ struct parasite_ctl *parasite_prep_ctl(pid_t pid, unsigned long exec_start) ctl->rpid = pid; + BUILD_BUG_ON(PARASITE_START_AREA_MIN < BUILTIN_SYSCALL_SIZE + MEMFD_FNAME_SZ); + ctl->syscall_ip = exec_start; pr_debug("Parasite syscall_ip at %p\n", (void *)ctl->syscall_ip); |