From 65b3a95c9b36e7be922c77e9d87b34055b4ea10b Mon Sep 17 00:00:00 2001 From: Andrey Vagin Date: Thu, 18 Sep 2014 16:48:00 +0400 Subject: [PATCH] mount: skip the criu's mount namespace if tasks live in another mntns 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 Signed-off-by: Andrey Vagin Acked-by: Cyrill Gorcunov Signed-off-by: Pavel Emelyanov --- mount.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/mount.c b/mount.c index baf4c132b..3896a682f 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.