Red Hat Bugzilla – Bug 979421
SELinux complains about execution of bash related to 7z and amavisd-new
Last modified: 2014-09-30 19:35:04 EDT
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.
Cross-filed case 00897763 on the Red Hat customer portal.
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.
Does this mean, this will get included for next policy update in RHEL?
Yes, it does.
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