Bug 962157

Summary: SELinux is preventing /usr/bin/login from 'read' accesses on the file /home/ankur/.hushlogin.
Product: [Fedora] Fedora Reporter: Ankur Sinha (FranciscoD) <sanjay.ankur>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 19CC: dominick.grift, dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:dbd1f128ab88f3f193c2d19005fefa2af9e54d51073ae1a3a7c59c02fbb41c9c
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-05-12 10:50:51 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 Ankur Sinha (FranciscoD) 2013-05-12 05:19:41 UTC
Description of problem:
Gnome-shell seemed to hang up. I used a virtual terminal to kill it so it would restart. Got this avc denial. I used the restorecon command it suggested, still thought the bug may be worth reporting.
SELinux is preventing /usr/bin/login from 'read' accesses on the file /home/ankur/.hushlogin.

*****  Plugin restorecon (99.5 confidence) suggests  *************************

If you want to fix the label. 
/home/ankur/.hushlogin default label should be local_login_home_t.
Then you can run restorecon.
Do
# /sbin/restorecon -v /home/ankur/.hushlogin

*****  Plugin catchall (1.49 confidence) suggests  ***************************

If you believe that login should be allowed read access on the .hushlogin 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:
# grep login /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:local_login_t:s0-s0:c0.c1023
Target Context                unconfined_u:object_r:user_home_t:s0
Target Objects                /home/ankur/.hushlogin [ file ]
Source                        login
Source Path                   /usr/bin/login
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           util-linux-2.23-1.fc19.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.12.1-42.fc19.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 3.9.1-301.fc19.x86_64 #1 SMP Wed
                              May 8 18:02:34 UTC 2013 x86_64 x86_64
Alert Count                   4
First Seen                    2013-05-08 02:07:52 EST
Last Seen                     2013-05-12 15:15:06 EST
Local ID                      fd947164-dc63-40eb-a92a-8832023e227d

Raw Audit Messages
type=AVC msg=audit(1368335706.530:886): avc:  denied  { read } for  pid=20453 comm="login" name=".hushlogin" dev="sda5" ino=264488 scontext=system_u:system_r:local_login_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:user_home_t:s0 tclass=file


type=SYSCALL msg=audit(1368335706.530:886): arch=x86_64 syscall=open success=no exit=EACCES a0=7fffda7e85a0 a1=0 a2=0 a3=37b5e1b2e0 items=0 ppid=1 pid=20453 auid=1000 uid=0 gid=0 euid=1000 suid=1000 fsuid=1000 egid=1000 sgid=1000 fsgid=1000 ses=24 tty=tty2 comm=login exe=/usr/bin/login subj=system_u:system_r:local_login_t:s0-s0:c0.c1023 key=(null)

Hash: login,local_login_t,user_home_t,file,read

audit2allow

#============= local_login_t ==============
allow local_login_t user_home_t:file read;

audit2allow -R
require {
	type local_login_t;
}

#============= local_login_t ==============
mta_mailserver_delivery(local_login_t)


Additional info:
reporter:       libreport-2.1.4
hashmarkername: setroubleshoot
kernel:         3.9.1-301.fc19.x86_64
type:           libreport

Comment 1 Daniel Walsh 2013-05-12 10:50:51 UTC
The alert tells you what to do.

/sbin/restorecon -v /home/ankur/.hushlogin

Comment 2 Daniel Walsh 2013-05-12 10:57:03 UTC
9344056a661b92e857762bdc49141c391487093c Fixes this so the file will be created with the correct label, by default.