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 1668667

Summary: ptp4l cannot respond to pmc
Product: Red Hat Enterprise Linux 8 Reporter: Miroslav Lichvar <mlichvar>
Component: selinux-policyAssignee: Lukas Vrabec <lvrabec>
Status: CLOSED ERRATA QA Contact: Milos Malik <mmalik>
Severity: low Docs Contact:
Priority: low    
Version: ---CC: djez, jpoulin, lvrabec, mmalik, pcahyna, plautrba, ssekidde, zpytela
Target Milestone: rcFlags: pm-rhel: mirror+
Target Release: 8.1   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: selinux-policy-3.14.3-12.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-11-05 22:09:45 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:
Bug Depends On: 1682526    
Bug Blocks:    

Description Miroslav Lichvar 2019-01-23 09:48:50 UTC
Description of problem:
When using pmc to query ptp4l over Unix domain socket, ptp4l doesn't seem to be able to respond. From audit.log:

type=AVC msg=audit(1548236408.865:2991): avc:  denied  { write } for  pid=20086 comm="ptp4l" name="pmc.20708" dev="tmpfs" ino=314536 scontext=system_u:system_r:ptp4l_t:s0 tcontext=unconfined_u:object_r:var_run_t:s0 tclass=sock_file permissive=0

Version-Release number of selected component (if applicable):
kernel-core-4.18.0-60.el8.x86_64
selinux-policy-3.14.1-51.el8.noarch
linuxptp-2.0-2.el8.x86_64

How reproducible:
always

Steps to Reproduce:
1. start ptp4l service
2. run pmc -u -b 0 GET DOMAIN

Actual results:
No response

Expected results:
Response

Additional info:
This is similar to bug #1429853.

Comment 1 Milos Malik 2019-01-23 12:49:33 UTC
----
type=PROCTITLE msg=audit(01/23/2019 07:44:16.128:1290290) : proctitle=/usr/sbin/ptp4l -f /etc/ptp4l.conf -i eth0 -S 
type=PATH msg=audit(01/23/2019 07:44:16.128:1290290) : item=0 name=/var/run/pmc.27868 inode=1527285 dev=00:17 mode=socket,660 ouid=root ogid=root rdev=00:00 obj=unconfined_u:object_r:var_run_t:s0 nametype=NORMAL cap_fp=none cap_fi=none cap_fe=0 cap_fver=0 
type=CWD msg=audit(01/23/2019 07:44:16.128:1290290) : cwd=/ 
type=SOCKADDR msg=audit(01/23/2019 07:44:16.128:1290290) : saddr={ fam=local path=/var/run/pmc.27868 } 
type=SYSCALL msg=audit(01/23/2019 07:44:16.128:1290290) : arch=x86_64 syscall=sendto success=no exit=EACCES(Permission denied) a0=0x18 a1=0x55a41cb83c38 a2=0x68 a3=0x0 items=1 ppid=1 pid=27351 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=ptp4l exe=/usr/sbin/ptp4l subj=system_u:system_r:ptp4l_t:s0 key=(null) 
type=AVC msg=audit(01/23/2019 07:44:16.128:1290290) : avc:  denied  { write } for  pid=27351 comm=ptp4l name=pmc.27868 dev="tmpfs" ino=1527285 scontext=system_u:system_r:ptp4l_t:s0 tcontext=unconfined_u:object_r:var_run_t:s0 tclass=sock_file permissive=0 
----

SELinux policy does not define a special context for /var/run/pmc.27868 socket.

Comment 2 Lukas Vrabec 2019-07-12 10:22:04 UTC
Hi Miroslav, 

Do you know which process is creating this /var/run/pmc.27868 socket?

Thanks,
Lukas.

Comment 3 Miroslav Lichvar 2019-07-15 07:00:38 UTC
The /var/run/pmc.* sockets are opened and bound by pmc. pmc uses this socket to send a request to ptp4l listening on /var/run/ptp4l. ptp4l responds to the pmc's socket.

Comment 15 errata-xmlrpc 2019-11-05 22:09:45 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, 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-2019:3547