mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-17 16:47:50 +00:00
restorer: Calculate self-stack size with guard pages
Otherwise we might not unmap the whole stack leaving a guard page in restoree memory map. Not a big deal but anyway. Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
parent
95c593a618
commit
df81acafa7
1 changed files with 7 additions and 0 deletions
|
|
@ -301,6 +301,13 @@ long __export_restore_task(struct task_restore_core_args *args)
|
|||
if (!vma_entry_is(vma_entry, VMA_AREA_REGULAR))
|
||||
continue;
|
||||
|
||||
/*
|
||||
* The kernel doesn't show stack guard pages on
|
||||
* proc output, so add pages here by hands.
|
||||
*/
|
||||
if (vma_entry_is(vma_entry, VMA_AREA_STACK))
|
||||
vma_entry->start -= PAGE_SIZE;
|
||||
|
||||
if (sys_munmap((void *)vma_entry->start, vma_entry_len(vma_entry))) {
|
||||
write_num_n(__LINE__);
|
||||
goto core_restore_end;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue