Bug 703044

Summary: SELinux is preventing /usr/sbin/sshd from 'getattr' accesses on the file /bin/systemctl.
Product: [Fedora] Fedora Reporter: Sandro Mathys <sandro>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 15CC: dwalsh, jghobrial, linux.n.pkd, marco.guazzone, mgrepl, poc, taviso
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard: setroubleshoot_trace_hash:bd66ba422779cb26e4c871a7760e8d06ff2c2237f991ad16e61b6fc674d63b46
Fixed In Version: selinux-policy-3.9.16-30.fc15 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-06-24 03:53:46 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 Sandro Mathys 2011-05-09 05:58:57 UTC
SELinux is preventing /usr/sbin/sshd from 'getattr' accesses on the file /bin/systemctl.

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

If you believe that sshd 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 sshd /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:sshd_t:s0-s0:c0.c1023
Target Context                system_u:object_r:systemd_systemctl_exec_t:s0
Target Objects                /bin/systemctl [ file ]
Source                        sshd
Source Path                   /usr/sbin/sshd
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           openssh-server-5.6p1-30.fc15
Target RPM Packages           systemd-units-24-1.fc15
Policy RPM                    selinux-policy-3.9.16-15.fc15
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed)
                              2.6.38.2-9.fc15.x86_64 #1 SMP Wed Mar 30 16:55:57
                              UTC 2011 x86_64 x86_64
Alert Count                   1
First Seen                    Mon 09 May 2011 03:09:11 AM CEST
Last Seen                     Mon 09 May 2011 03:09:11 AM CEST
Local ID                      8220166f-6ea1-4dee-be3e-0e16a14117be

Raw Audit Messages
type=AVC msg=audit(1304903351.918:6202): avc:  denied  { getattr } for  pid=9814 comm="sshd" path="/bin/systemctl" dev=dm-0 ino=20766 scontext=system_u:system_r:sshd_t:s0-s0:c0.c1023 tcontext=system_u:object_r:systemd_systemctl_exec_t:s0 tclass=file


type=SYSCALL msg=audit(1304903351.918:6202): arch=x86_64 syscall=stat success=no exit=EACCES a0=7fa8affb85e0 a1=7fff87e87640 a2=7fff87e87640 a3=0 items=0 ppid=1281 pid=9814 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=sshd exe=/usr/sbin/sshd subj=system_u:system_r:sshd_t:s0-s0:c0.c1023 key=(null)

Hash: sshd,sshd_t,systemd_systemctl_exec_t,file,getattr

audit2allow

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

audit2allow -R

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

Comment 1 Miroslav Grepl 2011-05-09 13:32:13 UTC
It should be fixed in the latest release. Please run 

yum update selinux-policy

Comment 2 Marco Guazzone 2011-06-05 11:37:09 UTC
Hi,
Even if I have the latest selinux-policy 3.9.16-25, I am facing with this error.

Thanks

Comment 3 Miroslav Grepl 2011-06-06 09:30:05 UTC
You are right, I apologize.

Fixed in selinux-policy 3.9.16-27.noarch

Comment 4 Fedora Update System 2011-06-10 10:49:17 UTC
selinux-policy-3.9.16-29.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/selinux-policy-3.9.16-29.fc15

Comment 5 Fedora Update System 2011-06-11 04:28:42 UTC
Package selinux-policy-3.9.16-29.fc15:
* should fix your issue,
* was pushed to the Fedora 15 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing selinux-policy-3.9.16-29.fc15'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/selinux-policy-3.9.16-29.fc15
then log in and leave karma (feedback).

Comment 6 Marco Guazzone 2011-06-11 21:00:40 UTC
Karma left.
SELinux stops to show this alert but I get other alerts.
See bugs:
https://bugzilla.redhat.com/show_bug.cgi?id=712622
https://bugzilla.redhat.com/show_bug.cgi?id=712623
https://bugzilla.redhat.com/show_bug.cgi?id=697223
Furthermore, SELinux shows this alert (which apparently cannot be submitted):

--- [selinux alert] ---
SELinux is preventing /sbin/iptables-multi from 'read, write' accesses on the file /tmp/ffiUjiPsP (deleted).

*****  Plugin leaks (50.5 confidence) suggests  ******************************

If you want to ignore iptables-multi trying to read write access the ffiUjiPsP (deleted) file, because you believe it should not need this access.
Then you should report this as a bug.  
You can generate a local policy module to dontaudit this access.
Do
# grep /sbin/iptables-multi /var/log/audit/audit.log | audit2allow -D -M mypol
# semodule -i mypol.pp

*****  Plugin catchall (50.5 confidence) suggests  ***************************

If you believe that iptables-multi should be allowed read write access on the ffiUjiPsP (deleted) 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 iptables /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:iptables_t:s0
Target Context                system_u:object_r:fail2ban_tmp_t:s0
Target Objects                /tmp/ffiUjiPsP (deleted) [ file ]
Source                        iptables
Source Path                   /sbin/iptables-multi
Port                          <Unknown>
Host                          scramble
Source RPM Packages           iptables-1.4.10-2.fc15
Target RPM Packages           
Policy RPM                    selinux-policy-3.9.16-29.fc15
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     scramble
Platform                      Linux scramble 2.6.38.7-30.fc15.x86_64 #1 SMP Fri
                              May 27 05:15:53 UTC 2011 x86_64 x86_64
Alert Count                   12
First Seen                    Sat 11 Jun 2011 10:13:26 PM CEST
Last Seen                     Sat 11 Jun 2011 10:17:05 PM CEST
Local ID                      5209ed89-0270-4850-b759-cb74c16c9504

Raw Audit Messages
type=AVC msg=audit(1307823425.143:74): avc:  denied  { read write } for  pid=1866 comm="iptables" path=2F746D702F666669556A69507350202864656C6574656429 dev=sda5 ino=393229 scontext=system_u:system_r:iptables_t:s0 tcontext=system_u:object_r:fail2ban_tmp_t:s0 tclass=file


type=SYSCALL msg=audit(1307823425.143:74): arch=x86_64 syscall=execve success=yes exit=0 a0=1df86c0 a1=1df8740 a2=1df8230 a3=1 items=0 ppid=1853 pid=1866 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=iptables exe=/sbin/iptables-multi subj=system_u:system_r:iptables_t:s0 key=(null)

Hash: iptables,iptables_t,fail2ban_tmp_t,file,read,write

audit2allow

#============= iptables_t ==============
allow iptables_t fail2ban_tmp_t:file { read write };

audit2allow -R

#============= iptables_t ==============
allow iptables_t fail2ban_tmp_t:file { read write };

--- [/selinux alert] ---

Comment 7 Daniel Walsh 2011-06-14 15:49:16 UTC
Need to dontaudit leaks, although It would be nice if fail2ban or the library it is calling did not leak.

Comment 8 Fedora Update System 2011-06-21 17:30:14 UTC
Package selinux-policy-3.9.16-30.fc15:
* should fix your issue,
* was pushed to the Fedora 15 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing selinux-policy-3.9.16-30.fc15'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/selinux-policy-3.9.16-30.fc15
then log in and leave karma (feedback).

Comment 9 Marco Guazzone 2011-06-22 08:02:02 UTC
Positive karma left. Thank you very much!

Comment 10 Fedora Update System 2011-06-24 03:52:08 UTC
selinux-policy-3.9.16-30.fc15 has been pushed to the Fedora 15 stable repository.  If problems still persist, please make note of it in this bug report.