Bug 649663

Summary: SELinux is preventing /usr/libexec/postfix/smtpd "connectto" access on /var/spool/postfix/private/auth.
Product: [Fedora] Fedora Reporter: Ajay Ramaswamy <ajayr>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 14CC: dwalsh, fedora.jrg01, mgrepl, trailtotale
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard: setroubleshoot_trace_hash:0a2dbef40ea16e28b5d126514820a98602c85cb04e76095921dfab770a1b6411
Fixed In Version: selinux-policy-3.9.7-14.fc14 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-12-05 00:37:32 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ajay Ramaswamy 2010-11-04 08:41:06 UTC
Summary:

SELinux is preventing /usr/libexec/postfix/smtpd "connectto" access on
/var/spool/postfix/private/auth.

Detailed Description:

SELinux denied access requested by smtpd. It is not expected that this access is
required by smtpd and this access may signal an intrusion attempt. It is also
possible that the specific version or configuration of the application is
causing it to require additional access.

Allowing Access:

You can generate a local policy module to allow this access - see FAQ
(http://docs.fedoraproject.org/selinux-faq-fc5/#id2961385) Please file a bug
report.

Additional Information:

Source Context                system_u:system_r:postfix_smtpd_t:s0
Target Context                system_u:system_r:dovecot_t:s0
Target Objects                /var/spool/postfix/private/auth [
                              unix_stream_socket ]
Source                        smtpd
Source Path                   /usr/libexec/postfix/smtpd
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           postfix-2.7.1-1.fc14
Target RPM Packages           
Policy RPM                    selinux-policy-3.9.7-7.fc14
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Plugin Name                   catchall
Host Name                     (removed)
Platform                      Linux (removed) 2.6.35.6-48.fc14.x86_64 #1
                              SMP Fri Oct 22 15:36:08 UTC 2010 x86_64 x86_64
Alert Count                   1
First Seen                    Thu 04 Nov 2010 02:02:58 PM IST
Last Seen                     Thu 04 Nov 2010 02:02:58 PM IST
Local ID                      06495168-1a89-4c8f-afa2-ae58528a1d7d
Line Numbers                  

Raw Audit Messages            

node=(removed) type=AVC msg=audit(1288859578.861:41407): avc:  denied  { connectto } for  pid=3747 comm="smtpd" path="/var/spool/postfix/private/auth" scontext=system_u:system_r:postfix_smtpd_t:s0 tcontext=system_u:system_r:dovecot_t:s0 tclass=unix_stream_socket

node=(removed) type=SYSCALL msg=audit(1288859578.861:41407): arch=c000003e syscall=42 success=no exit=-13 a0=f a1=7fff78c401d0 a2=6e a3=1a items=0 ppid=2089 pid=3747 auid=4294967295 uid=89 gid=89 euid=89 suid=89 fsuid=89 egid=89 sgid=89 fsgid=89 tty=(none) ses=4294967295 comm="smtpd" exe="/usr/libexec/postfix/smtpd" subj=system_u:system_r:postfix_smtpd_t:s0 key=(null)



Hash String generated from  catchall,smtpd,postfix_smtpd_t,dovecot_t,unix_stream_socket,connectto
audit2allow suggests:

#============= postfix_smtpd_t ==============
allow postfix_smtpd_t dovecot_t:unix_stream_socket connectto;

Comment 1 Daniel Walsh 2010-11-04 17:35:54 UTC
Policy seems to have


optional_policy(`
	dovecot_stream_connect_auth(postfix_smtpd_t)
')

It looks like dovecot is listening on the /var/spool/postfix/private/auth.

Rather then /usr/libexec/dovecot/dove  Or it is mislabeled.

restorecon -R -v /usr/libexec

ps -eZ | grep auth

Comment 2 Fedora Admin XMLRPC Client 2010-11-08 21:53:01 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 3 Fedora Admin XMLRPC Client 2010-11-08 21:53:40 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 4 Fedora Admin XMLRPC Client 2010-11-08 21:56:29 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 5 John Griffiths 2010-11-14 04:23:13 UTC
Daniel, et all.

Dovecot can be configured, and it is fairly common to do so, to put an auth socket in /var/spool/postfix/private/ so that the same authentication can be used for postfix and dovecot.

I have this:

  # Postfix smtp-auth
  unix_listener /var/spool/postfix/private/auth {
    mode = 0666
    user = postfix
    group = postfix
 }

in /etc/dovecot/conf.d/10-master.conf .

Comment 6 Daniel Walsh 2010-11-15 16:29:37 UTC
My question is on what process is listening on this socket.

ps -eZ | grep dovecot

/usr/libexec/dovecot/auth

Should be running as dovecot_auth_t rather then dovecot_t

Comment 7 John Florian 2010-11-29 01:50:16 UTC
Daniel,

Hopefully this answers your question.  From my F14 rig:

# ls -lZ /var/run/dovecot/smtp-auth 
srw-rw-rw-. root postfix system_u:object_r:dovecot_var_run_t:s0 /var/run/dovecot/smtp-auth
# lsof /var/run/dovecot/smtp-auth
COMMAND  PID USER   FD   TYPE             DEVICE SIZE/OFF  NODE NAME
dovecot 1309 root   31u  unix 0xffff88002b506080      0t0 11323 /var/run/dovecot/smtp-auth
# ps -Zp 1309
LABEL                             PID TTY          TIME CMD
system_u:system_r:dovecot_t:s0   1309 ?        00:00:00 dovecot

I've named and located my socket differently, but the results are otherwise the same.  It looks like the main dovecot process services this socket, so it doesn't seem dovecot_auth_t can be used here.

Comment 8 Daniel Walsh 2010-11-29 21:00:34 UTC
Ok Miroslav, allow this access.

Comment 9 Miroslav Grepl 2010-12-01 10:48:55 UTC
Fixed in selinux-policy-3.9.7-14.fc14

Comment 10 Fedora Update System 2010-12-02 08:18:32 UTC
selinux-policy-3.9.7-14.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/selinux-policy-3.9.7-14.fc14

Comment 11 Fedora Update System 2010-12-02 19:14:10 UTC
selinux-policy-3.9.7-14.fc14 has been pushed to the Fedora 14 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update selinux-policy'.  You can provide feedback for this update here: https://admin.fedoraproject.org/updates/selinux-policy-3.9.7-14.fc14

Comment 12 John Griffiths 2010-12-04 10:47:13 UTC
selinux-policy-3.9.7-14.fc14 works for me.

Comment 13 Fedora Update System 2010-12-05 00:36:35 UTC
selinux-policy-3.9.7-14.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.