Bug 413601 - SELinux prevents Postfix from accessing the Postgrey policy service socket
Summary: SELinux prevents Postfix from accessing the Postgrey policy service socket
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy-targeted
Version: 7
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Daniel Walsh
QA Contact: Ben Levenson
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-12-06 08:22 UTC by Anthony Messina
Modified: 2007-12-06 15:43 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2007-12-06 15:43:11 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Anthony Messina 2007-12-06 08:22:30 UTC
Description of problem:
In permissive mode, SELinux denies the Postfix smtpd process from connecting 
(and probably writing) to the Postgrey socket. I am using the Fedora 7 Postfix 
and Postgrey RPMs.  Also, the Postgrey socket is probably labeled improperly 
as it gets the initrc_t type after a reboot.

Version-Release number of selected component (if applicable):
postfix-2.4.5-2.fc7
postgrey-1.27-4.fc7
selinux-policy-targeted-2.6.4-57.fc7

How reproducible:
Each time Postfix is configured to use the Postgrey policy service

Actual results:
avc: denied { connectto } for comm="smtpd" dev=sda2 egid=89 euid=89 
exe="/usr/libexec/postfix/smtpd" exit=0 fsgid=89 fsuid=89 gid=89 items=0 
name="socket" path="/var/spool/postfix/postgrey/socket" pid=5176 
scontext=system_u:system_r:postfix_smtpd_t:s0 sgid=89 
subj=system_u:system_r:postfix_smtpd_t:s0 suid=89 tclass=unix_stream_socket 
tcontext=system_u:system_r:initrc_t:s0 tty=(none) uid=8

avc: denied { write } for comm="smtpd" dev=sda2 egid=89 euid=89 
exe="/usr/libexec/postfix/smtpd" exit=0 fsgid=89 fsuid=89 gid=89 items=0 
name="socket" pid=24378 scontext=root:system_r:postfix_smtpd_t:s0 sgid=89 
subj=root:system_r:postfix_smtpd_t:s0 suid=89 tclass=sock_file 
tcontext=root:object_r:postfix_spool_t:s0 tty=(none) uid=89

Expected results:
SELinux will allow the Postfix process to use the Postgrey socket.

Comment 1 Daniel Walsh 2007-12-06 15:43:11 UTC
This is fixed in Fedora 8 I think it is best if you just add custom rules for
this using audit2allow.

grep postfix /var/log/audit/audit.log | audit2allow -M mypostfix
semodule -i mypostfix.pp


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