Bug 1037529 - htcacheclean runs as init_t
Summary: htcacheclean runs as init_t
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: selinux-policy
Version: 7.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Miroslav Grepl
QA Contact: Milos Malik
URL:
Whiteboard:
Depends On: nopolicy
Blocks: 848829 1042727
TreeView+ depends on / blocked
 
Reported: 2013-12-03 10:35 UTC by Milos Malik
Modified: 2014-06-18 02:31 UTC (History)
1 user (show)

Fixed In Version: selinux-policy-3.12.1-107.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-06-13 12:29:51 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Milos Malik 2013-12-03 10:35:23 UTC
Description of problem:
 * htcacheclean uses too powerful SELinux domain

Version-Release number of selected component (if applicable):
httpd-2.4.6-7.el7.x86_64
selinux-policy-3.12.1-105.el7.noarch
selinux-policy-devel-3.12.1-105.el7.noarch
selinux-policy-doc-3.12.1-105.el7.noarch
selinux-policy-minimum-3.12.1-105.el7.noarch
selinux-policy-mls-3.12.1-105.el7.noarch
selinux-policy-targeted-3.12.1-105.el7.noarch

How reproducible:
always

Steps to Reproduce:
# service htcacheclean status
Redirecting to /bin/systemctl status  htcacheclean.service
htcacheclean.service - Disk Cache Cleaning Daemon for Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/htcacheclean.service; static)
   Active: inactive (dead)

Dec 03 10:54:58 rhel70.localdomain systemd[1]: Starting Disk Cache Cleaning ....
Dec 03 10:54:58 rhel70.localdomain systemd[1]: PID file /run/httpd/htcachecl....
Dec 03 10:54:58 rhel70.localdomain systemd[1]: Started Disk Cache Cleaning D....
Dec 03 10:55:12 rhel70.localdomain systemd[1]: Stopping Disk Cache Cleaning ....
Dec 03 10:55:12 rhel70.localdomain systemd[1]: Stopped Disk Cache Cleaning D....
Hint: Some lines were ellipsized, use -l to show in full.
# service htcacheclean start
Redirecting to /bin/systemctl start  htcacheclean.service
# service htcacheclean status
Redirecting to /bin/systemctl status  htcacheclean.service
htcacheclean.service - Disk Cache Cleaning Daemon for Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/htcacheclean.service; static)
   Active: active (running) since Tue 2013-12-03 11:32:48 CET; 1s ago
  Process: 19055 ExecStart=/usr/sbin/htcacheclean -P /run/httpd/htcacheclean/pid -d $INTERVAL -p $CACHE_ROOT -l $LIMIT $OPTIONS (code=exited, status=0/SUCCESS)
 Main PID: 19056 (htcacheclean)
   CGroup: /system.slice/htcacheclean.service
           └─19056 /usr/sbin/htcacheclean -P /run/httpd/htcacheclean/pid -d 1...

Dec 03 11:32:48 rhel70.localdomain systemd[1]: Started Disk Cache Cleaning D....
Hint: Some lines were ellipsized, use -l to show in full.
# ps -efZ | grep htcacheclean
system_u:system_r:init_t:s0     apache   19056     1  0 11:32 ?        00:00:00 /usr/sbin/htcacheclean -P /run/httpd/htcacheclean/pid -d 15 -p /var/cache/httpd/proxy -l 100M
unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 root 19069 2416  0 11:32 pts/0 00:00:00 grep --color=auto htcacheclean
#

Actual results:
 * htcacheclean runs as init_t

Expected results:
 * htcacheclean runs in its own SELinux domain

Comment 1 Miroslav Grepl 2013-12-03 11:43:49 UTC
Milos,

# chcon -t httpd_exec_t /usr/sbin/htcacheclean

Comment 2 Milos Malik 2013-12-03 12:55:36 UTC
When /usr/sbin/htcacheclean is labeled httpd_exec_t the service runs fine. No AVCs appeared.

Comment 3 Miroslav Grepl 2013-12-03 20:05:02 UTC
commit 07ceba8467185317fdcab908f85ec93b87773e53
Author: Miroslav Grepl <mgrepl>
Date:   Tue Dec 3 21:04:04 2013 +0100

    Label /usr/sbin/htcacheclean as httpd_exec_t

Comment 6 Ludek Smid 2014-06-13 12:29:51 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.


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