diff options
-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); |