Bug 616344

Summary: denials when dovecot is invoked by postfix
Product: Red Hat Enterprise Linux 6 Reporter: Ales Zelinka <azelinka>
Component: selinux-policyAssignee: Daniel Walsh <dwalsh>
Status: CLOSED DUPLICATE QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: medium Docs Contact:
Priority: low    
Version: 6.0CC: mgrepl, syeghiay
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-07-21 15:16:03 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 Ales Zelinka 2010-07-20 08:27:30 UTC
Description of problem:
I have dovecot configured as LDA in postfix:
mailbox_command = /usr/libexec/dovecot/deliver

Dovecot then runs in postfix's context, confusing selinux:

type=AVC msg=audit(1279613115.572:43903): avc:  denied  { search } for  pid=31012 comm="deliver" name="dovecot" dev=dm-0 ino=2223944 scontext=unconfined_u:system_r:postfix_local_t:s0 tcontext=system_u:object_r:dovecot_var_run_t:s0 tclass=dir
type=SYSCALL msg=audit(1279613115.572:43903): arch=c000003e syscall=42 success=no exit=-13 a0=6 a1=7fff66a2cf20 a2=6e a3=118 items=0 ppid=31004 pid=31012 auid=0 uid=504 gid=504 euid=504 suid=504 fsuid=504 egid=504 sgid=504 fsgid=504 tty=(none) ses=676 comm="deliver" exe="/usr/libexec/dovecot/dovecot-lda" subj=unconfined_u:system_r:postfix_local_t:s0 key=(null)
type=AVC msg=audit(1279613115.576:43904): avc:  denied  { search } for  pid=31012 comm="doveconf" name="dovecot" dev=dm-0 ino=393984 scontext=unconfined_u:system_r:postfix_local_t:s0 tcontext=system_u:object_r:dovecot_cert_t:s0 tclass=dir
type=SYSCALL msg=audit(1279613115.576:43904): arch=c000003e syscall=2 success=yes exit=128 a0=1815b86 a1=0 a2=1815b86 a3=0 items=0 ppid=31004 pid=31012 auid=0 uid=504 gid=504 euid=504 suid=504 fsuid=504 egid=504 sgid=504 fsgid=504 tty=(none) ses=676 comm="doveconf" exe="/usr/bin/doveconf" subj=unconfined_u:system_r:postfix_local_t:s0 key=(null)


The mail delivery still works though.
Version-Release number of selected component (if applicable):
selinux-policy-targeted-3.7.19-29.el6.noarch
dovecot-2.0-0.8.beta6.20100630.el6.x86_64
postfix-2.6.6-2.el6.x86_64

How reproducible:
always

Steps to Reproduce:
1. configure dovecot as LDA in postfix
2. send mail to local user
3. flush queues to force mail delivery

Comment 1 Daniel Walsh 2010-07-20 13:39:00 UTC
Miroslav could you add


optional_policy(`
	dovecot_domtrans_deliver(postfix_local_t)
')

Ales can you try the following commands and see if you get any other AVC messages

# cat > mydovecot.te << _EOF
policy_module(mydovecot,1.0)
gen_require(`
type postfix_local_t;
')
dovecot_domtrans_deliver(postfix_local_t)
_EOF
# make -f /usr/share/selinux/devel/Makefile
# semodule -i mydovecot.pp

Comment 2 Miroslav Grepl 2010-07-21 06:55:03 UTC
This issue should be fixed in the latest RHEL6 selinux-policy.

selinux-policy-3.7.19-31.el6.noarch 


The problem is /usr/libexec/dovecot/dovecot-lda has bad label with selinux-policy-targeted-3.7.19-29.el6.

Ales, 
please update your selinux-policy and re-test it. Thanks.

Comment 3 Miroslav Grepl 2010-07-21 15:16:03 UTC
I am closing it as duplicate of #612406 bug.

*** This bug has been marked as a duplicate of bug 612406 ***