Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
DescriptionNalin Dahyabhai
2022-06-29 19:06:18 UTC
Description of problem:
My confined container can't mount an overlay filesystem, even though it's in its own user namespace.
Version-Release number of selected component (if applicable):
container-selinux-2.173.1-0.rhaos4.10.el8.6
How reproducible:
Always
Steps to Reproduce:
1. Bring up an OpenShift 4.11 development cluster.
2. `oc apply -f` this pod spec, which includes annotations which tell CRI-O to run the pod's containers in a user namespace:
---
apiVersion: v1
kind: Pod
metadata:
name: overlay-mount-test
annotations:
io.openshift.builder: ""
io.kubernetes.cri-o.userns-mode: "auto:size=65536"
spec:
volumes:
- name: plain
emptyDir:
containers:
- name: userns-test
image: registry.redhat.io/ubi8/ubi
volumeMounts:
- mountPath: /test
name: plain
securityContext:
capabilities:
add:
- CAP_SETFCAP
command: ["sh", "-c", "mkdir -p /test/lower /test/upper /test/work /test/merged; unshare -Urm mount -t overlay -o lowerdir=/test/lower,upperdir=/test/upper,workdir=/test/work overlay /test/merged && echo success || echo failure ; sleep infinity"]
3. Use `oc logs pod/overlay-mount-test` to see if it succeeded. If it failed, use `oc describe pod/overlay-mount-test` to figure out which node the pod ran on, `oc debug node/$node` to get onto the node, then chroot and use ausearch to find out why.
Actual results:
The mount command failed. Running the audit log through audit2allow suggests "allow container_t fs_t:filesystem mount;", among other things.
Expected results:
The mount command should have succeeded.
Additional info:
This should be allowed by https://github.com/containers/container-selinux/pull/181, but we need to backport it.
OK, container-selinux is now updated to:
rhaos-4.11-rhel-8 container-selinux 2:2.188.0-1.rhaos4.11
rhaos-4.12-rhel-8 container-selinux 2:2.188.0-1.rhaos4.12
stream-container-tools-rhel8-rhel-8.6.1 container-selinux 2:2.188.0-1
The stream-container-tools-rhel8-rhel-8.6.1 is dedicated to 8.6.0.2.
We could clone this to OCP Containers, but Jindrich has already done the dist-git work and doesn't need the BZ for the commit(s). The main advantage of having the OCP clone(s) would be that the fix would be explicitly tested by QE. Is this important enough that we want to test and verify the fix for, say, 4.11.z?
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-2022:7457
Description of problem: My confined container can't mount an overlay filesystem, even though it's in its own user namespace. Version-Release number of selected component (if applicable): container-selinux-2.173.1-0.rhaos4.10.el8.6 How reproducible: Always Steps to Reproduce: 1. Bring up an OpenShift 4.11 development cluster. 2. `oc apply -f` this pod spec, which includes annotations which tell CRI-O to run the pod's containers in a user namespace: --- apiVersion: v1 kind: Pod metadata: name: overlay-mount-test annotations: io.openshift.builder: "" io.kubernetes.cri-o.userns-mode: "auto:size=65536" spec: volumes: - name: plain emptyDir: containers: - name: userns-test image: registry.redhat.io/ubi8/ubi volumeMounts: - mountPath: /test name: plain securityContext: capabilities: add: - CAP_SETFCAP command: ["sh", "-c", "mkdir -p /test/lower /test/upper /test/work /test/merged; unshare -Urm mount -t overlay -o lowerdir=/test/lower,upperdir=/test/upper,workdir=/test/work overlay /test/merged && echo success || echo failure ; sleep infinity"] 3. Use `oc logs pod/overlay-mount-test` to see if it succeeded. If it failed, use `oc describe pod/overlay-mount-test` to figure out which node the pod ran on, `oc debug node/$node` to get onto the node, then chroot and use ausearch to find out why. Actual results: The mount command failed. Running the audit log through audit2allow suggests "allow container_t fs_t:filesystem mount;", among other things. Expected results: The mount command should have succeeded. Additional info: This should be allowed by https://github.com/containers/container-selinux/pull/181, but we need to backport it.