Bug 1578915

Summary: SELinux is preventing polkit-agent-he from 'open' accesses on the chr_file /dev/hidraw2.
Product: [Fedora] Fedora Reporter: Dmitri Smirnov <cserpentis>
Component: selinux-policyAssignee: Lukas Vrabec <lvrabec>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 28CC: dwalsh, lvrabec, mgrepl, plautrba, pmoore
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:183d7e97d536dc197f5ebfddb45b9c38a44e3ff8dcbd92926fd63e620691700e;VARIANT_ID=workstation;
Fixed In Version: selinux-policy-3.14.1-29.fc28 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-05-26 20:44:38 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Dmitri Smirnov 2018-05-16 15:26:03 UTC
Description of problem:
When I try to use U2F Yubikey as authentication for a sudo command and configure it appropriately in the /etc/pam.d/, then every time I issue `sudo` command, then I get a denial from SELinux and authentication request for U2F is skipped and goes directly to password prompt
SELinux is preventing polkit-agent-he from 'open' accesses on the chr_file /dev/hidraw2.

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

If you believe that polkit-agent-he should be allowed open access on the hidraw2 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 'polkit-agent-he' --raw | audit2allow -M my-polkitagenthe
# semodule -X 300 -i my-polkitagenthe.pp

Additional Information:
Source Context                system_u:system_r:policykit_auth_t:s0-s0:c0.c1023
Target Context                system_u:object_r:usb_device_t:s0
Target Objects                /dev/hidraw2 [ chr_file ]
Source                        polkit-agent-he
Source Path                   polkit-agent-he
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.14.1-24.fc28.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 4.16.8-300.fc28.x86_64 #1 SMP Wed
                              May 9 20:23:40 UTC 2018 x86_64 x86_64
Alert Count                   5
First Seen                    2018-05-16 17:22:09 CEST
Last Seen                     2018-05-16 17:22:09 CEST
Local ID                      76f6b993-50e9-4839-9553-715e4862a68d

Raw Audit Messages
type=AVC msg=audit(1526484129.952:302): avc:  denied  { open } for  pid=4216 comm="polkit-agent-he" path="/dev/hidraw2" dev="devtmpfs" ino=13711 scontext=system_u:system_r:policykit_auth_t:s0-s0:c0.c1023 tcontext=system_u:object_r:usb_device_t:s0 tclass=chr_file permissive=0


Hash: polkit-agent-he,policykit_auth_t,usb_device_t,chr_file,open

Version-Release number of selected component:
selinux-policy-3.14.1-24.fc28.noarch

Additional info:
component:      selinux-policy
reporter:       libreport-2.9.5
hashmarkername: setroubleshoot
kernel:         4.16.8-300.fc28.x86_64
type:           libreport

Comment 1 Fedora Update System 2018-05-24 14:36:21 UTC
selinux-policy-3.14.1-29.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-a74875b364

Comment 2 Fedora Update System 2018-05-25 18:42:47 UTC
selinux-policy-3.14.1-29.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-a74875b364

Comment 3 Fedora Update System 2018-05-26 20:44:38 UTC
selinux-policy-3.14.1-29.fc28 has been pushed to the Fedora 28 stable repository. If problems still persist, please make note of it in this bug report.