-
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
podman run volume mount option "z" does not relabel mount point and contents #10273
Comments
What kind of file system is mounted at /mnt/nbconf? This works perfectly for me:
|
Hi @rhatdan , |
That explains it. I deliberately disabled labeling of volume plugins given
that they may be different devices not managed by Podman. Does Docker
relabel these?
…On Mon, May 10, 2021 at 10:58 Vikas Goel ***@***.***> wrote:
Hi @rhatdan <https://github.com/rhatdan> ,
It is a loop device. https://github.com/vikas-goel/filevol
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#10273 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB3AOCDHPJSOQRDLRMYN5SDTM7YAJANCNFSM44LLCOXA>
.
|
Yes, Docker relabels all kinds of volumes to |
Ok. Simple fix, then - should be in Podman 3.2, RHEL 8.4.0.2
…On Mon, May 10, 2021 at 11:08 Vikas Goel ***@***.***> wrote:
Yes, Docker relabels all kinds of volumes. Docker supports uppercase Z
too that would set MCS of the container on the volume and contents.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#10273 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB3AOCAMZD3A7JRUV5XSZVTTM7ZG3ANCNFSM44LLCOXA>
.
|
Thanks @mheon . What's the plan to introduce uppercase |
Same change will do both
…On Mon, May 10, 2021 at 12:41 Vikas Goel ***@***.***> wrote:
Thanks @mheon <https://github.com/mheon> . What's the plan to introduce
uppercase Z support?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#10273 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB3AOCCLRW7AY3NK27D2W5DTNAEDTANCNFSM44LLCOXA>
.
|
Fantastic. The podman manual/doc does not talk about uppercase |
The uppercase |
Yeah, this has proved to be a bit more complex than I expected. I’ll take a
further look on Thursday.
…On Mon, May 10, 2021 at 17:24 Vikas Goel ***@***.***> wrote:
The uppercase Z is not effective on local volumes. No MCS category ids
get set.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#10273 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB3AOCDC3SNHJRHFB7CXQUTTNBFJXANCNFSM44LLCOXA>
.
|
Docker allows relabeling of any volume passed in via -v, even including named volumes. This normally isn't an issue at all, given named volumes get the right label for container access automatically, but this becomes an issue when volume plugins are involved - these aren't managed by Podman, and may well be unaware of SELinux labelling. We could automatically relabel these volumes on creation, but I'm still reluctant to do that (feels like it could break things). Instead, let's allow :z and :Z to be used with named volumes, so users can explicitly request relabel of a volume plugin-backed volume. We also get :U at the same time. I don't see any real need for it but it also doesn't seem to hurt, so I didn't bother disabling it. Fixes containers#10273 Signed-off-by: Matthew Heon <mheon@redhat.com>
Thank you @mheon. I can verify the fix on my setup if I get a package for RHEL8.4 Beta. |
8, or Stream 8? It ought to be in Stream 8 already. I don't know whether non-Stream 8 will update to 8.4.x before it EOLs, but if it does it will include this. |
Yes, Stream-8. The latest version there is 3.1.0. http://mirror.centos.org/centos/8-stream/AppStream/x86_64/os/Packages/ Am I looking at wrong location? |
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
When a volume is mounted to a container with SELinux
z
option withpodman run
command, the volume remains unlabeled. Thez
option has no effect. The container processes cannot access the mount point and the contents.Steps to reproduce the issue:
Create a persistent named volume
podman volume create --driver <driver-name> nbconf
Start a container with the volume
podman run -dt --volume nbconf:/mnt/nbconf:z --name tme-mas-02 <container-image>
Access the mount point inside the container
podman exec -it tme-mas-02 bash
followed byls -l /mnt/nbconf
Describe the results you received:
Describe the results you expected:
The expected result is that the mount point and contents are relabeled to container_file_t. Docker does it when
z
option is specified.Additional information you deem important (e.g. issue happens only occasionally):
Consistent
Output of
podman version
:Output of
podman info --debug
:Package info (e.g. output of
rpm -q podman
orapt list podman
):Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/master/troubleshooting.md)
No
Additional environment details (AWS, VirtualBox, physical, etc.):
Red Hat Enterprise Linux 8.4 Beta
VMware virtual machine
The text was updated successfully, but these errors were encountered: