Skip to content

Conversation

@cyphar
Copy link
Member

@cyphar cyphar commented Jun 28, 2015

If a configuration option is set for a cgroup that isn't mounted, an
error will be emitted. This is an issue, because newer cgroups aren't
present in older kernels, and we can't break backcompat where a new
config can't run on an older kernel.

The issue arises because .Set() does no checks for whether the given
path actually points to a mountpoint, so fix the code by just bailing if
the cgroup mountpoint doesn't exist.

Fixes: fc3981e
Fixes: 606d906
Signed-off-by: Aleksa Sarai [email protected]

This was already done in 606d906, and then reverted in fc3981e (see docker-archive/libcontainer#474). This is an issue I'm facing when testing #58, where the kernel doesn't support it but the config is also non-default. I don't agree that we should fail if we have a configuration option that applies to a cgroup which the host kernel doesn't support and also isn't a hard requirement. As it currently stands, the cgroup.IsNotFound(err) check is essentially a no-op as we fail in .Set() anyway. The only time it is actually useful is where the cgroup has no options to set -- which is just a side-effect of .Set() doing nothing.

/cc @crosbymichael @vmarmol

If a configuration option is set for a cgroup that isn't mounted, an
error will be emitted. This is an issue, because newer cgroups aren't
present in older kernels, and we can't break backcompat where a new
config can't run on an older kernel.

The issue arises because .Set() does no checks for whether the given
path actually points to a mountpoint, so fix the code by just bailing if
the cgroup mountpoint doesn't exist.

Fixes: fc3981e
Fixes: 606d906
Signed-off-by: Aleksa Sarai <[email protected]>
@cyphar
Copy link
Member Author

cyphar commented Jun 29, 2015

The reason behind this PR is flawed. Failing loudly is better than ignoring (potentially security-sensitive) options.

@cyphar cyphar closed this Jun 29, 2015
@cyphar cyphar deleted the fix-cgroup-isnotexist-errors branch September 6, 2015 11:15
stefanberger pushed a commit to stefanberger/runc that referenced this pull request Sep 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant