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 700538 - MLS - cgconfigparser cannot search on /cgroup/ dirs
Summary: MLS - cgconfigparser cannot search on /cgroup/ dirs
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: kernel
Version: 6.1
Hardware: All
OS: Linux
urgent
high
Target Milestone: rc
: ---
Assignee: Eric Paris
QA Contact: Red Hat Kernel QE team
URL:
Whiteboard:
Depends On:
Blocks: RHEL62CCC 682670 705057 713135 846801 846802
TreeView+ depends on / blocked
 
Reported: 2011-04-28 15:51 UTC by Eduard Benes
Modified: 2012-08-08 18:29 UTC (History)
10 users (show)

Fixed In Version: kernel-2.6.32-158.el6
Doc Type: Bug Fix
Doc Text:
When using certain SELinux policies, such as the MLS policy, it was not possible to properly mount the cgroupfs file system due to the way security checks were applied to the new cgroupfs inodes during the mount operation. With this update, the security checks applied during the mount operation have been changed so that they always succeed, and the cgroupfs file system can now be successfully mounted and used with the MLS SELinux policy. This issue did not affect systems which used the default targeted policy.
Clone Of:
Environment:
Last Closed: 2011-12-06 13:20:25 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2011:1530 0 normal SHIPPED_LIVE Moderate: Red Hat Enterprise Linux 6 kernel security, bug fix and enhancement update 2011-12-06 01:45:35 UTC

Description Eduard Benes 2011-04-28 15:51:48 UTC
Description of problem:
Found following AVC denials for cgroups after (re)boot of my CCC system in MLS mode on latest 6.1 tree. Not sure about how this affects functionality of cgroups.

# cat cgroup.log | ausearch -i
----
type=AVC msg=audit(04/28/2011 08:41:26.404:6) : avc:  denied  { search } for  pid=918 comm=cgconfigparser name=/ dev=cgroup ino=10217 scontext=system_u:system_r:cgconfig_t:s0-s15:c0.c1023 tcontext=system_u:object_r:unlabeled_t:s15:c0.c1023 tclass=dir 
type=SYSCALL msg=audit(04/28/2011 08:41:26.404:6) : arch=x86_64 syscall=mount success=yes exit=0 a0=7f1a3188b481 a1=7f1a31a8f400 a2=7f1a3188b481 a3=0 items=0 ppid=917 pid=918 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=cgconfigparser exe=/sbin/cgconfigparser subj=system_u:system_r:cgconfig_t:s0-s15:c0.c1023 key=(null) 
----
type=AVC msg=audit(04/28/2011 08:41:26.404:7) : avc:  denied  { search } for  pid=918 comm=cgconfigparser name=/ dev=cgroup ino=10218 scontext=system_u:system_r:cgconfig_t:s0-s15:c0.c1023 tcontext=system_u:object_r:unlabeled_t:s15:c0.c1023 tclass=dir 
type=SYSCALL msg=audit(04/28/2011 08:41:26.404:7) : arch=x86_64 syscall=mount success=yes exit=0 a0=7f1a3188b481 a1=7f1a31a91404 a2=7f1a3188b481 a3=0 items=0 ppid=917 pid=918 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=cgconfigparser exe=/sbin/cgconfigparser subj=system_u:system_r:cgconfig_t:s0-s15:c0.c1023 key=(null) 
----
...

Searching for the inode numbers shows that the cgconfigparser wants to search for dirs under /cgroup/ which are for some to me unknown reason unlabeled_t at the time it does the search, though it they have the labels set correctly:

# ll -Z /cgroup/
drwxr-xr-x. root root system_u:object_r:cgroup_t:SystemLow blkio
drwxr-xr-x. eal  root system_u:object_r:cgroup_t:SystemLow cpu
drwxr-xr-x. root root system_u:object_r:cgroup_t:SystemLow cpuacct
drwxr-xr-x. root root system_u:object_r:cgroup_t:SystemLow cpuset
drwxr-xr-x. root root system_u:object_r:cgroup_t:SystemLow devices
drwxr-xr-x. eal  root system_u:object_r:cgroup_t:SystemLow freezer
drwxr-xr-x. root root system_u:object_r:cgroup_t:SystemLow memory
drwxr-xr-x. root root system_u:object_r:cgroup_t:SystemLow net_cls

Version-Release number of selected component (if applicable):
# rpm -q selinux-policy libcgroup
selinux-policy-3.7.19-87.el6.noarch
libcgroup-0.37-2.el6.x86_64

How reproducible:
always

Steps to Reproduce:
1. configure CCC system in MLS mode
2. (re)boot
3. check for AVCs in audit.log
  
Actual results:
avc denials

Expected results:
no avc denials :)

Additional info:
#============= cgconfig_t ==============
#!!!! 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 cgconfig_t unlabeled_t:dir search;

Comment 1 Eduard Benes 2011-04-28 17:25:17 UTC
By any chance, could be a bug in kernel? Looks like it is not labelled correctly after the mount.

Comment 2 Eric Paris 2011-04-28 17:52:00 UTC
Do you see anything about selinux in dmesg or do you see anything from ausearch -m SELINUX_ERR ??

Comment 4 Eduard Benes 2011-04-29 07:51:28 UTC
(In reply to comment #2)
> Do you see anything about selinux in dmesg or do you see anything from ausearch
> -m SELINUX_ERR ??

No, there is nothing suspicious in dmesg or audit.log.

Comment 5 Eric Paris 2011-06-03 22:18:45 UTC
http://marc.info/?t=130635979000004&r=1&w=2

Comment 8 Aristeu Rozanski 2011-06-15 17:11:02 UTC
Patch(es) available on kernel-2.6.32-158.el6

Comment 10 Martin Prpič 2011-07-12 11:36:21 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
When using certain SELinux policies, such as the MLS policy, it was not possible to properly mount the cgroupfs file system due to the way security checks were applied to the new cgroupfs inodes during the mount operation. With this update, the security checks applied during the mount operation have been changed so that they always succeed, and the cgroupfs file system can now be successfully mounted and used with the MLS SELinux policy. This issue did not affect systems which used the default targeted policy.

Comment 12 Mike Gahagan 2011-10-19 16:05:29 UTC
Confirmed libcgroup services can start on snap 2 with no denials, /cgroup mountpoints are now correctly labeled.

Comment 13 errata-xmlrpc 2011-12-06 13:20:25 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, 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/RHSA-2011-1530.html


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