[CRIU] [PATCH] mount: skip the criu's mount namespace if tasks live in another mntns

Andrey Vagin avagin at openvz.org
Thu Sep 18 05:48:00 PDT 2014


Currently here is a bug, because when we see criu's mount namespace,
we go to the "out" mark and don't validate mounts.

Reported-by: Cyrill Gorcunov <gorcunov at openvz.org>
Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 mount.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/mount.c b/mount.c
index 1669611..d6f45f9 100644
--- a/mount.c
+++ b/mount.c
@@ -2087,11 +2087,12 @@ static int walk_mnt_ns(int (*cb)(struct ns_id *, struct mount_info *, void *), v
 			 * Otherwise, the necessary list of mounts
 			 * will be collected below.
 			 */
-			if (!(root_ns_mask & CLONE_NEWNS)) {
-				mntinfo = collect_mntinfo(ns);
-				if (mntinfo == NULL)
-					goto err;
-			}
+			if ((root_ns_mask & CLONE_NEWNS))
+				continue;
+
+			mntinfo = collect_mntinfo(ns);
+			if (mntinfo == NULL)
+				goto err;
 			/*
 			 * Mount namespaces are dumped only if the root task lives in
 			 * its own mntns, so we can stop enumeration of namespaces.
-- 
1.9.3



More information about the CRIU mailing list