Bug 696378

Summary: SELinux is preventing /bin/bash from 'getattr' accesses on the file /bin/systemctl.
Product: [Fedora] Fedora Reporter: C. M. Trindade <rhttrindade>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 15CC: dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard: setroubleshoot_trace_hash:bb4b979279294e82fc18c491dcca9cdd8f446d1fe773746231c62d2fa60ca79a
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-04-14 06:43:00 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 C. M. Trindade 2011-04-13 22:57:28 UTC
SELinux is preventing /bin/bash from 'getattr' accesses on the file /bin/systemctl.

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

If you believe that bash should be allowed getattr access on the systemctl 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 ck-system-stop /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:consolekit_t:s0
Target Context                system_u:object_r:systemd_systemctl_exec_t:s0
Target Objects                /bin/systemctl [ file ]
Source                        ck-system-stop
Source Path                   /bin/bash
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           bash-4.2.8-2.fc15
Target RPM Packages           systemd-units-24-1.fc15
Policy RPM                    selinux-policy-3.9.16-14.fc15
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 2.6.38.2-9.fc15.i686 #1 SMP
                              Wed Mar 30 16:54:01 UTC 2011 i686 i686
Alert Count                   1
First Seen                    Wed 13 Apr 2011 11:51:50 PM WEST
Last Seen                     Wed 13 Apr 2011 11:51:50 PM WEST
Local ID                      e2fd8df8-a425-4595-a0e6-a0025ca85ee9

Raw Audit Messages
type=AVC msg=audit(1302735110.753:197): avc:  denied  { getattr } for  pid=5492 comm="ck-system-stop" path="/bin/systemctl" dev=dm-1 ino=17352 scontext=system_u:system_r:consolekit_t:s0 tcontext=system_u:object_r:systemd_systemctl_exec_t:s0 tclass=file


type=SYSCALL msg=audit(1302735110.753:197): arch=i386 syscall=stat64 success=no exit=EACCES a0=9a21760 a1=bfcba200 a2=445f2ff4 a3=9a21760 items=0 ppid=5491 pid=5492 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=ck-system-stop exe=/bin/bash subj=system_u:system_r:consolekit_t:s0 key=(null)

Hash: ck-system-stop,consolekit_t,systemd_systemctl_exec_t,file,getattr

audit2allow

#============= consolekit_t ==============
allow consolekit_t systemd_systemctl_exec_t:file getattr;

audit2allow -R

#============= consolekit_t ==============
allow consolekit_t systemd_systemctl_exec_t:file getattr;

Comment 1 C. M. Trindade 2011-04-13 23:07:58 UTC
Computer did not shutdown after

1) Selecting Logout from the LXDE Desktop
2) Selecting Shutdown

and generated alert.

Comment 2 Miroslav Grepl 2011-04-14 06:43:00 UTC

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