Bug 2152002

Summary: SELinux is preventing fprintd from read, write access on the chr_file 050.
Product: [Fedora] Fedora Reporter: Kamil Páral <kparal>
Component: selinux-policyAssignee: Zdenek Pytela <zpytela>
Status: ASSIGNED --- QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 37CC: dwalsh, lvrabec, mmalik, omosnacek, pkoncity, vmojzis, zpytela
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:003fd949f46b2c22a1cb68640fb6a1942febf582ae1b958e570f4df8d4453f4c;VARIANT_ID=workstation;
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 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 Kamil Páral 2022-12-08 20:29:58 UTC
Description of problem:
I resumed my laptop and logged in, that's all.
SELinux is preventing fprintd from read, write access on the chr_file 050.

*****  Plugin device (91.4 confidence) suggests   ****************************

If you want to allow fprintd to have read write access on the 050 chr_file
Then you need to change the label on 050 to a type of a similar device.
Do
# semanage fcontext -a -t SIMILAR_TYPE '050'
# restorecon -v '050'

*****  Plugin catchall (9.59 confidence) suggests   **************************

If you believe that fprintd should be allowed read write access on the 050 chr_file 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 'fprintd' --raw | audit2allow -M my-fprintd
# semodule -X 300 -i my-fprintd.pp

Additional Information:
Source Context                system_u:system_r:fprintd_t:s0
Target Context                system_u:object_r:device_t:s0
Target Objects                050 [ chr_file ]
Source                        fprintd
Source Path                   fprintd
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
SELinux Policy RPM            selinux-policy-targeted-37.15-1.fc37.noarch
Local Policy RPM              selinux-policy-targeted-37.15-1.fc37.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 6.0.11-300.fc37.x86_64 #1 SMP
                              PREEMPT_DYNAMIC Fri Dec 2 20:47:45 UTC 2022 x86_64
                              x86_64
Alert Count                   1
First Seen                    2022-12-08 21:28:35 CET
Last Seen                     2022-12-08 21:28:35 CET
Local ID                      961be7c5-316f-42f8-8bc8-854bc8d002fd

Raw Audit Messages
type=AVC msg=audit(1670531315.15:658): avc:  denied  { read write } for  pid=157925 comm="fprintd" name="050" dev="devtmpfs" ino=2052 scontext=system_u:system_r:fprintd_t:s0 tcontext=system_u:object_r:device_t:s0 tclass=chr_file permissive=0


Hash: fprintd,fprintd_t,device_t,chr_file,read,write

Version-Release number of selected component:
selinux-policy-targeted-37.15-1.fc37.noarch

Additional info:
component:      selinux-policy
reporter:       libreport-2.17.4
hashmarkername: setroubleshoot
kernel:         6.0.11-300.fc37.x86_64
type:           libreport

Potential duplicate: bug 2087101

Comment 1 Zdenek Pytela 2022-12-09 08:52:49 UTC
This is a dup of bz#2087101.
Do you know how to reproduce it or when exactly this happens? Do you have any special settings for fprintd?

Comment 2 Kamil Páral 2022-12-09 13:28:44 UTC
No, I really don't know how to trigger it. I tried suspending and resuming a few more times, but the denial hasn't repeated, even after reboot. I don't have any custom configuration, I don't use the fingerprint reader, I haven't touched it at all since I installed the OS. Perhaps a race condition of sorts?

Comment 3 Zdenek Pytela 2023-07-14 21:43:38 UTC
Perhaps a related problem:
https://bugzilla.redhat.com/show_bug.cgi?id=2217872