Bug 1883945
Summary: | Cannot mount /proc/net in a container as it is a symlink to /proc/self/net and not assigned proc_t | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 8 | Reporter: | Robb Manes <rmanes> |
Component: | container-selinux | Assignee: | Jindrich Novy <jnovy> |
Status: | CLOSED ERRATA | QA Contact: | Edward Shen <weshen> |
Severity: | medium | Docs Contact: | |
Priority: | unspecified | ||
Version: | 8.2 | CC: | dornelas, dwalsh, jnovy, kanderso, ptalbert, sgarciam, tsweeney, ypu |
Target Milestone: | rc | ||
Target Release: | 8.0 | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | container-selinux-2.148.0 or newer | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2021-02-16 14:21:54 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | |||
Bug Blocks: | 1186913, 1823908 |
Description
Robb Manes
2020-09-30 14:40:26 UTC
Just also pointing out that this fails as well identically, not just mounting /proc/self/net, I just included the symlinked version by accident in the initial bug report: # podman run --privileged --rm -ti -v /proc/net:/mnt/rootfs/proc/net nginx bash -c "ls /mnt/rootfs/proc/net &>/dev/null && echo Works" What exactly are you trying to do? Do you want to run a privileged container on the host network? podman run --privileged --net=host ... Should do that? >> What exactly are you trying to do? Do you want to run a privileged container on the host network?
We want to do what the bugzilla title says: mount /proc/net in a container. Not /proc nor / but /proc/net directly.
Why do you want to do this? >> Why do you want to do this?
Why not? Customers have their reasons and it just fails.
Is there a reason why /proc/net cannot be mounted not even with --privileged --net=host due to SELinux constrains as Robb explains? Is he wrong? Are we preventing such mount on purpose?
No we are failing to communicate. I am not against this, but I want to know what the customer is after. /proc/net is related to the network namespace that the container is running within. Mount the hosts /proc/net into the container makes little sense, and will probably not work the way that the customer thinks, at least as I understand it. Using --net=host which will use the /proc/net of the host, makes more sense and is not going to cause the kernel issues, I believe. This is what I am seeing when I do this: podman run --privileged -v /proc/net:/proc/net alpine echo hello Error: OCI runtime error: move mount to 'proc/net': Device or resource busy I have updated container-selinux to allow this, but I really would like to understand the goal. container-selinux-2.148.0-1 Customer is deploying an application from a 3rd party vendor which tries to mount /proc/net into a directory inside the pod to inspect the traffic and make cost estimation based on the data. It works in other environments (not OpenShift) but fails when using OpenShift and our RHCOS installation. I tend to not question customer needs more than the reasonable in order to help them. That's why I suggested to mount /proc and/or / and reach the content under /proc/net but as it's a 3rd party they can't change the way the application works. On the other hand, the fact that it's not related with the 3rd party application as a simple "podman run" also fails, we agreed to raise a bugzilla after Robb's troubleshooting at a low level. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (Moderate: container-tools:rhel8 security, bug fix, and enhancement update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2021:0531 |