-
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
Rootless Podman exposes whole /sys/fs/cgroup/ to container while in "partial" isolation #20073
Comments
We're already hit by this issue, e.g. nginxinc/docker-nginx#701. |
@giuseppe PTAL |
commit cf36470 changed the way /sys/fs/cgroup is mounted when there is not a netns and it now honors the ro flag. The mount was created using a bind mount that is a problem when using a cgroup namespace, fix that by mounting a fresh cgroup file system. Closes: containers#20073 Signed-off-by: Giuseppe Scrivano <[email protected]>
thanks, opened a PR: #20086 Please be aware that it fixes only the cgroup mounted on the top of |
commit cf36470 changed the way /sys/fs/cgroup is mounted when there is not a netns and it now honors the ro flag. The mount was created using a bind mount that is a problem when using a cgroup namespace, fix that by mounting a fresh cgroup file system. Closes: containers#20073 Signed-off-by: Giuseppe Scrivano <[email protected]>
Issue Description
Rootless Podman exposes whole
/sys/fs/cgroup/
to container while in "partial" isolation.Correct behavior (achieved with
--systemd=always
):Hovewer,
/proc/self/mountinfo
and/proc/self/cgroup
look "sane" (but they're not).$ podman run --rm --network=host docker.io/library/debian sh -ec 'cat /proc/self/cgroup ; echo ; grep cgroup /proc/self/mountinfo' 0::/ 582 580 0:26 /../../../../../.. /sys/fs/cgroup rw,nosuid,nodev,noexec,relatime - cgroup2 cgroup2 rw,nsdelegate,memory_recursiveprot 597 582 0:26 /../../../../../.. /sys/fs/cgroup ro,nosuid,nodev,noexec,relatime - cgroup2 cgroup2 rw,nsdelegate,memory_recursiveprot
Correct behavior:
$ podman run --rm --network=host --systemd=always docker.io/library/debian sh -ec 'cat /proc/self/cgroup ; echo ; grep cgroup /proc/self/mountinfo' 0::/ 584 582 0:26 /../../../../../.. /sys/fs/cgroup rw,nosuid,nodev,noexec,relatime - cgroup2 cgroup2 rw,nsdelegate,memory_recursiveprot 601 584 0:79 / /sys/fs/cgroup rw,relatime - tmpfs tmpfs rw,size=4k,nr_inodes=1,uid=1000,gid=1000,inode64 602 601 0:26 / /sys/fs/cgroup rw,relatime - cgroup2 cgroup2 rw,nsdelegate,memory_recursiveprot
Steps to reproduce the issue
Steps to reproduce the issue
--network=host
) and with systemd in "auto" mode (i.e. not specifying--systemd=always
)./sys/fs/cgroup/
.Example:
Describe the results you received
Describe the results you expected
podman info output
Podman in a container
No
Privileged Or Rootless
Rootless
Upstream Latest Release
Yes
Additional environment details
Additional environment details
Additional information
Running rootless Podman:
Running rootful Podman:
The text was updated successfully, but these errors were encountered: