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.
DescriptionAndrey Alekseenkov
2012-08-29 14:10:46 UTC
Description of problem:
Root (or any other user) can't mount any file via loop device with enforcing mls policy enabled
Version-Release number of selected component (if applicable):
selinux-policy-mls-3.7.19-93.el6
How reproducible: always
Steps to Reproduce:
1. create image file
# dd if=/dev/zero of=/opt/fat.img bs=1024 count=1024
2. make filesystem
# mkfs -t vfat /opt/fat.img
3. set selinux boolean to allow mounting any file
# setsebool allow_mount_anyfile 1
4. change selinux to enforcing mode
# setenforce 1
5. try to mount filesystem
# mount -t vfat -o loop /opt/fat.img /mnt
Actual results:
mount: /dev/loop0: unable to read superblock
Expected results:
successful mount to /mnt directory
Additional info:
1. audit2allow produces constaraint rule:
require {
type kernel_t;
type mount_t;
class fd use;
}
#============= kernel_t ==============
# src="kernel_t" tgt="mount_t" class="fd", perms="use"
# comm="loop0" exe="" path=""#!!!! This avc is a constraint violation. You will need to add an attribute to either the source or target type to make it work.
#Contraint rule:
allow kernel_t mount_t:fd use;
2. audit.log shows avc message:
type=AVC msg=audit(1346248387.953:27019): avc: denied { use } for pid=2431 comm="loop0" path="/opt/fat.img" dev=dm-0 ino=19584 scontext=system_u:system_r:kernel_t:s15:c0.c1023 tcontext=root:sysadm_r:mount_t:s0-s15:c0.c1023 tclass=fd
Comment 2Andrey Alekseenkov
2012-08-30 06:13:37 UTC
The same situation is happening in RHEL 6.3 with selinux-policy-mls-3.7.19-155.el6
Still the same even if following commands were executed before mount ...:
setsebool allow_mount_anyfile 1
setsebool allow_domain_fd_use 1
audit2allow says that the AVC is a constraint violation.
Well fsadm_t which mkfs.vfat runs as is not allowed to create images in random directories. I guess we can either remove the transition from sysadm_t to fsadm_t or allow or fsadm_t to write to random locations.
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, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
http://rhn.redhat.com/errata/RHBA-2013-0314.html
Description of problem: Root (or any other user) can't mount any file via loop device with enforcing mls policy enabled Version-Release number of selected component (if applicable): selinux-policy-mls-3.7.19-93.el6 How reproducible: always Steps to Reproduce: 1. create image file # dd if=/dev/zero of=/opt/fat.img bs=1024 count=1024 2. make filesystem # mkfs -t vfat /opt/fat.img 3. set selinux boolean to allow mounting any file # setsebool allow_mount_anyfile 1 4. change selinux to enforcing mode # setenforce 1 5. try to mount filesystem # mount -t vfat -o loop /opt/fat.img /mnt Actual results: mount: /dev/loop0: unable to read superblock Expected results: successful mount to /mnt directory Additional info: 1. audit2allow produces constaraint rule: require { type kernel_t; type mount_t; class fd use; } #============= kernel_t ============== # src="kernel_t" tgt="mount_t" class="fd", perms="use" # comm="loop0" exe="" path=""#!!!! This avc is a constraint violation. You will need to add an attribute to either the source or target type to make it work. #Contraint rule: allow kernel_t mount_t:fd use; 2. audit.log shows avc message: type=AVC msg=audit(1346248387.953:27019): avc: denied { use } for pid=2431 comm="loop0" path="/opt/fat.img" dev=dm-0 ino=19584 scontext=system_u:system_r:kernel_t:s15:c0.c1023 tcontext=root:sysadm_r:mount_t:s0-s15:c0.c1023 tclass=fd