Bug 481387

Summary: selinux prevents "getattr" and "execute"
Product: Red Hat Enterprise Linux 5 Reporter: Philip Goisman <goisman>
Component: selinux-policyAssignee: Daniel Walsh <dwalsh>
Status: CLOSED ERRATA QA Contact: BaseOS QE <qe-baseos-auto>
Severity: urgent Docs Contact:
Priority: low    
Version: 5.4CC: mmalik, ohudlick
Target Milestone: rc   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-09-02 07:59:21 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 Philip Goisman 2009-01-23 22:37:11 UTC
Description of problem:
SELinux is preventing sh (procmail_t) "getattr" to /usr/bin/spamassassin
(spamassassin_exec_t).

SELinux is preventing sh (procmail_t) "execute" to ./spamassassin
(spamassassin_exec_t).

Version-Release number of selected component (if applicable):
selinux-policy-strict-2.4.6-203.el5
selinux-policy-mls-2.4.6-203.el5
selinux-policy-devel-2.4.6-203.el5
selinux-policy-targeted-2.4.6-203.el5
selinux-policy-2.4.6-203.el5

How reproducible:
This started on the recent selinux upgrade which is now preventing
procmail scripts from checking incoming e-mail against spamassassin.

Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:
I wrote the following policy to try to fix this problem:

module procmailauth 1.0;

require {
	type procmail_t;
	type var_log_t;
	type spamassassin_exec_t;
	type spamd_var_lib_t;
	class dir search;
	class dir execute;
	class file read;
	class file ioctl;
	class file execute;
	class file write;
	class file getattr;
	class file append;
}

#============= dovecot_auth_t ==============
allow procmail_t spamassassin_exec_t:file { read ioctl write getattr append };
allow procmail_t spamassassin_exec_t:dir execute;
allow procmail_t spamd_var_lib_t:dir search;

The above didn't fix the problem.  In fact additional sealerts like "ioctl"
started occurring.

So how may this problem be fixed?

Comment 1 Philip Goisman 2009-01-24 15:02:08 UTC
I modified my policy as follows:

module procmailauth 1.0;

require {
	type procmail_t;
	type var_log_t;
	type spamassassin_exec_t;
	type spamd_var_lib_t;
	class dir search;
	class dir execute;
	class dir getattr;
	class dir read;
	class dir ioctl;
	class file read;
	class file ioctl;
	class file execute;
	class file execute_no_trans;
	class file write;
	class file getattr;
	class file append;
}

#============= dovecot_auth_t ==============
allow procmail_t spamassassin_exec_t:file { read ioctl write getattr execute execute_no_tran
s append };
allow procmail_t spamassassin_exec_t:dir { getattr execute };
allow procmail_t spamd_var_lib_t:file { getattr read ioctl};
allow procmail_t spamd_var_lib_t:dir { getattr read search ioctl };
 

This appears to be holding - procmail logs don't complain, procmail results are
achieved, and no sealerts in messages.

I'll let you know if this breaks.

Thanks

Comment 2 Daniel Walsh 2009-02-07 11:59:07 UTC
Fixed in selinux-policy-2.4.6-207.el5

Preview of U4 policy currently available at

http://people.redhat.com/dwalsh/SELinux/RHEL5

Comment 8 Daniel Walsh 2009-04-16 15:06:23 UTC
Fixed in selinux-policy-2.4.6-225.el5

Comment 11 errata-xmlrpc 2009-09-02 07:59:21 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2009-1242.html