Bug 1897719

Summary: SELinux issue in netcheck PMDA
Product: Red Hat Enterprise Linux 8 Reporter: Jan Kurik <jkurik>
Component: pcpAssignee: Nathan Scott <nathans>
Status: CLOSED ERRATA QA Contact: Jan Kurik <jkurik>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.4CC: agerstmayr, jkurik, mgoodwin, myllynen, nathans, patrickm
Target Milestone: rcKeywords: Bugfix, Triaged
Target Release: 8.4Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: pcp-5.2.5-1.el8 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-05-18 15:19:49 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jan Kurik 2020-11-13 21:49:03 UTC
Description of problem:
During installation of netcheck PMDA, SELinux reports an AVC issue.

Version-Release number of selected component (if applicable):
* selinux-policy-3.14.3-56.el8
* pcp-selinux-5.2.2-1.el8
* pcp-5.2.2-1.el8
* pcp-pmda-netcheck-5.2.2-1.el8

How reproducible:
Always

Steps to Reproduce:
1. Install RPMs pcp-zeroconf & pcp-pmda-netcheck
# yum install -y pcp-zeroconf pcp-pmda-netcheck
2. Install the netcheck PMDA
# cd /var/lib/pcp/pmdas/netcheck && ./Install
3. Check SELinux reports
# ausearch -m AVC

Actual results:
The ausearch reports:

type=AVC msg=audit(1605303952.202:692): avc:  denied  { create } for  pid=18420 comm="ping" scontext=system_u:system_r:pcp_pmcd_t:s0 tcontext=system_u:system_r:pcp_pmcd_t:s0 tclass=rawip_socket permissive=0

The audit2allow reports:

#============= pcp_pmcd_t ==============
allow pcp_pmcd_t self:rawip_socket create;


Expected results:
No SELinux issues are reported.

Comment 1 Nathan Scott 2020-11-16 05:58:54 UTC
Resolved upstream via the following commit which will be in next rebase update (pcp-5.2.3) in a few weeks.

commit c9e06e9155431002dc80ec2b4bc7d04a68ca4d14
Author: Nathan Scott <nathans>
Date:   Mon Nov 16 15:55:45 2020 +1100

    selinux: use matching autoconf guard for rawip_socket class
    
    Resolves Red Hat BZ #1897719

Comment 2 Jan Kurik 2020-12-18 14:59:07 UTC
The selinux issue is still affecting netcheck PMDA.

Comment 3 Jan Kurik 2020-12-18 15:02:17 UTC
*** Bug 1790450 has been marked as a duplicate of this bug. ***

Comment 4 Marko Myllynen 2020-12-18 17:52:32 UTC
There was a typo on configure{,.ac} which became relevant after the commit mentioned in comment 1 but even after fixing it and adjusting the SELinux rules this doesn't work on latest RHEL 8.3. However, this works as expected on latest Fedora. I'm suspecting this might be some underlying RHEL 8 kernel/SELinux issue (partial backport or such) but not really sure what's going on here.

The related upstream commits were:

https://github.com/performancecopilot/pcp/commit/581cfbdeaac02d47931a62bfcbc6e4d061395066
https://github.com/performancecopilot/pcp/commit/0dc6175cc1b131afffd858068f5efc82813a11ac

Comment 5 Nathan Scott 2021-01-14 23:20:35 UTC
Marko's final fix (above) will be pulled in via pcp-5.2.4 - if that doesn't resolve this, we're definitely looking at an underlying issue as Marko mentions (in which case we'll likely defer this one to 8.5 due to higher priority work items).

Comment 10 errata-xmlrpc 2021-05-18 15:19:49 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 (pcp bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2021:1754