Bug 979421

Summary: SELinux complains about execution of bash related to 7z and amavisd-new
Product: Red Hat Enterprise Linux 6 Reporter: Robert Scheck <redhat-bugzilla>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED ERRATA QA Contact: Michal Trunecka <mtruneck>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.4CC: dwalsh, ebenes, mmalik, mtruneck, robert.scheck, ssekidde
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: selinux-policy-3.7.19-210.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-11-21 10:31:59 UTC Type: Bug
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 Scheck 2013-06-28 13:37:29 UTC
Description of problem:
Jun 28 09:19:05 mail amavis[17479]: (13827-03) (!)run_command: child process [17479]: run_command: failed to exec /usr/bin/7za l -slt -w/var/spool/amavisd/tmp/amavis-20130628T090439-13827-vr9AqQAx/parts -- /var/spool/amavisd/tmp/amavis-20130628T090439-13827-vr9AqQAx/parts/p002: 13 at /usr/sbin/amavisd line 4062.
Jun 28 09:19:05 mail amavis[13827]: (13827-03) (!)Decoding of p002 (Zip archive data, at least v2.0 to extract) failed, leaving it unpacked: do_7zip: can't get a list of archive members: exit 6;  at (eval 117) line 781.

vs.

type=AVC msg=audit(1372104217.612:18445): avc:  denied  { execute } for  pid=20234 comm="amavisd" name="bash" dev=sda2 ino=14680108 scontext=system_u:system_r:amavis_t:s0 tcontext=system_u:object_r:shell_exec_t:s0 tclass=file
type=SYSCALL msg=audit(1372104217.612:18445): arch=x86_64 syscall=execve success=no exit=EACCES a0=5d1ef60 a1=4c94470 a2=735bfa0 a3=8 items=0 ppid=18807 pid=20234 auid=0 uid=497 gid=497 euid=497 suid=497 fsuid=497 egid=497 sgid=497 fsgid=497 tty=(none) ses=1305 comm=amavisd exe=/usr/bin/perl subj=system_u:system_r:amavis_t:s0 key=(null)

I actually do not get if the SELinux issue happens because 7zip does have an
issue with the archive file or if SELinux is forbidding 7zip activities and
thus it is failing?! Any ideas by the SELinux guys?

-rwxr-xr-x. root root system_u:object_r:bin_t:s0       /bin/gzip
-rwxr-xr-x. root root system_u:object_r:bin_t:s0       /usr/bin/7z
-rwxr-xr-x. root root system_u:object_r:bin_t:s0       /usr/bin/7za
-rwxr-xr-x. root root system_u:object_r:bin_t:s0       /usr/bin/unzip

To be honest, I do not get the difference to regular gzip or similar.

Version-Release number of selected component (if applicable):
amavisd-new-2.8.0-4.el6.noarch
selinux-policy-targeted-3.7.19-195.el6_4.10.noarch 

How reproducible:
Everytime, see above and below.

Actual results:
SELinux complains about execution of bash related to 7z and amavisd-new.

Expected results:
No SELinux complains about execution of bash related to 7z and amavisd-new.

Comment 1 Robert Scheck 2013-06-28 13:41:07 UTC
Cross-filed case 00897763 on the Red Hat customer portal.

Comment 3 Daniel Walsh 2013-06-28 18:56:15 UTC
This is blocking the executing of the shell (bash).

It should be allowed.

We have

corecmd_exec_bin(amavis_t)
corecmd_exec_shell(amavis_t

In Fedora.

Comment 4 Robert Scheck 2013-07-09 11:40:03 UTC
Does this mean, this will get included for next policy update in RHEL?

Comment 5 Miroslav Grepl 2013-07-10 08:49:58 UTC
Yes, it does.

Comment 8 errata-xmlrpc 2013-11-21 10:31:59 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-2013-1598.html