[CRIU] [PATCH] add warning message when joining user namespace

Dengguangxing dengguangxing at huawei.com
Mon May 30 04:12:01 PDT 2016


join user namespace is not fully tested yet. So it is
not recommended to use this.

add a warning message when user tries to use join-ns with
user-namespace.

Signed-off-by: Deng Guangxing <dengguangxing at huawei.com>
---
 criu/crtools.c    | 2 ++
 criu/namespaces.c | 3 +++
 2 files changed, 5 insertions(+)

diff --git a/criu/crtools.c b/criu/crtools.c
index 996b3a3..71299bd 100644
--- a/criu/crtools.c
+++ b/criu/crtools.c
@@ -921,6 +921,8 @@ usage:
 "			    --join-ns net:12345 or --join-ns net:/foo/bar.\n"
 "			Extra_opts is optional, for now only user namespace support:\n"
 "			    --join-ns user:PID,UID,GID to specify uid and gid.\n"
+"			Please NOTE: join-ns with user-namespace is not fully tested.\n"
+"			It may be dangerous to use this feature\n"
 "Check options:\n"
 "  without any arguments, \"criu check\" checks availability of absolutely required\n"
 "  kernel features; if any of these features is missing dump and restore will fail\n"
diff --git a/criu/namespaces.c b/criu/namespaces.c
index 0830925..6c42df0 100644
--- a/criu/namespaces.c
+++ b/criu/namespaces.c
@@ -53,6 +53,9 @@ int check_namespace_opts(void)
 		pr_perror("Conflict flags: -join-ns and -empty-ns");
 		return -1;
 	}
+	if (join_ns_flags & CLONE_NEWUSER)
+		pr_warn("join-ns with user-namespace is not fully tested and dangerous");
+
 	errno = 0;
 	return 0;
 }
-- 
2.5.0




More information about the CRIU mailing list