Closed zackman0010 closed 2 years ago
@rhatdan PTAL
@rhatdan Unfortunately not, still same error after running those commands. The folders were relabeled successfully, but volume still would not create.
So I was looking through the code in the 4.1.1 tag and traced the error.
The specific error being thrown is located in LabelVolumePath. The call that causes the error is SELinux's Relabel
function, which ends up going down through the chcon
function with recurse
set to true. This ends up going to a badPrefix function, which explicitly excludes the /usr directory from being used as a prefix.
However, the logic in these functions has changed since 4.1.1, and that badPrefix function doesn't even exist anymore. I actually found the relevant commit in the SELinux repository.
Updating to the latest version of Podman would probably fix my issue, but unfortunately it's not available through the RHEL repositories yet. Is there anywhere I can download an RPM of the latest version, or do I have to build it from source?
4.2 should be available for RHEL very soon if not already, otherwise you need to build from source. Since this is fixed in the upstream I am closing.
Looks like the updated version of SELinux that allows /usr to be used isn't included until Podman 4.3, so I guess I'll see if our system admins will build it from the source. Thanks!
@mheon Any chance we can get this updated in podman 4.3.1?
Confirmed that it works after building version 4.3 from source. Thanks again for the help, sorry for the pointless issue!
@rhatdan Was this fixed in a specific PR? Is it just a new selinux vendor?
@ashley-cui FYI
The issue was fixed with the update from SELinux 1.10.1->1.10.2, which happened in this commit: https://github.com/containers/podman/commit/f00ceaabd497e87415f6926de50478260cd7e844
The SELinux commit that fixed it was this: https://github.com/opencontainers/selinux/commit/d3ccb697e01d1671de2f1dd32779efe8808e2132
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
Our current setup uses the
~/.config/containers/storage.conf
file to overwritegraphroot
androotless_storage_path
to a folder/usr/local/csapps/podman/storage
. This folder is owned by thecsapp
user. We do not have root access, so we are utilizing rootless Podman. Attempting to create a volume usingpodman volume create test
fails with an error:error setting selinux label for /usr/local/csapps/podman/storage/volumes/test/_data to "system_u:object_r:container_file_t:s0:c171,c569" as shared: relabeling content in /usr is not allowed
We use the folder
/usr/local/csapps
as the central storage for all our applications, and that is where our system admins give us storage space to utilize. The only "workaround" we've found so far is to disable SELinux, but that's not feasible and our system admins would strongly prefer not to go that route. Is there anything we can do to allow us to use our existing folder structure without having to disable SELinux?Steps to reproduce the issue:
Overwrite
graphroot
androotless_storage_path
to a folder nested under/usr
podman volume create test
Describe the results you received:
error setting selinux label for /usr/local/csapps/podman/storage/volumes/test/_data to "system_u:object_r:container_file_t:s0:c171,c569" as shared: relabeling content in /usr is not allowed
Describe the results you expected: Volume to successfully be created
Additional information you deem important (e.g. issue happens only occasionally): I've recreated this error on a local device I do have root access to, so I can do any testing necessary.
Output of
podman version
:Output of
podman info
:Package info (e.g. output of
rpm -q podman
orapt list podman
orbrew info podman
):Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/main/troubleshooting.md)
I've tested with the latest version available on the RHEL 8 repositories. Yes, I checked the Podman Troubleshooting Guide