Misc fixups - #72
Open
kolyshkin wants to merge 2 commits into
Open
Conversation
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>
thaJeztah
approved these changes
Aug 5, 2026
| @@ -154,7 +154,8 @@ func (m *Manager) AddPid(subcgroup string, pid int) (retErr error) { | |||
|
|
|||
| for _, dir := range m.paths { | |||
| path := path.Join(dir, subcgroup) | |||
Member
There was a problem hiding this comment.
We should use filepath.Join here as well; even though it's identical here, it's the package intended for file-path operations.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A couple of small fixes to issues found by Project Glasswing which are not security vulnerabilities.