-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
applehv: Cannot relabel files without write permission on virtiofs #21269
Comments
@rhatdan PTAL |
Could you show me the mounted file system within the linux box. Basically I want to see how $HOME is defined in Linux via the mount command. mount |
Ok I did it on my mac, and see that the content is labeled as unlabeled_t instead of the expected virtiofs_t. I think for now the best we can do is disable SELinux separation for this container and then work to fix this. One option would be to ignore the error, but that might just cause further breakage. If I get the content labeled as virtiofs_t, then I could allow containers to read/write this content (virtiofs_t) always, probably via a boolean. I am not sure you are able to relabel read/only content anywhere inside of a VM. so this is a strange situation. |
I searched and it seems to be the same problem as below. |
As reported in this Issue(#21085),
|
In lima, the mount option sets the context of the /Users directory to nfs_t. This allows lima with virtiofs to bind mount without the
I'm not sure if this approach is correct, this at least fully works as expected. |
…file_t While this is potentially a security problem, it solves the issues of users sharing content from the host into containers and attempting to relabel it. From a security point of view this means all content volume mounted from the host into the podman machine on apple hypervisor is read/write from an SELinux point of view if it is volume mounted into the container. If the user attempts to use :Z it will work and relabel the content to be only usable bu the specify container. :z will continue to work, but will have no effect since the content is already labeled with a shared content label. Helps Fix: containers#21269 Signed-off-by: Daniel J Walsh <[email protected]>
While this is potentially a security problem, it solves the issues of users sharing content from the host into containers and attempting to relabel it. From a security point of view this means all content volume mounted from the host into the podman machine on apple hypervisor is read/write from an SELinux point of view if it is volume mounted into the container. If the user attempts to use :Z or :z it will work and relabel the content to be only usable bu the specify container. Helps Fix: containers#21269 Signed-off-by: Daniel J Walsh <[email protected]>
Issue Description
When trying to bind-mount files without write permission (e.g. .git/objects/pack/*) with
:Z
,Permission denied
error occurs.Steps to reproduce the issue
Steps to reproduce the issue
Granting write permissions to a file can relabel it.
It is also relabelable on Podman machine (FCOS) file system, even read-only.
Describe the results you received
Describe the results you expected
podman info output
Podman in a container
No
Privileged Or Rootless
None
Upstream Latest Release
Yes
Additional environment details
Additional information
Additional information like issue happens only occasionally or issue happens with a particular architecture or on a particular setting
The text was updated successfully, but these errors were encountered: