Commit 7206e329 authored by Pavel Emelyanov's avatar Pavel Emelyanov

restore: Bootstrap len is always page-size aligned

The restore_bootstrap_len is restorer, args and rst-mem lenghts.

Restorer is pie_size() from restorer, which is page-size aligned.
Args len is aligned to page-size few lines above.
The remapable rst-mem grows page by page and is aligned too.
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
Acked-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
parent 5a557f2e
......@@ -2658,7 +2658,6 @@ static int sigreturn_restore(pid_t pid, CoreEntry *core)
#ifdef CONFIG_VDSO
unsigned long vdso_rt_size = 0;
unsigned long vdso_rt_delta = 0;
#endif
unsigned long aio_rings;
......@@ -2757,19 +2756,15 @@ static int sigreturn_restore(pid_t pid, CoreEntry *core)
rst_mem_size = rst_mem_lock();
restore_bootstrap_len = restorer_len + args_len + rst_mem_size;
BUG_ON(restore_bootstrap_len & (PAGE_SIZE - 1));
#ifdef CONFIG_VDSO
/*
* Figure out how much memory runtime vdso and vvar will need.
*/
vdso_rt_size = vdso_vma_size(&vdso_sym_rt);
if (vdso_rt_size) {
vdso_rt_delta = ALIGN(restore_bootstrap_len, PAGE_SIZE) - restore_bootstrap_len;
vdso_rt_size += vdso_rt_delta;
if (vvar_vma_size(&vdso_sym_rt))
vdso_rt_size += ALIGN(vvar_vma_size(&vdso_sym_rt), PAGE_SIZE);
}
if (vdso_rt_size && vvar_vma_size(&vdso_sym_rt))
vdso_rt_size += ALIGN(vvar_vma_size(&vdso_sym_rt), PAGE_SIZE);
restore_bootstrap_len += vdso_rt_size;
#endif
......@@ -2970,7 +2965,7 @@ static int sigreturn_restore(pid_t pid, CoreEntry *core)
* self-vmas are unmaped.
*/
mem += rst_mem_size;
task_args->vdso_rt_parked_at = (unsigned long)mem + vdso_rt_delta;
task_args->vdso_rt_parked_at = (unsigned long)mem;
task_args->vdso_sym_rt = vdso_sym_rt;
task_args->vdso_rt_size = vdso_rt_size;
#endif
......
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