Commit 5e32a990 by S.Çağlar Onur Committed by Serge Hallyn

skip rootfs pinning for unprivileged containers

This is perfectly safe since you cannot unmount the host fs from a child userns. Signed-off-by: 's avatarS.Çağlar Onur <caglar@10ur.org> Signed-off-by: 's avatarSerge Hallyn <serge.hallyn@ubuntu.com>
parent e8d07ef2
...@@ -763,11 +763,14 @@ static int lxc_spawn(struct lxc_handler *handler) ...@@ -763,11 +763,14 @@ static int lxc_spawn(struct lxc_handler *handler)
/* /*
* if the rootfs is not a blockdev, prevent the container from * if the rootfs is not a blockdev, prevent the container from
* marking it readonly. * marking it readonly.
*
* if the container is unprivileged then skip rootfs pinning
*/ */
if (lxc_list_empty(&handler->conf->id_map)) {
handler->pinfd = pin_rootfs(handler->conf->rootfs.path); handler->pinfd = pin_rootfs(handler->conf->rootfs.path);
if (handler->pinfd == -1) if (handler->pinfd == -1)
INFO("failed to pin the container's rootfs"); INFO("failed to pin the container's rootfs");
}
if (preserve_ns(saved_ns_fd, preserve_mask) < 0) if (preserve_ns(saved_ns_fd, preserve_mask) < 0)
goto out_delete_net; goto out_delete_net;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment