Skip to content
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

Fix relabeling failures with Z/z volumes on Mac #22290

Merged
merged 1 commit into from
Apr 9, 2024

Conversation

n1hility
Copy link
Member

@n1hility n1hility commented Apr 6, 2024

Fixes #19852

Non-Linux systems, such as BSD derived kernels, constrain selinux xatter updates according to file permissions. This is in contrast to Linux selinux attr writes, which are governed by an selinux policy. By dafault this policy apllows users to relabel files owned by themselves even if file perms would otherwise disallow write.

This results in robust container relabeling results on Linux, and fragile results everywhere else. Therefore, change the mac policy to force the nfs_t context on all files, and ignore all relabel events.

As a side-effect, this will disallow any ability to store custom selinux contexts on files. However, this is of limited use in a machine context with host volumes, since files in these volumes are externally managed on systems which do not support SELinux.

Fixes EACCESS failures on Mac volumes when using Z/z options on a directory with read only files (#19852)

Copy link
Contributor

openshift-ci bot commented Apr 6, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: n1hility

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 6, 2024
@rhatdan
Copy link
Member

rhatdan commented Apr 6, 2024

LGTM
Although tests are not happy.

@n1hility n1hility force-pushed the fix-z-mac branch 3 times, most recently from 8248729 to 669b8ed Compare April 6, 2024 17:41
@n1hility
Copy link
Member Author

n1hility commented Apr 6, 2024

/cherry-pick v5.0

@openshift-cherrypick-robot
Copy link
Collaborator

@n1hility: once the present PR merges, I will cherry-pick it on top of v5.0 in a new PR and assign it to you.

In response to this:

/cherry-pick v5.0

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.

@n1hility n1hility force-pushed the fix-z-mac branch 3 times, most recently from a8d729f to 6b2e5fe Compare April 8, 2024 14:28
Non-Linux systems, such as BSD kernels, constrain xatter updates
according to file permissions. This is in contrast to Linux selinux
attr writes, which are governed by an selinux policy. By dafault this
policy apllows users to relabel files owned by themselves even if file
perms would otherwise disallow write.

This results in robust container relabeling results on Linux, and
fragile results everywhere else. Therefore, change the mac policy to
force the nfs_t context on all files, and ignore all relabel
events.

As a side-effect, this will disallow any ability to store custom
selinux constants on files. However, this is of limited use in
a machine context, since files in these volumes are externally
managed on systems which do not support SELinux.

Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
Copy link
Member

@Luap99 Luap99 left a comment

Choose a reason for hiding this comment

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

LGTM
@ashley-cui @baude PTAL

@mheon
Copy link
Member

mheon commented Apr 8, 2024

LGTM, but I would like confirmation from someone more familiar with the Mac side before merge.

@baude
Copy link
Member

baude commented Apr 9, 2024

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 9, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit 52e1d38 into containers:main Apr 9, 2024
94 checks passed
@openshift-cherrypick-robot
Copy link
Collaborator

@n1hility: new pull request created: #22321

In response to this:

/cherry-pick v5.0

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.

@stale-locking-app stale-locking-app bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Jul 9, 2024
@stale-locking-app stale-locking-app bot locked as resolved and limited conversation to collaborators Jul 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. machine release-note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

podman compose it not working on some projects on macOS
7 participants