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
server: Canonize selinux label for comparison with filesystem label #5775
Conversation
|
Hi @manuelluis. Thanks for your PR. I'm waiting for a cri-o member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Signed-off-by: Manuel Luis Sanmartín Rozada <manuel.luis@gmail.com>
| if err != nil { | ||
| logrus.Errorf("Canonicalize label failed %s: %v", secLabel, err) | ||
| } else { | ||
| currentLabel, err := label.FileLabel(path) |
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.
should we Canonicalize this one as well, or do we think it'll be correct because we're reading it from disk (after it's been procesed by the kernel)
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.
From what I've seen, the kernel always saves it in the correct order, even if the attribute is with the mcs out of order.
I don't know if there is any filesystem that can skip the kernel ordering and return the mcs in the wrong order.
|
/ok-to-test Thanks for opening tihs! approach LGTM. Maybe we should create a test in |
…nux label Signed-off-by: Manuel Luis Sanmartín Rozada <manuel.luis@gmail.com>
|
/retest |
|
/approve LGTM, @cri-o/cri-o-maintainers PTAL |
|
/retest |
|
@saschagrunert PTAL |
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.
/lgtm
/retest-required
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: haircommander, manuelluis, saschagrunert The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
Integration tests have been fixed in another PR. |
|
/test integration_fedora |
|
/cherry-pick release-1.23 |
|
@haircommander: new pull request created: #5792 In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
What type of PR is this?
/kind bug
What this PR does / why we need it:
If you try to use the annotation: io.kubernetes.cri-o.TrySkipVolumeSELinuxLabel, It doesn't work because, the selinux label with the mcs from the annotation in the namespace, has the wrong order in the mcs.
The selinux label for the comparison with the label in the filesystem will be: system_u:object_r:container_file_t:s0:c75,c35
but in the filesystem the label is: system_u:object_r:container_file_t:s0:c35,c75
Which issue(s) this PR fixes:
Special notes for your reviewer:
Does this PR introduce a user-facing change?
None