Bug 915514 - SELinux is preventing /usr/sbin/collectd from read access on the file utmp
Summary: SELinux is preventing /usr/sbin/collectd from read access on the file utmp
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 17
Hardware: x86_64
OS: Linux
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2013-02-25 23:04 UTC by Joel Uckelman
Modified: 2013-05-04 00:04 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2013-05-04 00:04:49 UTC
Type: Bug

Attachments (Terms of Use)

Description Joel Uckelman 2013-02-25 23:04:16 UTC
Description of problem:

SELinux is preventing /usr/sbin/collectd from read access on the file utmp.

*****  Plugin catchall (100. confidence) suggests  ***************************

If you believe that collectd should be allowed read access on the utmp file by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
allow this access for now by executing:
# grep collectd /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:collectd_t:s0
Target Context                system_u:object_r:initrc_var_run_t:s0
Target Objects                utmp [ file ]
Source                        collectd
Source Path                   /usr/sbin/collectd
Port                          <Unknown>
Host                          clio
Source RPM Packages           collectd-4.10.8-2.fc17.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.10.0-167.fc17.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     clio
Platform                      Linux clio 3.7.6-102.fc17.x86_64 #1 SMP Mon Feb 4
                              17:40:25 UTC 2013 x86_64 x86_64
Alert Count                   285
First Seen                    2013-02-25 23:13:07 CET
Last Seen                     2013-02-25 23:56:23 CET
Local ID                      55257c99-39aa-457b-9c1f-2ce081d65bf5

Raw Audit Messages
type=AVC msg=audit(1361832983.196:13624): avc:  denied  { read } for  pid=22738 comm="collectd" name="utmp" dev="tmpfs" ino=11800 scontext=system_u:system_r:collectd_t:s0 tcontext=system_u:object_r:initrc_var_run_t:s0 tclass=file

type=SYSCALL msg=audit(1361832983.196:13624): arch=x86_64 syscall=open success=no exit=EACCES a0=3f6ad77c62 a1=80000 a2=3f6ad77c62 a3=1 items=0 ppid=1 pid=22738 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 ses=4294967295 tty=(none) comm=collectd exe=/usr/sbin/collectd subj=system_u:system_r:collectd_t:s0 key=(null)

Hash: collectd,collectd_t,initrc_var_run_t,file,read


#============= collectd_t ==============
allow collectd_t initrc_var_run_t:file read;

audit2allow -R

#============= collectd_t ==============
allow collectd_t initrc_var_run_t:file read;

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. Enable collectd "users" plugin.
2. Restart collectd.
Actual results:

collectd is stopped from reading /etc/utmp by SELinux.

Expected results:

collectd should be able to read /etc/utmp.

Comment 1 Miroslav Grepl 2013-02-28 12:37:47 UTC
commit b3927c2d683a65294d0d0b3e1ba55a3d8cfd2be9
Author: Miroslav Grepl <mgrepl@redhat.com>
Date:   Thu Feb 28 13:36:45 2013 +0100

    Allow collectd to read utmp

Comment 2 Joel Uckelman 2013-03-02 15:59:47 UTC
NB: On F18, it also seems to need open and lock privileges.

Comment 3 Fedora Update System 2013-03-05 14:33:03 UTC
selinux-policy-3.10.0-168.fc17 has been submitted as an update for Fedora 17.

Comment 4 Fedora Update System 2013-03-05 23:30:26 UTC
Package selinux-policy-3.10.0-168.fc17:
* should fix your issue,
* was pushed to the Fedora 17 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing selinux-policy-3.10.0-168.fc17'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).

Comment 5 Fedora Update System 2013-04-04 08:31:57 UTC
selinux-policy-3.10.0-169.fc17 has been submitted as an update for Fedora 17.

Comment 6 Fedora Update System 2013-05-04 00:04:51 UTC
selinux-policy-3.10.0-169.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.

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