mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-08-04 07:43:23 +00:00
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: Pavel Emelyanov <xemul@virtuozzo.com> Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
This commit is contained in:
parent
5a557f2e3b
commit
7206e329b5
1 changed files with 4 additions and 9 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue