Bug 2050094

Summary: BCC PMDA usdt_hits , tcplife, tcpperpid and execsnoop modules - selinux AVC issues
Product: Red Hat Enterprise Linux 8 Reporter: Jan Kurik <jkurik>
Component: pcpAssignee: Andreas Gerstmayr <agerstmayr>
Status: CLOSED ERRATA QA Contact: Jan Kurik <jkurik>
Severity: unspecified Docs Contact: Jacob Taylor Valdez <jvaldez>
Priority: unspecified    
Version: 8.6CC: agerstmayr, jkurik, nathans
Target Milestone: rcKeywords: Bugfix, Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: pcp-5.3.7-9.el8 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-05-16 08:13:26 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 2022-02-03 09:01:35 UTC
Description of problem:
When using "usdt_hits", "tcplife", "tcpperpid" or "execsnoop" module of bcc pmda, I am getting selinux AVC reports.

Version-Release number of selected component (if applicable):
Compose: RHEL-8.6.0-20220131.1
pcp-5.3.5-8.el8
selinux-policy-3.14.3-89.el8

How reproducible:
Always on all supported architectures.

Steps to Reproduce:
1. Install pcp, pcp-pmda-bcc and pcp-testuite
2. Tun testcases #1150 , #1155 , #1156 , #1178 of the pcp testsuite

Actual results:
Selinux generates the following AVC records:

# ausearch -m AVC
type=PROCTITLE msg=audit(1643876401.787:14418): proctitle=707974686F6E33002F7661722F6C69622F7063702F706D6461732F6263632F706D64616263632E707974686F6E
type=SYSCALL msg=audit(1643876401.787:14418): arch=c000003e syscall=9 success=no exit=-13 a0=0 a1=1000 a2=5 a3=1 items=0 ppid=213527 pid=216047 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="python3" exe="/usr/libexec/platform-python3.6" subj=system_u:system_r:pcp_pmcd_t:s0 key=(null)
type=AVC msg=audit(1643876401.787:14418): avc:  denied  { execute } for  pid=216047 comm="python3" path=2F6D656D66643A6C6962666669202864656C6574656429 dev="tmpfs" ino=919210 scontext=system_u:system_r:pcp_pmcd_t:s0 tcontext=system_u:object_r:pcp_tmpfs_t:s0 tclass=file permissive=0

# audit2allow -a
#============= pcp_pmcd_t ==============
allow pcp_pmcd_t pcp_tmpfs_t:file execute;


Expected results:
No AVC records reported.

Additional info:
I briefly checked if this is not an issue with those testcases, however I have not find anything suspicious in the testcase code.
I have not seen these AVC issues in previous releases, so it might be also related to the recent changes in selinux-policy package.

Comment 5 Andreas Gerstmayr 2022-05-13 11:51:32 UTC
fixed upstream (and backported to stable branch) with:

commit 04ac47e570c47cb1f953cf9d5f8cac2a656238e6 (HEAD -> stable, upstream/stable)
Author: Andreas Gerstmayr <agerstmayr>
Date:   Fri May 13 13:47:50 2022 +0200
 
    selinux: allow bcc PMDA to execute its private memfd: objects created by ctypes/libffi (#1593)
    
    Resolves the following AVC:
    
        type=AVC msg=audit(YYY.787): avc:  denied  { execute } for  pid=216047 comm="python3" path=2F6D656D66643A6C6962666669202864656C6574656429 dev="tmpfs" ino=919210 scontext=system_u:sy>
    
    Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2050094

Comment 10 errata-xmlrpc 2023-05-16 08:13:26 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-2023:2745