[1/5] user_ns: Close pid proc in create_user_ns_hierarhy_fn()

Submitted by Kirill Tkhai on March 24, 2017, 9:34 a.m.

Details

Message ID 149034806620.30232.17845014655143284090.stgit@localhost.localdomain
State New
Series "Restore of "/proc/self/ns/net" fixes"
Headers show

Commit Message

Kirill Tkhai March 24, 2017, 9:34 a.m.
Child is cloned with CLONE_FILES, so it may rewrite our
PROC_SELF file. Close it manually.

We can't use call_in_child_process(), because we need
additional actions between clone() and wait().

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 criu/namespaces.c |    1 +
 1 file changed, 1 insertion(+)

Patch hide | download patch | download mbox

diff --git a/criu/namespaces.c b/criu/namespaces.c
index 08a72eee..d75c1dc1 100644
--- a/criu/namespaces.c
+++ b/criu/namespaces.c
@@ -2240,6 +2240,7 @@  static int create_user_ns_hierarhy_fn(void *in_arg)
 		futex_set_and_wake(p_futex, ret ? NS__ERROR : NS__RESTORED);
 	if (arg)
 		munmap(arg, sizeof(*arg));
+	close_pid_proc();
 	return ret ? 1 : 0;
 }