[CRIU] [PATCH 2/3] restore: restore mntns before creating private vma-s

Andrey Vagin avagin at openvz.org
Thu Nov 12 08:09:04 PST 2015


From: Andrew Vagin <avagin at virtuozzo.com>

We need to open a file to restore a file mapping and this file
can be from a current mntns.

Reported-by: Andrey Ryabinin <aryabinin at virtuozzo.com>
Signed-off-by: Andrew Vagin <avagin at virtuozzo.com>
---
 cr-restore.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/cr-restore.c b/cr-restore.c
index 0350a23..c5b5c67 100644
--- a/cr-restore.c
+++ b/cr-restore.c
@@ -1530,6 +1530,9 @@ static int restore_task_with_children(void *_arg)
 			goto err_fini_mnt;
 	}
 
+	if (restore_task_mnt_ns(current))
+		goto err_fini_mnt;
+
 	if (prepare_mappings())
 		goto err_fini_mnt;
 
@@ -1559,9 +1562,6 @@ static int restore_task_with_children(void *_arg)
 	if (create_children_and_session())
 		goto err_fini_mnt;
 
-	if (restore_task_mnt_ns(current))
-		goto err_fini_mnt;
-
 	if (unmap_guard_pages())
 		goto err_fini_mnt;
 
-- 
2.4.3



More information about the CRIU mailing list