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.
Bug 2102361 - Mostly-confined containers which create their own user and mount namespaces can't mount overlay filesystems
Summary: Mostly-confined containers which create their own user and mount namespaces c...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: container-selinux
Version: 8.6
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Jindrich Novy
QA Contact: Edward Shen
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-06-29 19:06 UTC by Nalin Dahyabhai
Modified: 2022-11-08 09:35 UTC (History)
5 users (show)

Fixed In Version: container-selinux-2.188.0-1.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2105071 (view as bug list)
Environment:
Last Closed: 2022-11-08 09:16:27 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-126658 0 None None None 2022-06-29 19:21:51 UTC
Red Hat Product Errata RHSA-2022:7457 0 None None None 2022-11-08 09:16:49 UTC

Description Nalin 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.

Comment 3 Tom Sweeney 2022-06-30 15:41:54 UTC
Before moving, I'd like Dan to weigh in.  @dornelas do you have other thoughts for a proper home for this?

Comment 4 Daniel Walsh 2022-06-30 17:13:20 UTC
This is a container-selinux bugzilla, but OpenShift basically needs to update to the latest container-selinux package in RHEL8.6.

Comment 5 Jindrich Novy 2022-06-30 17:48:13 UTC
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.

Comment 6 Derrick Ornelas 2022-07-06 18:29:59 UTC
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?

Comment 8 Derrick Ornelas 2022-07-07 20:22:05 UTC
I cloned this as BZ 2105071 for OCP 4.12.

Comment 14 errata-xmlrpc 2022-11-08 09:16:27 UTC
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


Note You need to log in before you can comment on or make changes to this bug.