-
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
Nested podman ignores error when mounting container root file system and requires --security-opt=seccomp=unconfined
in addition to --privileged
.
#8849
Comments
--security-opt=seccomp=unconfined
in addition to --privileged
.
Could you attach the AVCs that you saw? |
I don't see any. I ran the following after the failing examples listed above: $ sudo ausearch -m AVC,USER_AVC -ts today
<no matches> Though on my Ubuntu 20.04 system auditd is configured with the defaults which seem to include logins only. However
I am just concluding that an error is skipped here because it works if I add more options as described above. Also the fact that the Is there a particular command you want me to call or an auditd configuration I should apply that could provide more details? |
I am sorry, I was not paying attention. Yes it makes sense that seccomp would need to be disabled. We should do this automatically within the podman/stable container. You should not turn on seccomp when running within a container. Although since you are running a privileged container, this looks like a bug. We should not be turning on seccomp filtering when running in --privileged mode. |
Looks like current podman works correctly.
|
|
This behaves different on my host: $ podman -v
podman version 2.2.1
$ podman run -d --privileged fedora sleep 100
7e2136479b8c09433b8ccab1d242d15f8afa004027a60cb807616b18991148b0
$ podman top -l seccomp
SECCOMP
filter Apparently the
I ll check the tags I've built the podman binary with... |
Just to make sure, could you also check those fields on your terminal? $ grep -i Seccomp /proc/self/status Just making sure your user account does not have seccomp rules applied. |
sure:
When I run the commands above as root I get the same behaviour. I don't see any relevant difference regarding the build tags I've used. |
Very strange. |
Here is the code. Did you change the seccomp path in your containers.conf?
|
hm, no, I don't specify a seccomp profile explicitly. My
...and the podman debug log says Apparently |
When running a privileged container and `SeccompProfilePath` is empty no seccomp profile should be applied. (Previously this was the case only if `SeccompProfilePath` was set to a non-empty default path.) Closes containers#8849 Signed-off-by: Max Goltzsche <[email protected]>
While my PR fixed the seccomp behaviour for cases where the seccomp profile path is empty or a non-default path it would still cause the same buggy behaviour as described above if one would explicitly specify the default seccomp profile path as I understand the code. Also I think that an error is still ignored here somewhere. It should be reproducible after this merge using a |
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
When running podman 2.2.1 nested within a podman 2.2.1 container on an Ubuntu 20.04 host the file system of any inner container is empty and no error is logged.
The error can be solved by mounting the storage directory and setting
--security-opt=seccomp=unconfined
- though this differs from docker's behaviour where the--privileged
option is sufficient.More importantly, if not enough privileges have been granted, the mount should fail with a corresponding error instead of proceeding with an empty directory.
This is a follow-up issue of #4056 (comment).
Steps to reproduce the issue:
Run a podman container within a podman container (using this build on Ubuntu 20.04):
Verify that the file system of any nested container is empty:
When the storage directory is mounted to the outer podman container it seems to pass the previous error and I get another one (also in this case it doesn't matter if run with or without root) - this is related to #4131:
The last error can be solved by providing the option
--security-opt seccomp=unconfined
- relates to #4056.Describe the results you received:
While the outer container works fine the nested container's file system is empty but no error is logged about it.
Describe the results you expected:
The nested container's file system should be mounted properly containing the alpine image's contents.
If that does not work due to system restrictions podman should fail with a corresponding error which it currently seems to ignore silently.
Also it seems
--privileged
isn't granting enough privileges since--security-opt seccomp=unconfined
is required although, when using docker, only specifying the--privileged
option is sufficient. Ideally this should work with podman in the same way.Additional information you deem important (e.g. issue happens only occasionally):
I am using a custom, static, alpine-based podman build.
Though the only difference I noticed regarding the binaries within the official podman image
quay.io/podman/stable
is thefusermount3
version and changing that to use the same as the official podman image (3.9.3) also doesn't fix the problem.Output of
podman version
:Output of
podman info --debug
:Package info (e.g. output of
rpm -q podman
orapt list podman
):Custom, static, alpine-based podman build
Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide?
Yes
Additional environment details (AWS, VirtualBox, physical, etc.):
Bare metal Ubuntu 20.04 host.
The text was updated successfully, but these errors were encountered: