Bug 1123338 - dhcrelay runs as initrc_t
Summary: dhcrelay runs as initrc_t
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: selinux-policy
Version: 6.6
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Lukas Vrabec
QA Contact: Milos Malik
URL:
Whiteboard:
Depends On:
Blocks: 1124953
TreeView+ depends on / blocked
 
Reported: 2014-07-25 11:16 UTC by Milos Malik
Modified: 2014-10-14 08:03 UTC (History)
4 users (show)

Fixed In Version: selinux-policy-3.7.19-247.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-10-14 08:03:47 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2014:1568 normal SHIPPED_LIVE selinux-policy bug fix and enhancement update 2014-10-14 01:27:37 UTC

Description Milos Malik 2014-07-25 11:16:52 UTC
Description of problem:
 * dhcrelay runs in a too powerful domain

Version-Release number of selected component (if applicable):
dhcp-4.1.1-43.P1.el6.x86_64
dhcp-common-4.1.1-43.P1.el6.x86_64
selinux-policy-3.7.19-246.el6.noarch
selinux-policy-doc-3.7.19-246.el6.noarch
selinux-policy-minimum-3.7.19-246.el6.noarch
selinux-policy-mls-3.7.19-246.el6.noarch
selinux-policy-targeted-3.7.19-246.el6.noarch

How reproducible:
always

Steps to Reproduce:
# grep -v ^# /etc/sysconfig/dhcrelay
DHCRELAYARGS=""
INTERFACES="eth0"
DHCPSERVERS="192.168.122.1"
# service dhcrelay status
dhcrelay is stopped
# service dhcrelay start
Starting dhcrelay:                                         [  OK  ]
# service dhcrelay status
dhcrelay (pid  6219) is running...
# ps -efZ | grep dhcrelay
unconfined_u:system_r:initrc_t:s0 root    6219     1  0 13:14 ?        00:00:00 /usr/sbin/dhcrelay -i eth0 192.168.122.1
unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 root 6240 3322  0 13:14 pts/0 00:00:00 grep dhcrelay
#

Actual results:
 * dhcrelay runs as initrc_t

Expected results:
 * dhcrelay runs in a dedicated domain

Comment 1 Lukas Vrabec 2014-07-28 18:14:02 UTC
Milos, Could label /etc/init.d/dhcrelay as dhcpd_initrc_exec_t and try it?

Thank you!

Comment 2 Milos Malik 2014-07-29 07:50:43 UTC
The automated TC passes when following files are labeled accordingly:

# ls -Z /etc/rc.d/init.d/dhcrelay
-rwxr-xr-x. root root system_u:object_r:dhcpd_initrc_exec_t:s0 /etc/rc.d/init.d/dhcrelay
# ls -Z /usr/sbin/dhcrelay 
-rwxr-xr-x. root root system_u:object_r:dhcpd_exec_t:s0 /usr/sbin/dhcrelay
#

Comment 3 Miroslav Grepl 2014-07-29 10:53:05 UTC
We also don't have labeling for 

/usr/sbin/dhcrelay

in Fedora.

Comment 4 Milos Malik 2014-07-29 11:01:40 UTC
Please add the label to the IPv6 init script too:

# matchpathcon /etc/rc.d/init.d/dhcrelay*
/etc/rc.d/init.d/dhcrelay	system_u:object_r:initrc_exec_t:s0
/etc/rc.d/init.d/dhcrelay6	system_u:object_r:initrc_exec_t:s0
# matchpathcon /etc/rc.d/init.d/dhcpd*
/etc/rc.d/init.d/dhcpd	system_u:object_r:dhcpd_initrc_exec_t:s0
/etc/rc.d/init.d/dhcpd6	system_u:object_r:dhcpd_initrc_exec_t:s0
#

Comment 5 Lukas Vrabec 2014-07-29 11:12:31 UTC
Mirek, Yes I know, It's fixed now. 

Milos, OK, I'll fix also IPv6 services.

Comment 7 Lukas Vrabec 2014-07-29 12:12:06 UTC
patch sent.

Comment 10 errata-xmlrpc 2014-10-14 08:03:47 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/RHBA-2014-1568.html


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