-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
cp -afl --preserve=xattr failing on directories #5781
Comments
This is probably an SELinux issue. I would figure it is getting permission denied when it attempts to reset the SELinux labels. |
Are you seeing AVC messages? |
I am not seeing any AVC messages. Although I'm not entirely sure it's related. |
The problem I because you are attempting to set labels on fuse-overlayfs and that is not allowed. As root is it also not allowed, since the container uses a context mount on overlay. I have no idea why this is allowed on Docker, other then perhaps you aren't using overlay or SELinux is not enabled inside the container.
|
Definitely SELinux and not much we can do about it. |
Hmm... This is from building quilt-native in a yocto build running inside a podman container. I'm not really sure what Xattrs they are trying to preserve. Is there a way to disable SELinux for now? |
No the issue is cp is seeing the SELinux labels and trying to maintain them. It is too bad the kernel is not a little smarter or cp, in that it is attempting to set the same Xattr that is already on disk. |
Thanks for the info. I guess I'm left wondering how Docker mitigates this. |
The docker version you are using is not using SELinux for separation. |
It is an image that I built from a Dockerfile, yes. But the issue manifests while I'm running the cp command inside the image. |
And you can not change the Dockerfile? We might want to look at not setting up the mount label when running with SELinux disabled. But this still would not allow this to work on a rootless podman. |
Yes I can change the Dockerfile. I'm currently using One more piece of information. If I disable SELinux on my host machine before building the image by doing |
|
xedrac, I am talking about disabling SELinux on the host, not about putting it in permissive mode. But this is not something I am recommending. I think it is best to eliminate the preservation of the xattrs. I am not sure what you are worried about copying from there. |
I would eliminate it, but that command is buried deep in what is considered a read-only yocto (poky) repository. I generate these images so infrequently that I would rather disable SELinux temporarily just to produce a functional image. However, I'm a little confused. Doesn't setting SELinux to permissive mode mean that it will not enforce any policies, just logs warnings? If this is true, I would have expected that change to get me beyond this issue. Either way, I've battled this a little too long and had to temporarily revert back to cgroupsv1 and docker in order to meet a deadline. I'll resume my dance with podman at another time. Thank you both for your help! |
since you are using fuse-overlayfs, there is an option that tells fuse-overlayfs to disable xattrs support, you can try by creating a container like:
I think this could solve the issue you've |
@xedrac does the proposed solution work for you? |
I'm not currently in a position to test it unfortunately. It looks like a promising workaround for sure. Once I've finished what I'm working on, I'll revert back to cgroupsv2 and try again. But that might be a few weeks. |
A friendly reminder that this issue had no activity for 30 days. |
I am going to close this since we have a work around. |
I just ran into this issue, also with a yocto/open-embedded build. For reference, the following command works for me: podman --storage-opt overlay.mount_program=/usr/bin/fuse-overlayfs --storage-opt overlay.mountopt=nodev,metacopy=on,noxattrs=1 run ... |
I tried to run the command. but it throws error. $ podman --storage-opt overlay.mount_program=/usr/bin/fuse-overlayfs --storage-opt overlay.mountopt=nodev,metacopy=on,noxattrs=1 run ... |
Is storage driver overlay? |
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
When executing
cp -afl --preserve=xattr <dir0> <dir1)
in a podman container, it appears that podman is attempting to create hard-links for the directories themselves (which is not permitted, even as root), rather than copy the directory names and create hard-links for the files. If I remove the--preserve=xattr
, it works as expected. Note that this works correctly in Docker.Steps to reproduce the issue:
podman run -it <hash> bash
mkdir /tmp/systemd
cp -afl --preserve=xattr /etc/systemd/* /tmp/systemd
Describe the results you received:
Describe the results you expected:
Additional information you deem important (e.g. issue happens only occasionally):
Output of
podman version
:Output of
podman info --debug
:Package info (e.g. output of
rpm -q podman
orapt list podman
):Additional environment details (AWS, VirtualBox, physical, etc.):
physical
The text was updated successfully, but these errors were encountered: