提交 1583dfda 编写于 作者: G Gao feng 提交者: Daniel P. Berrange

LXC: Don't mount securityfs when user namespace enabled

Right now, securityfs is disallowed to be mounted in non-initial
user namespace, so we must avoid trying to mount securityfs in
a container which has user namespace enabled.
Signed-off-by: NGao feng <gaofeng@cn.fujitsu.com>
上级 393cf4d6
......@@ -750,7 +750,7 @@ err:
}
static int lxcContainerMountBasicFS(void)
static int lxcContainerMountBasicFS(bool userns_enabled)
{
const struct {
const char *src;
......@@ -801,6 +801,9 @@ static int lxcContainerMountBasicFS(void)
continue;
#endif
if (STREQ(mnts[i].src, "securityfs") && userns_enabled)
continue;
if (virFileMakePath(mnts[i].dst) < 0) {
virReportSystemError(errno,
_("Failed to mkdir %s"),
......@@ -1530,7 +1533,7 @@ static int lxcContainerSetupPivotRoot(virDomainDefPtr vmDef,
goto cleanup;
/* Mounts the core /proc, /sys, etc filesystems */
if (lxcContainerMountBasicFS() < 0)
if (lxcContainerMountBasicFS(vmDef->idmap.nuidmap) < 0)
goto cleanup;
/* Mounts /proc/meminfo etc sysinfo */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册