Replies: 5 comments 8 replies
-
@giuseppe PTAL - I imagine it's related to the rootless user namespace? |
Beta Was this translation helpful? Give feedback.
-
am I aware only of FUSE causing this kind of issues. From If I repeat your same test:
and from another shell:
|
Beta Was this translation helpful? Give feedback.
-
Another dimension: I mainly started this bug / topic because I liked the way this worked and I was trying to replicate the functionality using more primitive tools. My goal was to create a script / program / tool that can create a mount namespace, mount an encrypted filesystem like gocryptfs inside it, and launch a process, constraining the visibility of the mount to that process only / disallowing any other user processes to see it. Initially I implemented this by creating a mount namespace using I suppose this was only possible due to a bug in I know that linux namespaces / containers where designed to isolate the containerized process from the host and not vise-versa. Any hint, direction would be really appreciated |
Beta Was this translation helpful? Give feedback.
-
thanks for this guys I have been trying to figure out why /proc/pid/root/... is not accessible! although I am a little confused since 'allow_other' "should" ostensibly permit access via /proc/.../root but it does not, nor does allow_root, in fact setting mountopts in storage.conf does not appear to be applied subsequently to containers started. this is an issue for tools in the host namespaces that attempt to introspect on a containers env... for example 'jcmd' on the Java platform cannot 'attach' to a containerized JVM because of this issue. I was not able to successfully configure either 'allow_others' or 'allow_root' to determine if this resolves this issue, however in configuring podman to use the kernel overlay instead of overlayfs-fuse the access issue appears to be resolved. |
Beta Was this translation helpful? Give feedback.
-
I have to add that I believe this to be a BUG - certainly from the POV of the OS and contracts it defines & implements. I suspect that the issue with overlayfs-fuse is to do with uid mapping from the host -> container user ns, it is either that or an issue with mount ns mapping ... obviously the "workaround" is to not use overlayfs-fuse and employ the kernel overlay driver which works! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Issue Description
Normally, for every linux process we can access its view of the filesystem (including namespaces and the set of per-process mounts) through
/proc
pseudo-filesystem specifically through/proc/[pid]/root
for a given pid.I noticed that this applies to the containerized applications too, with the following exception:
When running a
rootful
podman container with e.g.sudo podman run --rm -it ubuntu
,I can find the PID of the shell inside the container from the host (using pgrep/htop or whatever) and I can peek into the container filesystem using
sudo ls -la /proc/<PID>/root/
When running a
rootless
podman container with e.g.podman run --rm -it ubuntu
(no sudo)I can find the PID of the shell inside the container from the host and but I CANNOT peek into the container filesystem from relevant
/proc/<PID>/root/
directory, with aPermission denied
error.Using either
ls -la /proc/<PID>/root/
orsudo ls -la /proc/<PID>/root/
, leads to:The
/proc/<PID>/root
symlink itself seems to be user owned and fully accessible by everyone because when executingls -la /proc/<PID>/root
(without the trailing slash) it gives me:I cannot understand why this happens. Tried various tests by creating namespaces (even nested) using the more primitive
unshare
command to create non-root mount namespaces with likeunshare -Umrfp --mount-proc /bin/bash
and in all my tests I could access the process' view of the filesystem through/proc
fs.Seems something special is happening in
rootless
podman containers that only someone with deep knowledge in podman's or runc's internals can explain.As another note, I can still use nsenter to enter rootless container's the namespace and peek into the filesystem, although an explanation why access through
/proc
is not working is still preferred.Steps to reproduce the issue
Steps to reproduce the issue
pid
of the process inside the container from the host/proc/<pid>/root/
from the host`Describe the results you received
Permission denied
error.Describe the results you expected
To be able to access the
/proc/<pid>/root/
symlink/directorypodman info output
Podman in a container
No
Privileged Or Rootless
Rootless
Upstream Latest Release
Yes
Additional environment details
No response
Additional information
No response
Beta Was this translation helpful? Give feedback.
All reactions