From: Christian Brauner Date: Sun, 9 Aug 2020 13:48:35 +0000 (+0200) Subject: cgfsng: use safe_mount_beneath() X-Git-Tag: lxc-5.0.0~370^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8b1f4dd9b38810488207a81f1e7dd5515eb5a25c;p=thirdparty%2Flxc.git cgfsng: use safe_mount_beneath() Signed-off-by: Christian Brauner --- diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c index 8d9e3d511..85afc63af 100644 --- a/src/lxc/cgroups/cgfsng.c +++ b/src/lxc/cgroups/cgfsng.c @@ -1872,9 +1872,17 @@ __cgfsng_ops static bool cgfsng_mount(struct cgroup_ops *ops, } /* mount tmpfs */ - ret = safe_mount(NULL, cgroup_root, "tmpfs", - MS_NOSUID | MS_NODEV | MS_NOEXEC | MS_RELATIME, - "size=10240k,mode=755", root); + ret = safe_mount_beneath(root, NULL, DEFAULT_CGROUP_MOUNTPOINT, "tmpfs", + MS_NOSUID | MS_NODEV | MS_NOEXEC | MS_RELATIME, + "size=10240k,mode=755"); + if (ret < 0) { + if (errno != ENOSYS) + return false; + + ret = safe_mount(NULL, cgroup_root, "tmpfs", + MS_NOSUID | MS_NODEV | MS_NOEXEC | MS_RELATIME, + "size=10240k,mode=755", root); + } if (ret < 0) return false;