Bug 1574355

Summary: SELinux is preventing loadkeys from 'open' accesses on the chr_file /dev/tty2.
Product: [Fedora] Fedora Reporter: Sandro Bonazzola <sbonazzo>
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, jfrieben, lvrabec, mgrepl, plautrba, pmoore
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:f1a7cd4d9b2a7537426f1edf49b3b34396b50e0f2dcceda754c5f3c187e5a596;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:45:12 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 Sandro Bonazzola 2018-05-03 06:30:33 UTC
Description of problem:
SELinux is preventing loadkeys from 'open' accesses on the chr_file /dev/tty2.

*****  Plugin catchall_boolean (89.3 confidence) suggests   ******************

If you want to allow all daemons the ability to read/write terminals
Then รจ necessario informare SELinux abilitando il booleano 'daemons_use_tty' .
Per maggiori informazioni consultare le pagina man di 'loadkeys_selinux'.
Do
setsebool -P daemons_use_tty 1

*****  Plugin catchall (11.6 confidence) suggests   **************************

If you believe that loadkeys should be allowed open access on the tty2 chr_file by default.
Then si dovrebbe riportare il problema come bug.
E' possibile generare un modulo di politica locale per consentire questo accesso.
Do
allow this access for now by executing:
# ausearch -c 'loadkeys' --raw | audit2allow -M my-loadkeys
# semodule -X 300 -i my-loadkeys.pp

Additional Information:
Source Context                system_u:system_r:loadkeys_t:s0
Target Context                unconfined_u:object_r:user_tty_device_t:s0
Target Objects                /dev/tty2 [ chr_file ]
Source                        loadkeys
Source Path                   loadkeys
Port                          <Sconosciuto>
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                Permissive
Host Name                     (removed)
Platform                      Linux (removed) 4.16.6-300.fc28.x86_64 #1 SMP Mon
                              Apr 30 14:27:38 UTC 2018 x86_64 x86_64
Alert Count                   1
First Seen                    2018-05-03 08:22:36 CEST
Last Seen                     2018-05-03 08:22:36 CEST
Local ID                      d5bd9662-cb97-4f51-8fc2-e120cf768128

Raw Audit Messages
type=AVC msg=audit(1525328556.928:368): avc:  denied  { open } for  pid=6450 comm="loadkeys" path="/dev/tty2" dev="devtmpfs" ino=3094 scontext=system_u:system_r:loadkeys_t:s0 tcontext=unconfined_u:object_r:user_tty_device_t:s0 tclass=chr_file permissive=1


Hash: loadkeys,loadkeys_t,user_tty_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.6-300.fc28.x86_64
type:           libreport

Potential duplicate: bug 1478492

Comment 1 Lukas Vrabec 2018-05-22 10:11:33 UTC
*** Bug 1478492 has been marked as a duplicate of this bug. ***

Comment 2 Fedora Update System 2018-05-24 14:37:24 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 3 Fedora Update System 2018-05-25 18:43:24 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 4 Fedora Update System 2018-05-26 20:45:12 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.