Skip to content

Misc fixups - #72

Open
kolyshkin wants to merge 2 commits into
opencontainers:mainfrom
kolyshkin:fixups
Open

Misc fixups#72
kolyshkin wants to merge 2 commits into
opencontainers:mainfrom
kolyshkin:fixups

Conversation

@kolyshkin

Copy link
Copy Markdown
Contributor

A couple of small fixes to issues found by Project Glasswing which are not security vulnerabilities.

Current check is not entirely adequate as it will allow writing pid to a
cgroup with a name that is prefixed with the current cgroup name. For
example, if current cgroup path ends in "/something", AddPid allows
subcgroup to be "../somethingELSE".

This is a correctness (rather than a security) fix as runc exec --cgroup
(AFAIK the only user) has own checks, too.

Fixes: 304da79 ("Implement AddPid method for cgroup managers")
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
@kolyshkin kolyshkin added this to the 0.0.9 milestone Aug 5, 2026
@kolyshkin
kolyshkin requested a review from a team as a code owner August 5, 2026 02:38

@thaJeztah thaJeztah left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

left one suggestion

Comment thread fs/fs.go
@@ -154,7 +154,8 @@ func (m *Manager) AddPid(subcgroup string, pid int) (retErr error) {

for _, dir := range m.paths {
path := path.Join(dir, subcgroup)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We should use filepath.Join here as well; even though it's identical here, it's the package intended for file-path operations.

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.

2 participants