[CRIU] [PATCH] restore: Drop MAP_GROWSDOWN mmap flags from the stack creation

Cyrill Gorcunov gorcunov at openvz.org
Mon Jul 23 06:13:03 EDT 2012


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;
-- 
1.7.7.6



More information about the CRIU mailing list