Bug 960075 - SELinux is preventing /usr/libexec/postfix/smtpd from read, write access on the file /var/spool/postfix/pid/inet.10025.
Summary: SELinux is preventing /usr/libexec/postfix/smtpd from read, write access on t...
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 19
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:41d0a577626b2c31ad356315f11...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-05-06 14:31 UTC by Paul W. Frields
Modified: 2015-02-18 11:20 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2015-02-18 11:20:48 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Paul W. Frields 2013-05-06 14:31:26 UTC
Description of problem:
I have a postfix configuration that uses an additional port/service on localhost to hold/softbounce email when it can't connect to the upstream SMTP server. With the latest policy this stopped working. It looks like /var/spool/postfix/pid/inet.10025 (add'l service pid) isn't accessible now, and generates an SELinux error. Running 'setenforce 0' allows postfix to run correctly again. I can provide detailed config files if needed.
SELinux is preventing /usr/libexec/postfix/smtpd from read, write access on the file /var/spool/postfix/pid/inet.10025.

*****  Plugin catchall (100. confidence) suggests  ***************************

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

Additional Information:
Source Context                system_u:system_r:postfix_smtpd_t:s0
Target Context                system_u:object_r:postfix_var_run_t:s0
Target Objects                /var/spool/postfix/pid/inet.10025 [ file ]
Source                        smtpd
Source Path                   /usr/libexec/postfix/smtpd
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           postfix-2.10.0-1.fc19.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.12.1-40.fc19.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 3.9.0-301.fc19.x86_64 #1 SMP Mon
                              Apr 29 13:44:05 UTC 2013 x86_64 x86_64
Alert Count                   10
First Seen                    2013-05-06 10:14:23 EDT
Last Seen                     2013-05-06 10:26:42 EDT
Local ID                      4ce7e541-8f76-41e2-9122-3563f4f0af14

Raw Audit Messages
type=AVC msg=audit(1367850402.412:513): avc:  denied  { read write } for  pid=3895 comm="smtpd" name="inet.10025" dev="dm-4" ino=393481 scontext=system_u:system_r:postfix_smtpd_t:s0 tcontext=system_u:object_r:postfix_var_run_t:s0 tclass=file


type=SYSCALL msg=audit(1367850402.412:513): arch=x86_64 syscall=open success=no exit=EACCES a0=7f92c7d54740 a1=2 a2=0 a3=ffffff80 items=0 ppid=1570 pid=3895 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 ses=4294967295 tty=(none) comm=smtpd exe=/usr/libexec/postfix/smtpd subj=system_u:system_r:postfix_smtpd_t:s0 key=(null)

Hash: smtpd,postfix_smtpd_t,postfix_var_run_t,file,read,write

audit2allow

#============= postfix_smtpd_t ==============
allow postfix_smtpd_t postfix_var_run_t:file { read write };

audit2allow -R
require {
	type postfix_smtpd_t;
	type postfix_var_run_t;
	class file { read write };
}

#============= postfix_smtpd_t ==============
allow postfix_smtpd_t postfix_var_run_t:file { read write };


Additional info:
hashmarkername: setroubleshoot
kernel:         3.9.0-301.fc19.x86_64
type:           libreport

Comment 1 Paul W. Frields 2013-05-06 15:02:37 UTC
There may be some other file contexts associated with this problem. I also see SELinux errors for postfix's cleanup and smtp.

Comment 2 Miroslav Grepl 2013-05-07 13:06:29 UTC
commit c6b618c7b2dfc4099d0a217886312f05095c8d15
Author: Dan Walsh <dwalsh>
Date:   Mon May 6 15:57:47 2013 -0400

    Allow postfix domains to manage postfix_var_run_t

Comment 3 Paul W. Frields 2013-05-14 12:55:50 UTC
Under selinux-policy-targeted-3.12.1-42.fc19, still not working.  However, if I use audit2allow to generate this .te and then install it as a module, things work as expected:


module mypol-20130514 1.0;

require {
	type postfix_local_t;
	type postfix_bounce_t;
	type postfix_smtpd_t;
	type postfix_smtp_t;
	type postfix_cleanup_t;
	type postfix_var_run_t;
	class file { read lock write getattr open };
}

#============= postfix_bounce_t ==============
allow postfix_bounce_t postfix_var_run_t:file { read write getattr open lock };

#============= postfix_cleanup_t ==============

#!!!! This avc is allowed in the current policy
allow postfix_cleanup_t postfix_var_run_t:file { read lock getattr write open };

#============= postfix_local_t ==============
allow postfix_local_t postfix_var_run_t:file { read write getattr open lock };

#============= postfix_smtp_t ==============

#!!!! This avc is allowed in the current policy
allow postfix_smtp_t postfix_var_run_t:file { read lock getattr write open };

#============= postfix_smtpd_t ==============
allow postfix_smtpd_t postfix_var_run_t:file { read write getattr open lock };

Comment 4 Miroslav Grepl 2013-05-14 13:18:24 UTC
You need to use the latest builds which have

allow postfix_domain postfix_var_run_t : file { ioctl read write create getattr setattr lock append unlink link rename open }

Comment 5 Paul W. Frields 2013-05-14 14:17:57 UTC
Removed my custom module, and then tested in Enforcing mode with latest selinux-policy-targeted-3.12.1-44.fc19 -- working fine now.  Thank you for the fast response Miroslav!

Comment 6 Fedora End Of Life 2015-01-09 22:41:47 UTC
This message is a notice that Fedora 19 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 19. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained. Approximately 4 (four) weeks from now this bug will
be closed as EOL if it remains open with a Fedora 'version' of '19'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 19 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 7 Fedora End Of Life 2015-02-18 11:20:48 UTC
Fedora 19 changed to end-of-life (EOL) status on 2015-01-06. Fedora 19 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


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