Bug 1993589

Summary: SELinux is preventing smartd from 'read' accesses on the chr_file nvme0.
Product: [Fedora] Fedora Reporter: Matthias Andree <matthias.andree>
Component: smartmontoolsAssignee: Michal Hlavinka <mhlavink>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 33CC: atstjx, dwagelaar, mhlavink, tsmetana
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:0b597acc808ce3fc5bb3345c940a598b80e253c0853c81ccd1e1bd7cfa0535ee;VARIANT_ID=workstation;
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-08-16 20:56:45 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:

Description Matthias Andree 2021-08-14 09:52:54 UTC
Description of problem:
This happened out of the blue while updating the policy. Unsure whether this is an artifact of the smartmontools-selinux upgrade with a running smartd (that could be worked around with other installation scripts maybe) or something lasting. Will continue observing.
SELinux is preventing smartd from 'read' accesses on the chr_file nvme0.

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

Wenn Sie denken, dass es smartd standardmäßig erlaubt sein sollte, read Zugriff auf nvme0 chr_file zu erhalten.
Then sie sollten dies als Fehler melden.
Um diesen Zugriff zu erlauben, können Sie ein lokales Richtlinien-Modul erstellen.
Do
zugriff jetzt erlauben, indem Sie die nachfolgenden Befehle ausführen:
# ausearch -c 'smartd' --raw | audit2allow -M my-smartd
# semodule -X 300 -i my-smartd.pp

Additional Information:
Source Context                system_u:system_r:fsdaemon_t:s0
Target Context                system_u:object_r:nvme_device_t:s0
Target Objects                nvme0 [ chr_file ]
Source                        smartd
Source Path                   smartd
Port                          <Unbekannt>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
SELinux Policy RPM            selinux-policy-targeted-3.14.6-39.fc33.noarch
Local Policy RPM              smartmontools-selinux-7.2-7.fc33.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 5.13.8-100.fc33.x86_64 #1 SMP Wed
                              Aug 4 14:15:51 UTC 2021 x86_64 x86_64
Alert Count                   1
First Seen                    2021-08-14 11:50:47 CEST
Last Seen                     2021-08-14 11:50:47 CEST
Local ID                      efde4a5f-7f46-4c37-9370-08877cf4f83a

Raw Audit Messages
type=AVC msg=audit(1628934647.769:169405): avc:  denied  { read } for  pid=552729 comm="smartd" name="nvme0" dev="devtmpfs" ino=314 scontext=system_u:system_r:fsdaemon_t:s0 tcontext=system_u:object_r:nvme_device_t:s0 tclass=chr_file permissive=0


Hash: smartd,fsdaemon_t,nvme_device_t,chr_file,read

Version-Release number of selected component:
selinux-policy-targeted-3.14.6-39.fc33.noarch

Additional info:
component:      smartmontools
reporter:       libreport-2.15.2
hashmarkername: setroubleshoot
kernel:         5.13.8-100.fc33.x86_64
type:           libreport

Comment 1 Dennis Wagelaar 2021-08-15 08:05:18 UTC
Similar problem has been detected:

It appears that smartd should be able to access all disk devices, including nvme.

hashmarkername: setroubleshoot
kernel:         5.13.6-100.fc33.x86_64
package:        selinux-policy-targeted-3.14.6-39.fc33.noarch
reason:         SELinux is preventing smartd from 'read' accesses on the chr_file nvme0.
type:           libreport

Comment 2 atstjx 2021-08-16 10:03:26 UTC
Similar problem has been detected:

error appeared on boot. not sure what caused it.

hashmarkername: setroubleshoot
kernel:         5.13.9-100.fc33.x86_64
package:        selinux-policy-targeted-3.14.6-39.fc33.noarch
reason:         SELinux is preventing smartd from 'read' accesses on the chr_file nvme0.
type:           libreport

Comment 3 Michal Hlavinka 2021-08-16 20:56:45 UTC

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