Bug 991555 - SELinux is preventing /usr/sbin/dovecot from 'name_bind' accesses on the tcp_socket .
SELinux is preventing /usr/sbin/dovecot from 'name_bind' accesses on the tcp_...
Product: Fedora
Classification: Fedora
Component: selinux-policy (Show other bugs)
x86_64 Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Miroslav Grepl
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2013-08-02 13:46 EDT by Steven Rostedt
Modified: 2013-09-22 20:44 EDT (History)
4 users (show)

See Also:
Fixed In Version: selinux-policy-3.11.1-103.fc18
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-09-22 20:44:09 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 Steven Rostedt 2013-08-02 13:46:35 EDT
Description of problem:
Everytime I boot dovecot fails due to selinux.

I follow the directions given in trouble shooting:

# grep dovecot /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

and it works fine after that. But on next boot, it fails again with the same issue??
SELinux is preventing /usr/sbin/dovecot from 'name_bind' accesses on the tcp_socket .

*****  Plugin bind_ports (92.2 confidence) suggests  *************************

If you want to allow /usr/sbin/dovecot to bind to network port 10993
Then you need to modify the port type.
# semanage port -a -t PORT_TYPE -p tcp 10993
    where PORT_TYPE is one of the following: lmtp_port_t, mail_port_t, pop_port_t, sieve_port_t.

*****  Plugin catchall_boolean (7.83 confidence) suggests  *******************

If you want to allow system to run with NIS
Then you must tell SELinux about this by enabling the 'nis_enabled' boolean.
You can read 'None' man page for more details.
setsebool -P nis_enabled 1

*****  Plugin catchall (1.41 confidence) suggests  ***************************

If you believe that dovecot should be allowed name_bind access on the  tcp_socket by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
allow this access for now by executing:
# grep dovecot /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:dovecot_t:s0
Target Context                system_u:object_r:unreserved_port_t:s0
Target Objects                 [ tcp_socket ]
Source                        dovecot
Source Path                   /usr/sbin/dovecot
Port                          10993
Host                          (removed)
Source RPM Packages           dovecot-2.1.16-1.fc18.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.11.1-98.fc18.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 3.9.11-200.fc18.x86_64 #1 SMP Mon
                              Jul 22 21:04:50 UTC 2013 x86_64 x86_64
Alert Count                   3
First Seen                    2013-08-02 12:06:22 EDT
Last Seen                     2013-08-02 13:39:34 EDT
Local ID                      5c80a294-1e4c-4d09-89da-c30743fdfc40

Raw Audit Messages
type=AVC msg=audit(1375465174.610:1564): avc:  denied  { name_bind } for  pid=11183 comm="dovecot" src=10993 scontext=system_u:system_r:dovecot_t:s0 tcontext=system_u:object_r:unreserved_port_t:s0 tclass=tcp_socket

type=SYSCALL msg=audit(1375465174.610:1564): arch=x86_64 syscall=bind success=no exit=EACCES a0=1d a1=7fff0ec67840 a2=10 a3=7fff0ec67838 items=0 ppid=1 pid=11183 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 ses=4294967295 tty=(none) comm=dovecot exe=/usr/sbin/dovecot subj=system_u:system_r:dovecot_t:s0 key=(null)

Hash: dovecot,dovecot_t,unreserved_port_t,tcp_socket,name_bind


#============= dovecot_t ==============
#!!!! This avc is allowed in the current policy

allow dovecot_t unreserved_port_t:tcp_socket name_bind;

audit2allow -R
require {
	type dovecot_t;

#============= dovecot_t ==============

Additional info:
reporter:       libreport-2.1.5
hashmarkername: setroubleshoot
kernel:         3.9.11-200.fc18.x86_64
type:           libreport
Comment 1 Miroslav Grepl 2013-08-05 01:45:59 EDT
Is tcp/10993 used by default?
Comment 2 Daniel Walsh 2013-08-05 12:40:03 EDT
Google 10933 and dovecot shows it described as the way to setup as an IMAP server.
Comment 3 Steven Rostedt 2013-08-05 18:14:23 EDT
I usually use 10993 as it is just a local imap server (only my local box connects to it). I seldom use the default port for security reasons, but then again, 10993 is also common for someone to sniff. I do have both 10993 and 993 blocked from external access via iptables.
Comment 4 Daniel Walsh 2013-08-06 08:23:29 EDT
So lets label it the same.
acff17d6ac79a70f56e93420174c9a5466eb59f5 makes this change in git.

You can put this on your machine for now with

semanage port -a -t pop_port_t -p tcp 10993
Comment 5 Fedora Update System 2013-09-02 11:28:17 EDT
selinux-policy-3.11.1-101.fc18 has been submitted as an update for Fedora 18.
Comment 6 Fedora Update System 2013-09-02 19:26:58 EDT
Package selinux-policy-3.11.1-101.fc18:
* should fix your issue,
* was pushed to the Fedora 18 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.11.1-101.fc18'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).
Comment 7 Fedora Update System 2013-09-10 07:17:08 EDT
selinux-policy-3.11.1-103.fc18 has been submitted as an update for Fedora 18.
Comment 8 Fedora Update System 2013-09-22 20:44:09 EDT
selinux-policy-3.11.1-103.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.

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