Commit 0d6e15f5 authored by Pavel Emelyanov's avatar Pavel Emelyanov

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: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent 267037e8
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
#define PARASITE_STACK_SIZE (16 << 10) #define PARASITE_STACK_SIZE (16 << 10)
#define PARASITE_ARG_SIZE_MIN ( 1 << 12) #define PARASITE_ARG_SIZE_MIN ( 1 << 12)
#define PARASITE_START_AREA_MIN (4096)
#define PARASITE_MAX_SIZE (64 << 10) #define PARASITE_MAX_SIZE (64 << 10)
......
...@@ -57,7 +57,7 @@ unsigned long get_exec_start(struct vm_area_list *vmas) ...@@ -57,7 +57,7 @@ unsigned long get_exec_start(struct vm_area_list *vmas)
continue; continue;
len = vma_area_len(vma_area); 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); pr_warn("Suspiciously short VMA @%#lx\n", (unsigned long)vma_area->e->start);
continue; continue;
} }
...@@ -1166,6 +1166,8 @@ struct parasite_ctl *parasite_prep_ctl(pid_t pid, unsigned long exec_start) ...@@ -1166,6 +1166,8 @@ struct parasite_ctl *parasite_prep_ctl(pid_t pid, unsigned long exec_start)
ctl->rpid = pid; ctl->rpid = pid;
BUILD_BUG_ON(PARASITE_START_AREA_MIN < BUILTIN_SYSCALL_SIZE + MEMFD_FNAME_SZ);
ctl->syscall_ip = exec_start; ctl->syscall_ip = exec_start;
pr_debug("Parasite syscall_ip at %p\n", (void *)ctl->syscall_ip); pr_debug("Parasite syscall_ip at %p\n", (void *)ctl->syscall_ip);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment