Bug 2365140

Summary: SELinux is preventing pmdanvidia from 'create' accesses on the directory nvidia-caps.
Product: [Fedora] Fedora Reporter: William Cohen <wcohen>
Component: pcpAssignee: William Cohen <wcohen>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 41CC: agerstmayr, fberat, jkurik, nathans, sfeifer, wcohen
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:acec79949b1e8224dc1117a8f59a041d1e54c9582d2d5476ba0b4d3492b636b2;VARIANT_ID=workstation;
Fixed In Version: pcp-6.3.7-8.fc41 Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2025-07-23 01:15:00 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
File: description
none
File: os_info none

Description William Cohen 2025-05-08 18:26:40 UTC
Description of problem:
Installed the recent nvidia drivers for cuda on the machine following the instructions at:

https://docs.nvidia.com/datacenter/tesla/driver-installation-guide/index.html

Have the following nvidia drivers installed

nvidia-driver-assistant-0.20.133.20-1.noarch
nvidia-gpu-firmware-20250410-1.fc41.noarch
nvidia-modprobe-575.51.03-1.fc41.x86_64
nvidia-kmod-common-575.51.03-1.fc41.noarch
kmod-nvidia-open-dkms-575.51.03-1.fc41.noarch
libnvidia-ml-575.51.03-1.fc41.x86_64
libnvidia-gpucomp-575.51.03-1.fc41.x86_64
libnvidia-cfg-575.51.03-1.fc41.x86_64
nvidia-driver-cuda-libs-575.51.03-1.fc41.x86_64
nvidia-driver-libs-575.51.03-1.fc41.x86_64
nvidia-driver-575.51.03-1.fc41.x86_64
nvidia-libXNVCtrl-575.51.03-1.fc41.x86_64
nvidia-settings-575.51.03-1.fc41.x86_64
libnvidia-fbc-575.51.03-1.fc41.x86_64
nvidia-persistenced-575.51.03-1.fc41.x86_64
nvidia-driver-cuda-575.51.03-1.fc41.x86_64
nvidia-open-575.51.03-1.fc41.noarch
xorg-x11-nvidia-575.51.03-1.fc41.x86_64


I attempted to run the pcp-pmda-nvidia-gpu pmda with:

sudo dnf install pcp-pmda-nvidia-gpu -y
 cd /var/lib/pcp/pmdas/nvidia
sudo ./Install
(selected daemon)

Once the pcp nvidia pmda started running got a steady stream of SEL alert messages.
SELinux is preventing pmdanvidia from 'create' accesses on the directory nvidia-caps.

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

If you believe that pmdanvidia should be allowed create access on the nvidia-caps directory 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:
# ausearch -c 'pmdanvidia' --raw | audit2allow -M my-pmdanvidia
# semodule -X 300 -i my-pmdanvidia.pp

Additional Information:
Source Context                system_u:system_r:pcp_pmcd_t:s0
Target Context                system_u:object_r:device_t:s0
Target Objects                nvidia-caps [ dir ]
Source                        pmdanvidia
Source Path                   pmdanvidia
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
SELinux Policy RPM            selinux-policy-targeted-41.38-1.fc41.noarch
Local Policy RPM              pcp-selinux-6.3.7-2.fc41.x86_64
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 6.13.9-200.fc41.x86_64 #1 SMP
                              PREEMPT_DYNAMIC Sat Mar 29 01:29:31 UTC 2025
                              x86_64
Alert Count                   674
First Seen                    2025-05-07 10:34:00 EDT
Last Seen                     2025-05-07 18:27:58 EDT
Local ID                      e0b6d12c-3882-4755-9f24-dbeb55209df3

Raw Audit Messages
type=AVC msg=audit(1746656878.649:3246): avc:  denied  { create } for  pid=29718 comm="pmdanvidia" name="nvidia-caps" scontext=system_u:system_r:pcp_pmcd_t:s0 tcontext=system_u:object_r:device_t:s0 tclass=dir permissive=0


Hash: pmdanvidia,pcp_pmcd_t,device_t,dir,create

Version-Release number of selected component:
selinux-policy-targeted-41.38-1.fc41.noarch

Additional info:
reporter:       libreport-2.17.15
package:        selinux-policy-targeted-41.38-1.fc41.noarch
reason:         SELinux is preventing pmdanvidia from 'create' accesses on the directory nvidia-caps.
kernel:         6.14.5-200.fc41.x86_64
type:           libreport
component:      pcp
hashmarkername: setroubleshoot
component:      pcp

Comment 1 William Cohen 2025-05-08 18:26:43 UTC
Created attachment 2089116 [details]
File: description

Comment 2 William Cohen 2025-05-08 18:26:45 UTC
Created attachment 2089117 [details]
File: os_info

Comment 3 William Cohen 2025-05-08 18:34:16 UTC
Also see additional selinux troublshoot alerts related to this on nvidiactl and nvidia-cap2.

Comment 4 William Cohen 2025-05-21 17:48:56 UTC
Upstream issue filed https://github.com/performancecopilot/pcp/issues/2209 and a proposed fix is mentioned on the issue.

Comment 5 William Cohen 2025-05-28 19:26:17 UTC
This fix has been merged into the mainline pcp git repo (https://github.com/performancecopilot/pcp/commit/fca2000bcd098d1e1347d51f63a1aeb788a7a353).

Comment 6 William Cohen 2025-07-14 22:15:08 UTC
The pull request was merged into the upstream pcp.  The patches for AVC denials were backported to pcp-6.3.7-8.fc41 source rpm.

Comment 7 Fedora Update System 2025-07-14 22:16:24 UTC
FEDORA-2025-0957add331 (pcp-6.3.7-8.fc41) has been submitted as an update to Fedora 41.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-0957add331

Comment 8 Fedora Update System 2025-07-15 03:11:40 UTC
FEDORA-2025-0957add331 has been pushed to the Fedora 41 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2025-0957add331`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2025-0957add331

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 9 Fedora Update System 2025-07-23 01:15:00 UTC
FEDORA-2025-0957add331 (pcp-6.3.7-8.fc41) has been pushed to the Fedora 41 stable repository.
If problem still persists, please make note of it in this bug report.