-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Need to setup labeling of kernel keyrings. #2012
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,7 +5,7 @@ github.com/opencontainers/runtime-spec 29686dbc5559d93fb1ef402eeda3e35c38d75af4 | |
| # Core libcontainer functionality. | ||
| github.com/checkpoint-restore/go-criu v3.11 | ||
| github.com/mrunalp/fileutils ed869b029674c0e9ce4c0dfa781405c2d9946d08 | ||
| github.com/opencontainers/selinux v1.0.0-rc1 | ||
| github.com/opencontainers/selinux v1.2 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (not directly related to this PR); I noticed that these tags miss a trailing
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can add another .0 if necessary. in the next version.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks! I noticed it earlier this week, and this PR made me remember that I saw that 🤗 |
||
| github.com/seccomp/libseccomp-golang 84e90a91acea0f4e51e62bc1a75de18b1fc0790f | ||
| github.com/sirupsen/logrus a3f95b5c423586578a4e099b11a46c2479628cac | ||
| github.com/syndtr/gocapability db04d3cc01c8b54962a58ec7e491717d06cfcc16 | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to double-check -- are you sure this needs to be done before we create a new session? (Is
SetKeyLabelsetting what the label will be for all future keys or the label for the current key?)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes this says to the kernel, any new keyrings that get created by this process and its children should get created with the specified label.
When the new keyring gets created it gets created with the correct label.
Later on the defaulf SetKeyLabel("") tells the kernel to go back to the default labeling.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW I have been testing this patch with the updated kernel, which allows sepate kernel keyrings for each new UserNamespace.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not clear why we need to reset it back. Shouldn't it pass down to the container process?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it will, the reset is on defer. Not really important for runc, but if people vendor in this code, then we would want to make sure other code paths don't accidently set the label to this container.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, we've discussed the
deferhandling for SELinux in the past. Even though it doesn't really make sense forruncit avoids people vendoring it and shooting themselves in the foot (not that SELinux is the only thing that is a massive foot-gun inlibcontainer).