Commit df81acaf authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

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: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 95c593a6
...@@ -301,6 +301,13 @@ long __export_restore_task(struct task_restore_core_args *args) ...@@ -301,6 +301,13 @@ long __export_restore_task(struct task_restore_core_args *args)
if (!vma_entry_is(vma_entry, VMA_AREA_REGULAR)) if (!vma_entry_is(vma_entry, VMA_AREA_REGULAR))
continue; 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))) { if (sys_munmap((void *)vma_entry->start, vma_entry_len(vma_entry))) {
write_num_n(__LINE__); write_num_n(__LINE__);
goto core_restore_end; goto core_restore_end;
......
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