[CRIU] Re: [PATCH] restore: Drop MAP_GROWSDOWN mmap flags from the
stack creation
Cyrill Gorcunov
gorcunov at openvz.org
Mon Jul 23 06:26:09 EDT 2012
On Mon, Jul 23, 2012 at 02:13:03PM +0400, Cyrill Gorcunov wrote:
> This makes the kernel to treat stack area with stack
> guard page and prevent us from unmapping the whole
> VMA area at late sigreturn call, which forces restored
> program to carry zero sized VMA which previously belong
> to a guard page.
>
> Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
> ---
> cr-restore.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/cr-restore.c b/cr-restore.c
> index 256ae77..c320978 100644
> --- a/cr-restore.c
> +++ b/cr-restore.c
> @@ -486,7 +486,7 @@ static inline int fork_with_pid(struct pstree_item *item, unsigned long ns_clone
> pr_info("Forking task with %d pid (flags 0x%lx)\n", pid, ns_clone_flags);
>
> stack = mmap(NULL, STACK_SIZE, PROT_WRITE | PROT_READ,
> - MAP_PRIVATE | MAP_GROWSDOWN | MAP_ANONYMOUS, -1, 0);
> + MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
> if (stack == MAP_FAILED) {
> pr_perror("Failed to map stack for the child");
> goto err;
Drop it please, the real reason is simplier, will update.
Cyrill
More information about the CRIU
mailing list