Bug 705689

Summary: SELinux is preventing /usr/sbin/httpd from 'name_bind' accesses on the tcp_socket port 3636.
Product: [Fedora] Fedora Reporter: Tristan Scott <tscott>
Component: piranhaAssignee: Ryan O'Hara <rohara>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 14CC: dwalsh, mgrac, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard: setroubleshoot_trace_hash:88dad918ddaf362e3a9184801910b30301e6943dbaa23e259facd3047d6c80eb
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-02-23 17:57: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 Tristan Scott 2011-05-18 05:59:03 UTC
SELinux is preventing /usr/sbin/httpd from 'name_bind' accesses on the tcp_socket port 3636.

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

If you believe that httpd should be allowed name_bind access on the port 3636 tcp_socket 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 piranha_gui /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:httpd_t:s0
Target Context                system_u:object_r:piranha_port_t:s0
Target Objects                port 3636 [ tcp_socket ]
Source                        piranha_gui
Source Path                   /usr/sbin/httpd
Port                          3636
Host                          (removed)
Source RPM Packages           httpd-2.2.17-1.fc14
Target RPM Packages           
Policy RPM                    selinux-policy-3.9.7-40.fc14
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed)
                              2.6.35.12-88.fc14.x86_64 #1 SMP Thu Mar 31
                              21:21:57 UTC 2011 x86_64 x86_64
Alert Count                   2
First Seen                    Wed 18 May 2011 15:57:39 EST
Last Seen                     Wed 18 May 2011 15:57:39 EST
Local ID                      166f691d-a77b-4a2b-95cd-0f3a357a6ec4

Raw Audit Messages
type=AVC msg=audit(1305698259.941:84739): avc:  denied  { name_bind } for  pid=25199 comm="piranha_gui" src=3636 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:piranha_port_t:s0 tclass=tcp_socket


type=SYSCALL msg=audit(1305698259.941:84739): arch=x86_64 syscall=bind success=no exit=EACCES a0=3 a1=7f2f2eedb788 a2=10 a3=7fff0fe0d66c items=0 ppid=25198 pid=25199 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=piranha_gui exe=/usr/sbin/httpd subj=system_u:system_r:httpd_t:s0 key=(null)

Hash: piranha_gui,httpd_t,piranha_port_t,tcp_socket,name_bind

audit2allow

#============= httpd_t ==============
allow httpd_t piranha_port_t:tcp_socket name_bind;

audit2allow -R

#============= httpd_t ==============
allow httpd_t piranha_port_t:tcp_socket name_bind;

Comment 1 Daniel Walsh 2011-05-18 06:41:14 UTC
Is apache supposed to be able to launch piranha_gui?

Comment 2 Miroslav Grepl 2011-05-18 11:09:51 UTC
Well, there should be a transition.

Tristan,
what does

# ls -Z /usr/sbin/piranha_gui

Comment 3 Tristan Scott 2011-05-18 21:58:28 UTC
Miroslav:

# ls -Z /usr/sbin/piranha_gui
lrwxrwxrwx. root root system_u:object_r:bin_t:s0       /usr/sbin/piranha_gui -> /usr/sbin/httpd


I'm not sure how a separate policy for piranha is supposed to work if the binary is just symlinked to httpd.

I probably should have noted that this happens when it is invoked via systemd. I can re-test using upstart to see if that makes a difference, if you like?

Comment 4 Miroslav Grepl 2011-05-19 13:23:11 UTC
Well this is a bug in piranha. We need a fix which we have in RHEL.

Comment 5 Ryan O'Hara 2012-02-23 17:57:46 UTC
Piranha has been retired in F17. Setting this bug as CLOSED.