Bug 1256125 - SELinux is preventing /usr/bin/pmlogger from 'open' accesses on the file /var/lib/pcp/config/pmlogger/config.default.
SELinux is preventing /usr/bin/pmlogger from 'open' accesses on the file /var...
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: pcp (Show other bugs)
22
x86_64 Unspecified
medium Severity medium
: ---
: ---
Assigned To: Nathan Scott
Fedora Extras Quality Assurance
abrt_hash:ce682194be3ac878abb41cd0aed...
: Reopened
: 1284153 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-08-23 22:58 EDT by Kazuo Moriwaka
Modified: 2016-04-06 10:55 EDT (History)
14 users (show)

See Also:
Fixed In Version: pcp-3.10.9-1.fc23 pcp-3.10.9-1.fc22 pcp-3.11.1-1.el5
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-04-06 10:55:47 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Kazuo Moriwaka 2015-08-23 22:58:04 EDT
Description of problem:
SELinux is preventing /usr/bin/pmlogger from 'open' accesses on the file /var/lib/pcp/config/pmlogger/config.default.

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

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

Additional Information:
Source Context                system_u:system_r:pcp_pmlogger_t:s0-s0:c0.c1023
Target Context                system_u:object_r:tmp_t:s0
Target Objects                /var/lib/pcp/config/pmlogger/config.default [ file
                              ]
Source                        pmlogger
Source Path                   /usr/bin/pmlogger
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           pcp-3.10.6-1.fc22.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-128.8.fc22.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 4.1.4-200.fc22.x86_64 #1 SMP Tue
                              Aug 4 03:22:33 UTC 2015 x86_64 x86_64
Alert Count                   159
First Seen                    2015-08-17 10:25:04 JST
Last Seen                     2015-08-24 11:55:05 JST
Local ID                      cd7bc718-fad4-4b06-8050-a8ebab4bb045

Raw Audit Messages
type=AVC msg=audit(1440384905.21:4888): avc:  denied  { open } for  pid=31681 comm="pmlogger" path="/var/lib/pcp/config/pmlogger/config.default" dev="dm-2" ino=921095 scontext=system_u:system_r:pcp_pmlogger_t:s0-s0:c0.c1023 tcontext=system_u:object_r:tmp_t:s0 tclass=file permissive=0


type=SYSCALL msg=audit(1440384905.21:4888): arch=x86_64 syscall=open success=no exit=EACCES a0=55d3ce539010 a1=0 a2=1b6 a3=7fba74714280 items=0 ppid=27515 pid=31681 auid=985 uid=985 gid=974 euid=985 suid=985 fsuid=985 egid=974 sgid=974 fsgid=974 tty=(none) ses=334 comm=pmlogger exe=/usr/bin/pmlogger subj=system_u:system_r:pcp_pmlogger_t:s0-s0:c0.c1023 key=(null)

Hash: pmlogger,pcp_pmlogger_t,tmp_t,file,open

Version-Release number of selected component:
selinux-policy-3.13.1-128.8.fc22.noarch

Additional info:
reporter:       libreport-2.6.2
hashmarkername: setroubleshoot
kernel:         4.1.4-200.fc22.x86_64
type:           libreport
Comment 1 Miroslav Grepl 2015-08-27 13:06:28 EDT
Did you move /var/lib/pcp/config/pmlogger/config.default for /tmp?

# restorecon -R -v /var/lib/pcp/

will fix labeling. If you get it by default, please reopen the bug.
Comment 2 Kazuo Moriwaka 2015-08-27 23:01:02 EDT
I didn't touch or move /var/lib/pcp/config/pmlogger/config.default.  
I doubt some tools creates this configuration file on /tmp or /var/tmp.

I found default PCP_TMPFILE_DIR is /var/tmp.  
$ grep TMP /etc/pcp.conf
PCP_TMP_DIR=/var/lib/pcp/tmp
PCP_TMPFILE_DIR=/var/tmp
Comment 3 Lukas Vrabec 2015-11-23 09:25:13 EST
Do you know which process creating this file?
Comment 4 Kazuo Moriwaka 2015-11-23 20:41:15 EST
The file has header lines as following.  This seems be created by pmlogconf.

----------------------------------------
#pmlogconf 2.0
#
# pmlogger(1) config file created and updated by pmlogconf
# Auto-generated by pmlogconf on:  Mon Oct 20 18:14:10 JST 2014
#
----------------------------------------
Comment 5 Lukas Vrabec 2015-11-24 06:50:15 EST
Guys from pcp, 
How is '/var/lib/pcp/config/pmlogger/config.default' file is created? SELinux context of this file need to be fixed by restorecon after moving from /tmp.
Comment 6 Lukas Berk 2015-11-24 10:28:44 EST
config.default is created by the pmlogconf script during the pmlogger service startup.

The default subset of metrics that we log can change based on platform, hardware, and available/enabled pmdas.  So it's not possible to do so ahead of time (for example, at build time).
Comment 7 Nathan Scott 2015-12-14 01:40:07 EST
Fixed upstream, will be in pcp-3.10.9 (upstream release and Fedora update expected to be done this week).
Comment 8 Nathan Scott 2015-12-14 01:53:10 EST
*** Bug 1284153 has been marked as a duplicate of this bug. ***
Comment 9 Fedora Update System 2015-12-16 20:55:00 EST
pcp-3.10.9-1.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2015-d08245c076
Comment 10 Fedora Update System 2015-12-16 20:55:40 EST
pcp-3.10.9-1.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2015-2b40815137
Comment 11 Fedora Update System 2015-12-16 21:18:26 EST
pcp-3.10.9-1.el5 has been submitted as an update to Fedora EPEL 5. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2015-2ac90519bc
Comment 12 Fedora Update System 2015-12-17 05:26:52 EST
pcp-3.10.9-1.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
$ su -c 'dnf --enablerepo=updates-testing update pcp'
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-2b40815137
Comment 13 Fedora Update System 2015-12-17 05:27:10 EST
pcp-3.10.9-1.fc22 has been pushed to the Fedora 22 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
$ su -c 'dnf --enablerepo=updates-testing update pcp'
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-d08245c076
Comment 14 Fedora Update System 2015-12-17 07:49:17 EST
pcp-3.10.9-1.el5 has been pushed to the Fedora EPEL 5 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
$ su -c 'yum --enablerepo=epel-testing update pcp'
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2015-2ac90519bc
Comment 15 Fedora Update System 2016-01-05 16:58:07 EST
pcp-3.10.9-1.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.
Comment 16 Fedora Update System 2016-01-05 17:54:44 EST
pcp-3.10.9-1.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report.
Comment 17 Fedora Update System 2016-02-02 22:57:06 EST
pcp-3.11.0-1.el5 has been submitted as an update to Fedora EPEL 5. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-57b7efb2d7
Comment 18 Fedora Update System 2016-02-03 17:17:42 EST
pcp-3.11.0-1.el5 has been pushed to the Fedora EPEL 5 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-57b7efb2d7
Comment 19 Fedora Update System 2016-03-21 20:17:59 EDT
pcp-3.11.1-1.el5 has been pushed to the Fedora EPEL 5 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-5b519318e0
Comment 20 Fedora Update System 2016-04-06 10:54:12 EDT
pcp-3.11.1-1.el5 has been pushed to the Fedora EPEL 5 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.