Bug 751558

Summary: cannot view mail when unconfined is removed
Product: Red Hat Enterprise Linux 6 Reporter: Josh <jokajak>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED ERRATA QA Contact: Milos Malik <mmalik>
Severity: low Docs Contact:
Priority: medium    
Version: 6.2CC: dwalsh, ksrot, mmalik, mtruneck
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-20 12:28:32 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 Josh 2011-11-05 13:23:32 UTC
Description of problem:
running the mail program as root results in a permission denied and a AVC being generated

Version-Release number of selected component (if applicable):
3.7.19-123.el6.noarch

How reproducible:
always

Steps to Reproduce:
1. semodule -r unconfined
2. mail
3.
  
Actual results:
able to view mail

Expected results:
permission denied

Additional info:

time->Sat Nov  5 09:22:31 2011
type=PATH msg=audit(1320499351.616:172488): item=1 name=(null) inode=14155777 dev=fd:00 mode=040550 ouid=0 ogid=0 rdev=00:00 obj=system_u:object_r:admin_home_t:s0
type=PATH msg=audit(1320499351.616:172488): item=0 name="/root/.mailrc"
type=CWD msg=audit(1320499351.616:172488):  cwd="/var/satellite/systemlogs"
type=SYSCALL msg=audit(1320499351.616:172488): arch=c000003e syscall=2 success=no exit=-13 a0=1a9cfc0 a1=0 a2=1b6 a3=fffffff8 items=2 ppid=10521 pid=12711 auid=1002 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts2 ses=854 comm="mail" exe="/bin/mailx" subj=staff_u:sysadm_r:user_mail_t:s0-s0:c0.c1023 key=(null)
type=AVC msg=audit(1320499351.616:172488): avc:  denied  { search } for  pid=12711 comm="mail" name="root" dev=dm-0 ino=14155777 scontext=staff_u:sysadm_r:user_mail_t:s0-s0:c0.c1023 tcontext=system_u:object_r:admin_home_t:s0 tclass=dir
----
time->Sat Nov  5 09:22:31 2011
type=PATH msg=audit(1320499351.616:172489): item=0 name="/var/mail/root"
type=CWD msg=audit(1320499351.616:172489):  cwd="/var/satellite/systemlogs"
type=SYSCALL msg=audit(1320499351.616:172489): arch=c000003e syscall=4 success=no exit=-13 a0=1a9cfe0 a1=7fff401fa3f0 a2=7fff401fa3f0 a3=7fff401fa140 items=1 ppid=10521 pid=12711 auid=1002 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts2 ses=854 comm="mail" exe="/bin/mailx" subj=staff_u:sysadm_r:user_mail_t:s0-s0:c0.c1023 key=(null)
type=AVC msg=audit(1320499351.616:172489): avc:  denied  { read } for  pid=12711 comm="mail" name="mail" dev=dm-0 ino=1836031 scontext=staff_u:sysadm_r:user_mail_t:s0-s0:c0.c1023 tcontext=system_u:object_r:mail_spool_t:s0 tclass=lnk_file

Comment 2 Miroslav Grepl 2011-11-07 09:42:06 UTC
Josh, thanks for using the policy without unconfined module. 

The note: You don't need to remove uncofined module, you can only disable this module using "semodule -d". 

So you could execute now

# semodule -i /usr/share/selinux/devel/targeted/unconfined.pp.bz2
# semodule -d unconfined.pp

Comment 3 Miroslav Grepl 2011-11-07 10:01:33 UTC
type=AVC msg=audit(1320499351.616:172489): avc:  denied  { read } for 
pid=12711 comm="mail" name="mail" dev=dm-0 ino=1836031
scontext=staff_u:sysadm_r:user_mail_t:s0-s0:c0.c1023
tcontext=system_u:object_r:mail_spool_t:s0 tclass=lnk_file

is allowed in Fedora. Will backport.

The question is /root/.mailrc. It looks like we could treat it with mail_home_t. Something like we have for .dead_letter

Comment 4 Josh 2011-11-07 12:02:41 UTC
(In reply to comment #2)
> Josh, thanks for using the policy without unconfined module. 
> 
> The note: You don't need to remove uncofined module, you can only disable this
> module using "semodule -d". 
> 
> So you could execute now
> 
> # semodule -i /usr/share/selinux/devel/targeted/unconfined.pp.bz2
> # semodule -d unconfined.pp

What are the trade-offs for disabling versus removing?

Thanks,
Josh

Comment 8 Michal Trunecka 2012-03-22 12:59:34 UTC
The bug should be fixed now, but we aren't able to reproduce the bug even with older selinux-policy. Josh, could you please install the current selinux-policy and confirm the bug is really fixed. (the newest version is 3.7.19-143 and can be downloaded from here: http://people.redhat.com/dwalsh/SELinux/RHEL6/noarch/ )

Comment 10 errata-xmlrpc 2012-06-20 12:28:32 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2012-0780.html