Bug 234126 - selinux does not allow squid to bind reserved/privileged network ports
selinux does not allow squid to bind reserved/privileged network ports
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: selinux-policy (Show other bugs)
All Linux
medium Severity low
: ---
: ---
Assigned To: Daniel Walsh
Depends On:
  Show dependency treegraph
Reported: 2007-03-27 05:03 EDT by Thorsten Schlichting
Modified: 2008-02-26 10:16 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-03-27 09:49:38 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Thorsten Schlichting 2007-03-27 05:03:58 EDT
Description of problem:
If for some reason you have to choose the listen ports of squid in the range
<1025, start of squid fails.

Version-Release number of selected component (if applicable):

How reproducible:
Change the ports in /etc/squid/squid.conf:
# http_port 3128
http_port 81
# icp_port 3130
icp_port 81

Steps to Reproduce:
Actual results:

type=AVC msg=audit(1174922283.052:525): avc:  denied  { name_bind } for 
pid=9659 comm="squid" src=81 scontext=root:system_r:squid_t:s0
tcontext=system_u:object_r:reserved_port_t:s0 tclass=tcp_socket

type=AVC msg=audit(1174985649.607:644): avc:  denied  { name_bind } for 
pid=12519 comm="squid" src=81 scontext=root:system_r:squid_t:s0
tcontext=system_u:object_r:reserved_port_t:s0 tclass=udp_socket

There is also an other error, don't know if it's important:

type=AVC msg=audit(1174922286.075:526): avc:  denied  { search } for  pid=9664
comm="squid" name="tmp" dev=dm-0 ino=780289 scontext=root:system_r:squid_t:s0
 tcontext=system_u:object_r:tmp_t:s0 tclass=dir

Expected results:

Additional info:
Comment 1 Daniel Walsh 2007-03-27 09:49:38 EDT
If you want to change the http port in selinux, you would execute

semanage port -a -t http_port_t -p tcp 81

This would then define port 81 to a port that squid can listen too.
Comment 2 Tim Towers 2008-02-25 10:25:13 EST
I suspect the SElinux type in the comment is incorrect, http_cache_port_t seems
more accurate for RHEL5.

semanage port -a -t http_cache_port_t -p tcp 80

However, running that command returns the following error
/usr/sbin/semanage: Port tcp/80 already defined
semanage port -d -p tcp 80
/usr/sbin/semanage: Port tcp/80 is defined in policy, cannot be deleted
Comment 3 Daniel Walsh 2008-02-26 10:16:40 EST
Well he stated he wanted to use port 81.

Note You need to log in before you can comment on or make changes to this bug.