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 1286602 - Operation not supported for chattr +C on volume
Summary: Operation not supported for chattr +C on volume
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: docker
Version: 7.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Daniel Walsh
QA Contact: atomic-bugs@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-11-30 10:06 UTC by Jan Pazdziora
Modified: 2019-03-06 00:58 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-11-30 21:52:20 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Jan Pazdziora 2015-11-30 10:06:05 UTC
Description of problem:

Running chattr +C fails on directory on bind-mounted volume. It does not fail on directory on root (in the container) filesystem.

Version-Release number of selected component (if applicable):

docker-1.8.2-8.el7.x86_64

How reproducible:

Deterministic.

Steps to Reproduce:
1. rm -rf /opt/data ; mkdir /opt/data
2. docker run -ti -v /opt/data:/data:Z rhel7 bash
   [root@2f67b2197251 /]# 
3. [root@2f67b2197251 /]# mkdir /data/test
4. [root@2f67b2197251 /]# yum install -y /usr/bin/chattr
5. [root@2f67b2197251 /]# chattr +C /data/test

Actual results:

chattr: Operation not supported while setting flags on /data/test

Expected results:

No error.

Additional info:

Note that

[root@4b1c4d00a2aa /]# mkdir /opt/data ; chattr +C /opt/data

passes.

This actually comes from latest Fedora images that define +C in tmpfiles.d for /var/log/journal.

Comment 1 Daniel Walsh 2015-11-30 15:01:05 UTC
Does this happen in permissive mode?

Any AVC's ausearch -m avc -ts recent

If it still breaks in permissive mode, could you try it in --privileged

Works for me on Rawhide.

docker run -ti -v /opt/data:/data:Z fedora bash
[root@aa75c689dfbd /]# chattr -C /data/
[root@aa75c689dfbd /]#

In Enforcing mode.

Comment 2 Jan Pazdziora 2015-11-30 15:10:14 UTC
(In reply to Daniel Walsh from comment #1)
> Does this happen in permissive mode?
> 
> Any AVC's ausearch -m avc -ts recent
> 
> If it still breaks in permissive mode, could you try it in --privileged
> 
> Works for me on Rawhide.
> 
> docker run -ti -v /opt/data:/data:Z fedora bash
> [root@aa75c689dfbd /]# chattr -C /data/
> [root@aa75c689dfbd /]#
> 
> In Enforcing mode.

On RHEL 7, this happens in permissive and with --privileged as well. No AVC denials are logged. chattr -C /data/ does not work either.

Comment 3 Jan Pazdziora 2015-11-30 15:12:17 UTC
(In reply to Jan Pazdziora from comment #2)
> 
> chattr -C /data/ does not work either.

Actually: chattr -C works. It's chattr +C which does not work, no matter if on /data/test or /data/.

Comment 4 Daniel Walsh 2015-11-30 16:31:49 UTC
Does it work if you run it on the host?

Comment 5 Daniel Walsh 2015-11-30 16:34:41 UTC
chattr -C only works on COW file systems.

On rhel7 I execute

mkdir /opt/data
chattr -C /opt/data
chattr: Operation not supported while setting flags on /opt/data.

So this is an issue with rhel7 not docker.


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