Closed debarshiray closed 4 years ago
Thanks @debarshiray for your detective work!
personally I'd prefer to solve it with something like --mount type=tmpfs,target=/sys/fs/selinux
but we need a way to disable tmpcopyup
from the options otherwise it cannot be used for this specific case.
I've opened a PR to add support for notmpcopyup
: https://github.com/containers/libpod/pull/4466
What is the problem you are trying to solve? Why is /sys/fs/selinux getting mounted when --privileged? This would seem to be a problem in that libselinux would start to act on the fact that selinux is enabled and could get permission denied trying to set xattrs.
the feature I've added is more generic, we currently have no way to disable tmpcopyup
. It is fine to use it by default, but there should be a way to mount an empty tmpfs
Agree, I like your PR, I am just asking why we are mounting this and what trouble it is causing.
I am just asking why we are mounting this and what trouble it is causing
I've not verified but that can be an effect of bind mounting /sys
(since we cannot mount a new instance with --network host
) and skipping masked paths when --privileged
is used.
I don't think we should treat /sys/fs/selinux
different than other masked paths. If --privileged
is used and that path must be masked, then it should be done explicitly.
Makes sense.
I am just asking why we are mounting this and what trouble it is causing
[...]
I don't think we should treat
/sys/fs/selinux
different than other masked paths. If--privileged
is used and that path must be masked, then it should be done explicitly.
This is now fixed in Toolbox with https://github.com/containers/toolbox/pull/337
I am wondering if this should still be fixed in Podman itself, or is it so that --network host --privileged
implies that /sys/fs/selinux
would have a selinuxfs
instance?
The issue is if someone wanted to SELinux stuff from a process within a container, we need the process to know that SELinux is enabled.
/kind bug
Description
Looks like https://github.com/containers/toolbox/issues/47 has raised its head again.
An instance of
selinuxfs
is getting mounted at/sys/fs/selinux
when both--network host
and--privileged
are used.Compare:
Output of
podman version
:Output of
podman info --debug
:Package info (e.g. output of
rpm -q podman
orapt list podman
):