Bug 742659

Summary: SELinux is preventing /bin/bash from 'getattr' accesses on the file /bin/systemctl.
Product: [Fedora] Fedora Reporter: canty978
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: rawhideCC: canty978, dominick.grift, dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard: setroubleshoot_trace_hash:9bd10153308d770c5af0c1c04e1724f7aea46bba835fce226aa39a9066c12b90
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-02-10 08:53:53 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 canty978 2011-10-01 01:21:07 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 sh /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:kdumpgui_t:s0-s0:c0.c1023
Target Context                system_u:object_r:systemd_systemctl_exec_t:s0
Target Objects                /bin/systemctl [ file ]
Source                        sh
Source Path                   /bin/bash
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           bash-4.2.10-4.fc15
Target RPM Packages           systemd-units-26-10.fc15
Policy RPM                    selinux-policy-3.9.16-39.fc15
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 2.6.40.4-5.fc15.x86_64
                              #1 SMP Tue Aug 30 14:38:32 UTC 2011 x86_64 x86_64
Alert Count                   2
First Seen                    Fri 30 Sep 2011 09:06:31 PM EDT
Last Seen                     Fri 30 Sep 2011 09:08:30 PM EDT
Local ID                      270733d2-2da9-428e-886c-53f4bfe4160f

Raw Audit Messages
type=AVC msg=audit(1317431310.408:91): avc:  denied  { getattr } for  pid=15705 comm="sh" path="/bin/systemctl" dev=dm-1 ino=62221 scontext=system_u:system_r:kdumpgui_t:s0-s0:c0.c1023 tcontext=system_u:object_r:systemd_systemctl_exec_t:s0 tclass=file


type=SYSCALL msg=audit(1317431310.408:91): arch=x86_64 syscall=stat success=no exit=EACCES a0=28427a0 a1=7fff2ef75230 a2=7fff2ef75230 a3=0 items=0 ppid=15704 pid=15705 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=sh exe=/bin/bash subj=system_u:system_r:kdumpgui_t:s0-s0:c0.c1023 key=(null)

Hash: sh,kdumpgui_t,systemd_systemctl_exec_t,file,getattr

audit2allow

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

audit2allow -R

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

Comment 1 Miroslav Grepl 2011-10-03 08:26:54 UTC
Fixed in selinux-policy-3.10.0-35.fc16

The build is available from koji for now

http://koji.fedoraproject.org/koji/buildinfo?buildID=266002