[CRIU] [PATCH 02/11] restore: call close_pid_proc() if a child is shared a parent fd table

Andrei Vagin avagin at openvz.org
Wed Feb 1 16:04:22 PST 2017


From: Andrei Vagin <avagin at virtuozzo.com>

There are a number of global variables around this descriptor
(e.g. open_proc_fd) and their values are saved in memory which
are not shared between processes.

Signed-off-by: Andrei Vagin <avagin at virtuozzo.com>
---
 criu/cr-restore.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/criu/cr-restore.c b/criu/cr-restore.c
index ee6b848..53eb6b4 100644
--- a/criu/cr-restore.c
+++ b/criu/cr-restore.c
@@ -1030,6 +1030,9 @@ static inline int fork_with_pid(struct pstree_item *item)
 		BUG_ON(pid != INIT_PID);
 	}
 
+	if (ca.clone_flags & CLONE_FILES)
+		close_pid_proc();
+
 	/*
 	 * Some kernel modules, such as netwrok packet generator
 	 * run kernel thread upon net-namespace creattion taking
-- 
2.7.4



More information about the CRIU mailing list