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 717951 - access to a loop device is denied to quota utilities
Summary: access to a loop device is denied to quota utilities
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: selinux-policy
Version: 6.1
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Miroslav Grepl
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On:
Blocks: 685101
TreeView+ depends on / blocked
 
Reported: 2011-06-30 14:05 UTC by Karel Volný
Modified: 2011-07-25 13:21 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-07-25 13:21:41 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Karel Volný 2011-06-30 14:05:18 UTC
Description of problem:
Trying to run the test /CoreOS/quota/Regression/bz77871-grace-period-not-shown I'm getting selinux denials ...

The test mounts a filesystem on /dev/loopN to a user home directory, then it tries to setup quota on it, but quotacheck fails due to selinux denial.

Version-Release number of selected component (if applicable):
selinux-policy-3.7.19-54.el6_0.5.noarch

How reproducible:
always

Steps to Reproduce:
1. mount a loop device into /your/mount with quota enabled (-o loop,usrquota)
2. quotacheck -c /your/mount
  
Actual results:
type=1400 audit(1309440738.774:30706): avc:  denied  { write } for  pid=12335 comm="quotacheck" name="/" dev=loop0 ino=2 scontext=unconfined_u:unconfined_r:quota_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:user_home_dir_t:s0 tclass=dir

Expected results:
quotacheck is allowed access to the device

Additional info:
I guess quota should be allowed to access any device it can run upon ...

note that with setenforce 0, letting the test to continue, I get bunch of other errors, including "quotaon" being denied to access aquota.user

SELinux: initialized (dev loop0, type ext2), uses xattr
type=1400 audit(1309442058.717:30708): avc:  denied  { write } for  pid=13344 comm="quotacheck" name="/" dev=loop0 ino=2 scontext=unconfined_u:unconfined_r:quota_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:user_home_dir_t:s0 tclass=dir
type=1400 audit(1309442058.843:30709): avc:  denied  { add_name } for  pid=13344 comm="quotacheck" name="aquota.user.new" scontext=unconfined_u:unconfined_r:quota_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:user_home_dir_t:s0 tclass=dir
type=1400 audit(1309442058.969:30710): avc:  denied  { create } for  pid=13344 comm="quotacheck" name="aquota.user.new" scontext=unconfined_u:unconfined_r:quota_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:user_home_dir_t:s0 tclass=file
type=1400 audit(1309442059.095:30711): avc:  denied  { write } for  pid=13344 comm="quotacheck" name="aquota.user.new" dev=loop0 ino=12 scontext=unconfined_u:unconfined_r:quota_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:user_home_dir_t:s0 tclass=file
type=1400 audit(1309442059.230:30712): avc:  denied  { remove_name } for  pid=13344 comm="quotacheck" name="aquota.user.new" dev=loop0 ino=12 scontext=unconfined_u:unconfined_r:quota_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:user_home_dir_t:s0 tclass=dir
type=1400 audit(1309442059.366:30713): avc:  denied  { rename } for  pid=13344 comm="quotacheck" name="aquota.user.new" dev=loop0 ino=12 scontext=unconfined_u:unconfined_r:quota_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:user_home_dir_t:s0 tclass=file
type=1400 audit(1309442059.500:30714): avc:  denied  { setattr } for  pid=13344 comm="quotacheck" name="aquota.user" dev=loop0 ino=12 scontext=unconfined_u:unconfined_r:quota_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:user_home_dir_t:s0 tclass=file
type=1400 audit(1309442060.021:30715): avc:  denied  { quotaon } for  pid=13369 comm="quotaon" name="aquota.user" dev=loop0 ino=12 scontext=unconfined_u:unconfined_r:quota_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:user_home_dir_t:s0 tclass=file

Comment 2 Daniel Walsh 2011-07-01 11:56:21 UTC
This is not a regression, we need to have a valid label on the mount device, in order for SELinux to allow the access.

Just setting up random devices in a test and not putting a label on it will not work and did not work in 6.0.

mount a loop device into /your/mount with quota enabled (-o loop,usrquota)
chcon --reference /home /your/mount
quotacheck -c /your/mount

Should work.  Which seems to be similar to what you are working on.


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