Bug 472883

Summary: SElinux is denying sendmail access to uux
Product: [Fedora] Fedora Reporter: Robert Vogelgesang <vogel>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 9CC: dwalsh, jkubin, mgrepl, ovasik
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-01-08 18:17: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 Robert Vogelgesang 2008-11-25 12:09:12 UTC
Description of problem:
SElinux is denying sendmail access to uux when sendmail is configured to use
an uucp mailer.

Version-Release number of selected component (if applicable):
sendmail-8.14.2-4.fc9
uucp-1.07-17.fc9
selinux-policy-3.3.1-107.fc9

How reproducible:
always

Steps to Reproduce:
1. configure sendmail to use an uucp mailer
2. send mail that should be transported via the uucp mailer
3. observe failure
  
Actual results:
Mail fails and gets bounced back to sender.

Expected results:
Mail should be transported via uucp to next-hop MTA.


Additional info:
The uucp mailer was added to sendmail.cf by adding "MAILER(uucp)" to sendmail.mc and using m4 with the "standard" sendmail-cf-8.14.2-4.fc9.i386 package.

Comment 1 Ondrej Vasik 2008-11-25 12:34:46 UTC
Reassigning to selinux-policy as I guess it should be fixed there.

Comment 2 Daniel Walsh 2008-11-25 14:52:27 UTC
What avc messages are you seeing?

Comment 3 Robert Vogelgesang 2008-11-25 15:18:16 UTC
/var/log/audit/audit.log shows:

type=AVC msg=audit(1227613116.899:1248): avc:  denied  { getattr } for  pid=6851 comm="sendmail" path="/usr/bin/uux" dev=sda3 ino=66987 scontext=system_u:system_r:sendmail_t:s0 tcontext=system_u:object_r:uux_exec_t:s0 tclass=file

type=AVC msg=audit(1227613116.919:1249): avc:  denied  { execute } for  pid=6851 comm="sendmail" name="uux" dev=sda3 ino=66987 scontext=system_u:system_r:sendmail_t:s0 tcontext=system_u:object_r:uux_exec_t:s0 tclass=file

There are similar entries in /var/log/messages, generated by setroubleshoot.
If these, or the "translations" by sealert, should be helpful, I'm happy to provide them as well.

Comment 4 Daniel Walsh 2008-11-25 15:55:46 UTC
Ok I can add

optional_policy(`
	uucp_domtrans_uux(sendmail_t)
')
to policy which will allow sendmail to start up the uux program.  It might cause other avc's.

Cab you create a file (myuux.te) with the following

#========================================================
policy_module(myuux, 1.0)
gen_require(`
    type sendmail_t;
')
uucp_domtrans_uux(sendmail_t)
#=========================================================

Then compile it and install it with the command

# make -f /usr/share/selinux/devel/Makefile
# semodule -i myuux.pp

Then try so send mail via uux again

Comment 5 Robert Vogelgesang 2008-11-25 17:28:15 UTC
The make command you gave missed a "myuux.pp" at its end...

With this new policy module the mail transfer succeeded, but there was another avc:

type=AVC msg=audit(1227630135.315:1353): avc:  denied  { read } for  pid=7222 comm="uux" path="/var/spool/mqueue/dfmAPGMFpq007219" dev=sda9 ino=204425 scontext=system_u:system_r:uux_t:s0 tcontext=system_u:object_r:mqueue_spool_t:s0 tclass=file

Receiving mails via uucp worked fine, without any avc's or other problems.

Comment 6 Miroslav Grepl 2008-12-15 10:08:39 UTC
Fixed in selinux-policy-3.3.1-116.fc9.noarch

Comment 7 Robert Vogelgesang 2009-01-08 18:17:21 UTC
Yes, I can confirm that selinux-policy-3.3.1-116.fc9.noarch fixes this issue.