Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 2044383

Summary: AVC denial for running pmie and python3
Product: Red Hat Enterprise Linux 9 Reporter: Ilias Romanos <iromanos>
Component: selinux-policyAssignee: Zdenek Pytela <zpytela>
Status: CLOSED DUPLICATE QA Contact: Milos Malik <mmalik>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 9.0CC: lvrabec, mmalik, ssekidde
Target Milestone: rcFlags: pm-rhel: mirror+
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-01-25 15:51:07 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 Ilias Romanos 2022-01-24 13:49:48 UTC
Description of problem:
AVC denial when running pmie and python3

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

RHEL-9.0.0-20220119.0 BaseOS x86_64 
selinux-policy-34.1.22-1.el9.noarch

How reproducible:
With any beaker job I try using RHEL-9.0.0

For example https://beaker.cluster-qe.lab.eng.brq.redhat.com/bkr/jobs/122938 

Actual results:
AVCs present

Expected results:
No AVCs present

Additional info:

SELinux status:                 enabled
SELinuxfs mount:                /sys/fs/selinux
SELinux root directory:         /etc/selinux
Loaded policy name:             targeted
Current mode:                   permissive
Mode from config file:          enforcing
Policy MLS status:              enabled
Policy deny_unknown status:     allowed
Memory protection checking:     actual (secure)
Max kernel policy version:      33
selinux-policy-34.1.22-1.el9.noarch
----
time->Mon Jan 24 11:27:36 2022
type=PROCTITLE msg=audit(1643020056.981:500): proctitle=2F7573722F62696E2F706D6965002D62002D46002D50002D6C002F7661722F6C6F672F7063702F706D69652F766972742D3530362E636C75737465722D71652E6C61622E656E672E6272712E7265646861742E636F6D2F706D69652E6C6F67002D6300636F6E6669672E64656661756C74
type=SYSCALL msg=audit(1643020056.981:500): arch=c000003e syscall=21 success=no exit=-13 a0=7ffd9cd7b4c0 a1=4 a2=8 a3=564c04e6ae1e items=0 ppid=1 pid=49169 auid=4294967295 uid=987 gid=987 euid=987 suid=987 fsuid=987 egid=987 sgid=987 fsgid=987 tty=(none) ses=4294967295 comm="pmie" exe="/usr/bin/pmie" subj=system_u:system_r:pcp_pmie_t:s0 key=(null)
type=AVC msg=audit(1643020056.981:500): avc:  denied  { read } for  pid=49169 comm="pmie" name="unix" dev="proc" ino=4026532058 scontext=system_u:system_r:pcp_pmie_t:s0 tcontext=system_u:object_r:proc_net_t:s0 tclass=file permissive=0
----
time->Mon Jan 24 11:27:44 2022
type=PROCTITLE msg=audit(1643020064.815:639): proctitle=707974686F6E33002F7661722F6C69622F7063702F706D6461732F6E6673636C69656E742F706D64616E6673636C69656E742E707974686F6E
type=SYSCALL msg=audit(1643020064.815:639): arch=c000003e syscall=59 success=no exit=-13 a0=7fc66339a8c0 a1=7fc6621e0f90 a2=7fc6621e0770 a3=0 items=0 ppid=53681 pid=53686 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/bin/python3.9" subj=system_u:system_r:pcp_pmcd_t:s0 key=(null)
type=AVC msg=audit(1643020064.815:639): avc:  denied  { execute } for  pid=53686 comm="python3" name="ldconfig" dev="dm-0" ino=8526793 scontext=system_u:system_r:pcp_pmcd_t:s0 tcontext=system_u:object_r:ldconfig_exec_t:s0 tclass=file permissive=0
----
time->Mon Jan 24 11:27:44 2022
type=PROCTITLE msg=audit(1643020064.829:640): proctitle=707974686F6E33002F7661722F6C69622F7063702F706D6461732F6E6673636C69656E742F706D64616E6673636C69656E742E707974686F6E
type=SYSCALL msg=audit(1643020064.829:640): arch=c000003e syscall=59 success=no exit=-13 a0=7fc66339a8c0 a1=7fc6621639d0 a2=7fc6621639b0 a3=0 items=0 ppid=53681 pid=53691 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/bin/python3.9" subj=system_u:system_r:pcp_pmcd_t:s0 key=(null)
type=AVC msg=audit(1643020064.829:640): avc:  denied  { execute } for  pid=53691 comm="python3" name="ldconfig" dev="dm-0" ino=8526793 scontext=system_u:system_r:pcp_pmcd_t:s0 tcontext=system_u:object_r:ldconfig_exec_t:s0 tclass=file permissive=0
----
time->Mon Jan 24 11:27:47 2022
type=PROCTITLE msg=audit(1643020067.814:641): proctitle=707974686F6E33002F7661722F6C69622F7063702F706D6461732F6E6673636C69656E742F706D64616E6673636C69656E742E707974686F6E
type=SYSCALL msg=audit(1643020067.814:641): arch=c000003e syscall=59 success=no exit=-13 a0=7fad6bbc68c0 a1=7fad6aa0cf90 a2=7fad6aa0c770 a3=0 items=0 ppid=53830 pid=53835 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/bin/python3.9" subj=system_u:system_r:pcp_pmcd_t:s0 key=(null)
type=AVC msg=audit(1643020067.814:641): avc:  denied  { execute } for  pid=53835 comm="python3" name="ldconfig" dev="dm-0" ino=8526793 scontext=system_u:system_r:pcp_pmcd_t:s0 tcontext=system_u:object_r:ldconfig_exec_t:s0 tclass=file permissive=0
----
time->Mon Jan 24 11:27:47 2022
type=PROCTITLE msg=audit(1643020067.833:642): proctitle=707974686F6E33002F7661722F6C69622F7063702F706D6461732F6E6673636C69656E742F706D64616E6673636C69656E742E707974686F6E
type=SYSCALL msg=audit(1643020067.833:642): arch=c000003e syscall=59 success=no exit=-13 a0=7fad6bbc68c0 a1=7fad6a98f9d0 a2=7fad6a98f9b0 a3=0 items=0 ppid=53830 pid=53840 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/bin/python3.9" subj=system_u:system_r:pcp_pmcd_t:s0 key=(null)
type=AVC msg=audit(1643020067.833:642): avc:  denied  { execute } for  pid=53840 comm="python3" name="ldconfig" dev="dm-0" ino=8526793 scontext=system_u:system_r:pcp_pmcd_t:s0 tcontext=system_u:object_r:ldconfig_exec_t:s0 tclass=file permissive=0
----
time->Mon Jan 24 11:27:49 2022
type=PROCTITLE msg=audit(1643020069.095:643): proctitle=707974686F6E33002F7661722F6C69622F7063702F706D6461732F6E6673636C69656E742F706D64616E6673636C69656E742E707974686F6E
type=SYSCALL msg=audit(1643020069.095:643): arch=c000003e syscall=59 success=no exit=-13 a0=7f2ad23888c0 a1=7f2ad11cef90 a2=7f2ad11ce770 a3=0 items=0 ppid=53930 pid=53935 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/bin/python3.9" subj=system_u:system_r:pcp_pmcd_t:s0 key=(null)
type=AVC msg=audit(1643020069.095:643): avc:  denied  { execute } for  pid=53935 comm="python3" name="ldconfig" dev="dm-0" ino=8526793 scontext=system_u:system_r:pcp_pmcd_t:s0 tcontext=system_u:object_r:ldconfig_exec_t:s0 tclass=file permissive=0
----
time->Mon Jan 24 11:27:49 2022
type=PROCTITLE msg=audit(1643020069.108:644): proctitle=707974686F6E33002F7661722F6C69622F7063702F706D6461732F6E6673636C69656E742F706D64616E6673636C69656E742E707974686F6E
type=SYSCALL msg=audit(1643020069.108:644): arch=c000003e syscall=59 success=no exit=-13 a0=7f2ad23888c0 a1=7f2ad11519d0 a2=7f2ad11519b0 a3=0 items=0 ppid=53930 pid=53940 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/bin/python3.9" subj=system_u:system_r:pcp_pmcd_t:s0 key=(null)
type=AVC msg=audit(1643020069.108:644): avc:  denied  { execute } for  pid=53940 comm="python3" name="ldconfig" dev="dm-0" ino=8526793 scontext=system_u:system_r:pcp_pmcd_t:s0 tcontext=system_u:object_r:ldconfig_exec_t:s0 tclass=file permissive=0
----
time->Mon Jan 24 11:27:49 2022
type=PROCTITLE msg=audit(1643020069.309:645): proctitle=707974686F6E33002F7661722F6C69622F7063702F706D6461732F6F70656E6D6574726963732F706D64616F70656E6D6574726963732E707974686F6E
type=SYSCALL msg=audit(1643020069.309:645): arch=c000003e syscall=59 success=no exit=-13 a0=7fb5ad5a9f30 a1=7fb5ac58ee70 a2=7fb5ac58ee10 a3=0 items=0 ppid=53945 pid=53946 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/bin/python3.9" subj=system_u:system_r:pcp_pmcd_t:s0 key=(null)
type=AVC msg=audit(1643020069.309:645): avc:  denied  { execute } for  pid=53946 comm="python3" name="ldconfig" dev="dm-0" ino=8526793 scontext=system_u:system_r:pcp_pmcd_t:s0 tcontext=system_u:object_r:ldconfig_exec_t:s0 tclass=file permissive=0
----
time->Mon Jan 24 11:27:49 2022
type=PROCTITLE msg=audit(1643020069.322:646): proctitle=707974686F6E33002F7661722F6C69622F7063702F706D6461732F6F70656E6D6574726963732F706D64616F70656E6D6574726963732E707974686F6E
type=SYSCALL msg=audit(1643020069.322:646): arch=c000003e syscall=59 success=no exit=-13 a0=7fb5ad5a9f30 a1=7fb5ac58ef90 a2=7fb5ac58ef70 a3=0 items=0 ppid=53945 pid=53951 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/bin/python3.9" subj=system_u:system_r:pcp_pmcd_t:s0 key=(null)
type=AVC msg=audit(1643020069.322:646): avc:  denied  { execute } for  pid=53951 comm="python3" name="ldconfig" dev="dm-0" ino=8526793 scontext=system_u:system_r:pcp_pmcd_t:s0 tcontext=system_u:object_r:ldconfig_exec_t:s0 tclass=file permissive=0
----
time->Mon Jan 24 11:29:37 2022
type=PROCTITLE msg=audit(1643020177.359:653): proctitle=707974686F6E33002F7661722F6C69622F7063702F706D6461732F6F70656E6D6574726963732F706D64616F70656E6D6574726963732E707974686F6E
type=SYSCALL msg=audit(1643020177.359:653): arch=c000003e syscall=42 success=no exit=-115 a0=3 a1=7f7b91008e90 a2=1c a3=7f7b9268b9b9 items=0 ppid=47827 pid=54430 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/bin/python3.9" subj=system_u:system_r:pcp_pmcd_t:s0 key=(null)
type=AVC msg=audit(1643020177.359:653): avc:  denied  { name_connect } for  pid=54430 comm="python3" dest=3000 scontext=system_u:system_r:pcp_pmcd_t:s0 tcontext=system_u:object_r:ntop_port_t:s0 tclass=tcp_socket permissive=1

Comment 4 Milos Malik 2022-01-25 08:39:04 UTC
The pcpupstream policy module is not loaded. Please run the following command:

# dnf -y reinstall pcp-selinux

If the command fails, please copy&paste its output here.

Thank you.

Comment 5 Ilias Romanos 2022-01-25 10:11:42 UTC
# dnf -y reinstall pcp-selinux
Updating Subscription Management repositories.
Unable to read consumer identity

This system is not registered with an entitlement server. You can use subscription-manager to register.

Last metadata expiration check: 1:51:00 ago on Tue 25 Jan 2022 08:06:50 AM CET.
Dependencies resolved.
===================================================================================================================================================================================================================
 Package                                            Architecture                                  Version                                            Repository                                               Size
===================================================================================================================================================================================================================
Reinstalling:
 pcp-selinux                                        x86_64                                        5.3.5-3.el9                                        beaker-AppStream                                         36 k

Transaction Summary
===================================================================================================================================================================================================================

Total download size: 36 k
Installed size: 159 k
Downloading Packages:
pcp-selinux-5.3.5-3.el9.x86_64.rpm                                                                                                                                                 462 kB/s |  36 kB     00:00    
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                              442 kB/s |  36 kB     00:00     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                                                           1/1 
  Reinstalling     : pcp-selinux-5.3.5-3.el9.x86_64                                                                                                                                                            1/2 
  Running scriptlet: pcp-selinux-5.3.5-3.el9.x86_64                                                                                                                                                            1/2 
Failed to resolve allow statement at /var/lib/selinux/targeted/tmp/modules/400/pcpupstream/cil:103
Failed to resolve AST
semodule:  Failed!

  Running scriptlet: pcp-selinux-5.3.5-3.el9.x86_64                                                                                                                                                            2/2 
Failed to resolve allow statement at /var/lib/selinux/targeted/tmp/modules/400/pcpupstream/cil:103
Failed to resolve AST
semodule:  Failed!

  Cleanup          : pcp-selinux-5.3.5-3.el9.x86_64                                                                                                                                                            2/2 
  Running scriptlet: pcp-selinux-5.3.5-3.el9.x86_64                                                                                                                                                            2/2 
  Verifying        : pcp-selinux-5.3.5-3.el9.x86_64                                                                                                                                                            1/2 
  Verifying        : pcp-selinux-5.3.5-3.el9.x86_64                                                                                                                                                            2/2 
Installed products updated.

Reinstalled:
  pcp-selinux-5.3.5-3.el9.x86_64                                                                                                                                                                                   

Complete!

Comment 7 Milos Malik 2022-01-25 11:53:45 UTC
This bug looks like a duplicate of https://bugzilla.redhat.com/show_bug.cgi?id=2043023

Comment 8 Zdenek Pytela 2022-01-25 15:51:07 UTC
Right, it should be resolved with pcp-5.3.5-5.el9, please check if needed.

*** This bug has been marked as a duplicate of bug 2041503 ***