Commit 31146346 authored by Dmitry Safonov's avatar Dmitry Safonov Committed by Andrei Vagin

compel/infect: don't copy gotpcrel with parasite's blob

We don't need gotpcrel inside parasite's blob:
we handle relocations over remote map in compel library,
reading them from parasite's blob header.

travis-ci: success for series starting with [1/6] compel/infect: fix out-of-bounds parasite memcpy()
Signed-off-by: 's avatarDmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: 's avatarAndrey Ryabinin <aryabinin@virtuozzo.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent beed3195
...@@ -850,9 +850,9 @@ int compel_map_exchange(struct parasite_ctl *ctl, unsigned long size) ...@@ -850,9 +850,9 @@ int compel_map_exchange(struct parasite_ctl *ctl, unsigned long size)
return ret; return ret;
} }
static inline unsigned long total_pie_size(size_t blob_size, size_t nr_gp) static inline unsigned long total_pie_size(size_t blob_size)
{ {
return round_up(blob_size + nr_gp * sizeof(long), page_size()); return round_up(blob_size, page_size());
} }
int compel_infect(struct parasite_ctl *ctl, unsigned long nr_threads, unsigned long args_size) int compel_infect(struct parasite_ctl *ctl, unsigned long nr_threads, unsigned long args_size)
...@@ -876,7 +876,7 @@ int compel_infect(struct parasite_ctl *ctl, unsigned long nr_threads, unsigned l ...@@ -876,7 +876,7 @@ int compel_infect(struct parasite_ctl *ctl, unsigned long nr_threads, unsigned l
* without using ptrace at all. * without using ptrace at all.
*/ */
parasite_size = total_pie_size(ctl->pblob.hdr.bsize, ctl->pblob.hdr.nr_gotpcrel); parasite_size = total_pie_size(ctl->pblob.hdr.bsize);
ctl->args_size = round_up(args_size, PAGE_SIZE); ctl->args_size = round_up(args_size, PAGE_SIZE);
parasite_size += ctl->args_size; parasite_size += ctl->args_size;
......
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