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 628895 - init script searches cwd which can cause SELinux denials
Summary: init script searches cwd which can cause SELinux denials
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libcgroup
Version: 6.0
Hardware: All
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Ivana Varekova
QA Contact: Red Hat Kernel QE team
URL:
Whiteboard:
Depends On:
Blocks: 672300
TreeView+ depends on / blocked
 
Reported: 2010-08-31 10:23 UTC by Milos Malik
Modified: 2011-05-19 13:13 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-05-19 13:13:14 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:0577 0 normal SHIPPED_LIVE libcgroup bug fix and enhancement update 2011-05-18 17:56:57 UTC

Description Milos Malik 2010-08-31 10:23:29 UTC
Description of problem:
Some administrators don't use "service" command when managing a service. They
still do it this way:
/etc/init.d/SERVICE start
/etc/init.d/SERVICE restart
/etc/init.d/SERVICE stop
This procedure can cause SELinux denials when an administrator issues the
command in unusual location (usual location is for example / or /root ,
selinux-policy is aware of usual locations and SELinux denials are
dontaudited). I would like to ask to fix the init script in such a way that it
does not search for programs in current working directory.

Version-Release number of selected component (if applicable):
libcgroup-0.36.1-6.el6.i686
selinux-policy-3.7.19-42.el6.noarch
selinux-policy-doc-3.7.19-42.el6.noarch
selinux-policy-minimum-3.7.19-42.el6.noarch
selinux-policy-mls-3.7.19-42.el6.noarch
selinux-policy-targeted-3.7.19-42.el6.noarch

How reproducible:
always

Steps to Reproduce:
# cd /var/log/audit
# /etc/init.d/cgconfig start
Starting cgconfig service: Loading configuration file /etc/cgconfig.conf failed
Permission denied
Failed to parse /etc/cgconfig.conf                         [FAILED]
# /etc/init.d/cgconfig stop
Stopping cgconfig service:                                 [  OK  ]
# ausearch -m avc -ts recent
----
time->Tue Aug 31 12:19:25 2010
type=SYSCALL msg=audit(1283249965.670:304): arch=40000003 syscall=12 success=no 
exit=-13 a0=bfc7fbac a1=bfc7fbac a2=76f168 a3=e items=0 ppid=5645 pid=5648 auid=
0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts0 ses=1 comm="c
gconfigparser" exe="/sbin/cgconfigparser" subj=unconfined_u:system_r:cgconfig_t:
s0 key=(null)
type=AVC msg=audit(1283249965.670:304): avc:  denied  { search } for  pid=5648 comm="cgconfigparser" name="audit" dev=dm-0 ino=9973 scontext=unconfined_u:system_r:cgconfig_t:s0 tcontext=system_u:object_r:auditd_log_t:s0 tclass=dir
----

Actual results:
an AVC appears

Expected results:
no AVC appears

Additional info:

Comment 1 Jan Safranek 2010-08-31 12:36:14 UTC
cgconfigparser changes current directory to the cgroup mount point (which succeeds), but SELinux does not like when cgconfig tries to change it back to /var/log/audit:

getcwd("/var/log/audit", 4096)          = 15
mkdir("/", 0775)                        = -1 EEXIST (File exists)     (this is OK)
chdir("/")                              = 0
mkdir("cgroup/", 0775)                  = -1 EEXIST (File exists)     (this is OK)
chdir("cgroup/")                        = 0
mkdir("cpuset", 0775)                   = 0
chdir("cpuset")                         = 0
chdir("/var/log/audit")                 = -1 EACCES (Permission denied) (this is WRONG)


cgconfigparser should simply not change current working directory.

Comment 4 Mike Gahagan 2011-01-24 16:22:59 UTC
Confirmed this is fixed in libcgroup-0.37-1.el6.x86_64. service can now be started with /etc/init.d/cgconfig start . Also verified that starting/stopping/restarting still works as expected using /sbin/service.

Comment 5 errata-xmlrpc 2011-05-19 13:13:14 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-0577.html


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