Bug 372371 - SELinux is preventing smtpd (postfix_smtpd_t) "write" to (postfix_spool_t).
SELinux is preventing smtpd (postfix_smtpd_t) "write" to (postfix_spool_t).
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: selinux-policy (Show other bugs)
8
All Linux
low Severity low
: ---
: ---
Assigned To: Daniel Walsh
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-11-09 04:38 EST by Nils Philippsen
Modified: 2008-01-30 14:18 EST (History)
2 users (show)

See Also:
Fixed In Version: Current
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-01-30 14:18:28 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Nils Philippsen 2007-11-09 04:38:34 EST
Description of problem:
SELinux is preventing smtpd (postfix_smtpd_t) "write" to (postfix_spool_t).

I think this is because I use postgrey to do greylisting on incoming mail and
the postgrey socket is labeled inappropriately.

Version-Release number of selected component (if applicable):
selinux-policy-targeted-3.0.8-44.fc8
postfix-2.4.5-2.fc8
postgrey-1.30-1.fc8

How reproducible:
Reproducible

Steps to Reproduce:
1. Have a system with postfix, postgrey that accepts spam^Wmail on a public
interface
2. Wait
  
Actual results:

--- 8< ---
Summary
    SELinux is preventing smtpd (postfix_smtpd_t) "write" to <Unknown>
    (postfix_spool_t).

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
    Sometimes labeling problems can cause SELinux denials.  You could try to
    restore the default system file context for <Unknown>, restorecon -v
    <Unknown> If this does not work, there is currently no automatic way to
    allow this access. Instead,  you can generate a local policy module to allow
    this access - see http://fedora.redhat.com/docs/selinux-faq-fc5/#id2961385
    Or you can disable SELinux protection altogether. Disabling SELinux
    protection is not recommended. Please file a
    http://bugzilla.redhat.com/bugzilla/enter_bug.cgi against this package.

Additional Information        

Source Context                system_u:system_r:postfix_smtpd_t:s0
Target Context                system_u:object_r:postfix_spool_t:s0
Target Objects                None [ sock_file ]
Affected RPM Packages         
Policy RPM                    selinux-policy-3.0.8-44.fc8
Selinux Enabled               True
Policy Type                   targeted
MLS Enabled                   True
Enforcing Mode                Enforcing
Plugin Name                   plugins.catchall_file
Host Name                     wombat
Platform                      Linux wombat 2.6.23.1-45.fc8 #1 SMP Mon Nov 5
                              20:24:02 EST 2007 x86_64 x86_64
Alert Count                   4
First Seen                    Fri 09 Nov 2007 09:29:43 AM CET
Last Seen                     Fri 09 Nov 2007 09:29:45 AM CET
Local ID                      2fb8a644-8ca9-4031-8c10-5c4618c894f2
Line Numbers                  

Raw Audit Messages            

avc: denied { write } for comm=smtpd dev=dm-3 name=socket pid=8481
scontext=system_u:system_r:postfix_smtpd_t:s0 tclass=sock_file
tcontext=system_u:object_r:postfix_spool_t:s0
--- >8 ---

nils@wombat:~> sudo ls -Z /var/spool/postfix/postgrey/socket
/var/spool/postfix/public/flush /var/spool/postfix/private/uucp
srw-rw-rw-  postgrey postgrey system_u:object_r:postfix_spool_t:s0
/var/spool/postfix/postgrey/socket
srw-rw-rw-  postfix  postfix  system_u:object_r:postfix_private_t:s0
/var/spool/postfix/private/uucp
srw-rw-rw-  postfix  postfix  system_u:object_r:postfix_public_t:s0
/var/spool/postfix/public/flush
nils@wombat:~> 

Expected results:

Either the policy should be changed to label the socket properly or the socket
should be moved in one of the public or private dirtectories.

Additional info:

I have copied Thomas Wörner and Matthias Saou, the pkg maintainers of postfix
and postgrey for discussion.
Comment 1 Daniel Walsh 2007-11-10 08:01:10 EST
Adding postgrey policy should fix this.  Currently not in policy package.

Fixed in selinux-policy-3.0.8-51.fc8
Comment 2 Daniel Walsh 2008-01-30 14:18:28 EST
Bulk closing all bugs in Fedora updates in the modified state.  If you bug is
not fixed, please reopen.

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