Skip to content

Conversation

@cyphar
Copy link
Member

@cyphar cyphar commented Feb 11, 2016

Fix m.Path legacy code to actually work. This means
we'll be able to finally vendor to Docker. It'd be nice
to merge this ASAP so we can finally merge a bunch
of stuff in Docker.

Fixes #551

Signed-off-by: Aleksa Sarai [email protected]

/cc @crosbymichael @LK4D4

@cyphar
Copy link
Member Author

cyphar commented Feb 11, 2016

Right, so it turns out that the patch I'm fixing also introduced a security vulnerability. I'll include it in this PR.

@cyphar
Copy link
Member Author

cyphar commented Feb 11, 2016

The Docker suite passes once you apply this PR. Please merge ASAP. Thanks guys. :D

/ping @crosbymichael @LK4D4 @dqminh @mrunalp @vmarmol

@mlaventure
Copy link
Contributor

Looks like I forgot to call the cleaning path routine in my last refactoring. Thanks for spotting it!

Could you also add a unit test for it within runc? This would avoid having to wait on vendoring into docker to find future regression if any.

@crosbymichael
Copy link
Member

Yes, can you add some unit tests for this path logic?

@cyphar
Copy link
Member Author

cyphar commented Feb 12, 2016

@crosbymichael I've added some (pretty exhaustive IMO) unit tests to make sure we don't run into this again. :P

}

config := &configs.Cgroup{
Parent: "../../../../../../../../../../some/path",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing the initial / to make it absolute

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit addressed (in TestInvalidAbsoluteCgroupParent).

Fix m.Path legacy code to actually work.

Signed-off-by: Aleksa Sarai <[email protected]>
Ensure that path safety is maintained, this essentially reapplies
c0cad6a ("cgroups: fs: fix cgroup.Parent path sanitisation"), which
was accidentally removed in 256f3a8 ("Add support for CgroupsPath
field").

Signed-off-by: Aleksa Sarai <[email protected]>
In order to avoid problems with security regressions going unnoticed,
add some unit tests that should make sure security regressions in cgroup
path safety cause tests to fail in runC.

Signed-off-by: Aleksa Sarai <[email protected]>
@hqhq
Copy link
Contributor

hqhq commented Feb 15, 2016

LGTM

@cyphar
Copy link
Member Author

cyphar commented Feb 16, 2016

/ping @crosbymichael @mlaventure @LK4D4

cgName := libcontainerUtils.CleanPath(c.Name)

innerPath := cgPath
if innerPath == "" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe just rename innerPath to cgPath to avoid temp variable

@crosbymichael
Copy link
Member

LGTM

crosbymichael added a commit that referenced this pull request Feb 16, 2016
libcontainer: cgroups: fs: fix innerPath
@crosbymichael crosbymichael merged commit 2b0a53b into opencontainers:master Feb 16, 2016
@cyphar cyphar deleted the fix-cgroup-path branch February 16, 2016 21:36
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.

5 participants