Bug 1478492

Summary: SELinux is preventing loadkeys from 'open' accesses on the chr_file /dev/tty1.
Product: [Fedora] Fedora Reporter: Joachim Frieben <jfrieben>
Component: selinux-policyAssignee: Lukas Vrabec <lvrabec>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 27CC: dominick.grift, dwalsh, lsm5, lvrabec, mgrepl, plautrba, pmoore, ssekidde
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:f1a7cd4d9b2a7537426f1edf49b3b34396b50e0f2dcceda754c5f3c187e5a596;VARIANT_ID=workstation;
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-05-22 10:11:33 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 Joachim Frieben 2017-08-04 16:51:41 UTC
Description of problem:
SELinux is preventing loadkeys from 'open' accesses on the chr_file /dev/tty1.

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

If you want to allow daemons to use tty
Then you must tell SELinux about this by enabling the 'daemons_use_tty' boolean.

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 tty1 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 '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/tty1 [ chr_file ]
Source                        loadkeys
Source Path                   loadkeys
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-265.fc27.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 4.13.0-0.rc2.git3.1.fc27.x86_64 #1
                              SMP Fri Jul 28 16:02:24 UTC 2017 x86_64 x86_64
Alert Count                   6
First Seen                    2017-08-04 16:57:12 CEST
Last Seen                     2017-08-04 16:57:19 CEST
Local ID                      686e7800-8b32-4e86-84d7-9ad646b695f0

Raw Audit Messages
type=AVC msg=audit(1501858639.233:275): avc:  denied  { open } for  pid=1844 comm="loadkeys" path="/dev/tty1" dev="devtmpfs" ino=38 scontext=system_u:system_r:loadkeys_t:s0 tcontext=unconfined_u:object_r:user_tty_device_t:s0 tclass=chr_file permissive=0


Hash: loadkeys,loadkeys_t,user_tty_device_t,chr_file,open

Version-Release number of selected component:
selinux-policy-3.13.1-265.fc27.noarch

Additional info:
component:      selinux-policy
reporter:       libreport-2.9.1
hashmarkername: setroubleshoot
kernel:         4.13.0-0.rc2.git3.1.fc27.x86_64
type:           libreport

Comment 1 Jan Kurik 2017-08-15 08:52:44 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 27 development cycle.
Changing version to '27'.

Comment 2 Lukas Vrabec 2018-05-22 10:11:33 UTC

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