RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 985452 - SELinux AVC denials for deferred messages in Postfix after restoring default context
Summary: SELinux AVC denials for deferred messages in Postfix after restoring default ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: selinux-policy
Version: 6.4
Hardware: All
OS: Linux
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Miroslav Grepl
QA Contact: Michal Trunecka
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-07-17 14:05 UTC by Jakub Hradil
Modified: 2014-09-30 23:35 UTC (History)
4 users (show)

Fixed In Version: selinux-policy-3.7.19-210.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-11-21 10:45:50 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2013:1598 0 normal SHIPPED_LIVE selinux-policy bug fix and enhancement update 2013-11-20 21:39:24 UTC

Description Jakub Hradil 2013-07-17 14:05:55 UTC
Description of problem:
After running restorecon -R on /var/spool/postfix/deferred (type is changed from postfix_spool_t to postfix_spool_maildrop_t) messages in this queue cannot be sent anymore due to AVC denials.


Version-Release number of selected component (if applicable):
postfix: 2.6.6-2.2.el6_1
selinux-policy: 3.7.19-195.el6_4.12


Steps to Reproduce:
1. iptables -I OUTPUT -p tcp --dport 25 -j REJECT # or similar

2. Send e-mail via local postfix installation to remote destination

3. Check context of the message in deferred directory
ls -Z /var/spool/postfix/deferred/E/
-rwx------. postfix postfix system_u:object_r:postfix_spool_t:s0 EAAC273

4. Restore default context for /var/spool/postfix/deferred/
restorecon -R -v /var/spool/postfix/deferred/
restorecon reset /var/spool/postfix/deferred/E/EAAC273 context system_u:object_r:postfix_spool_t:s0->system_u:object_r:postfix_spool_maildrop_t:s0
ls -Z /var/spool/postfix/deferred/E/
-rwx------. postfix postfix system_u:object_r:postfix_spool_maildrop_t:s0 EAAC273

5. Remove previously set iptables rule

5. postqueue -f

6. See AVC denied in /var/log/audit/audit.log
seaudit-report /var/log/audit/audit.log
-snip-
Jul 17 14:41:31 (null) (null): audit(1374064891.485:80591): avc: denied { getattr } for pid=13348 comm=smtp path="/var/spool/postfix/active/EAAC273" ino=115 dev=dm-5 scontext=system_u:system_r:postfix_smtp_t:s0 tcontext=system_u:object_r:postfix_spool_maildrop_t:s0 tclass=file 
Jul 17 14:41:31 (null) (null): audit(1374064891.485:80592): avc: denied { read write } for pid=13348 comm=smtp name=EAAC273 ino=115 dev=dm-5 scontext=system_u:system_r:postfix_smtp_t:s0 tcontext=system_u:object_r:postfix_spool_maildrop_t:s0 tclass=file 


Actual results:
Messages are stuck in deferred queue, AVC denials are logged.

Expected results:
Messages sent with no AVC denials.

Additional info:
matchpathcon /var/spool/postfix/deferred/E/EAAC273
/var/spool/postfix/deferred/E/EAAC273	system_u:object_r:postfix_spool_maildrop_t:s0

This issue was discussed/mentioned at http://oss.tresys.com/pipermail/refpolicy/2012-November/006039.html and in bug 769819, comment 5.

I also noticed that system_u:object_r:postfix_spool_maildrop_t:s0 as the default context for /var/spool/postfix/deferred directory does not come from serefpolicy, but is added in policy-F13.patch. Don't know why it was added there.

Comment 2 Miroslav Grepl 2013-07-22 13:04:10 UTC
We allow it in Fedora.

#============= postfix_smtp_t ==============

#!!!! This avc is allowed in the current policy
allow postfix_smtp_t postfix_spool_maildrop_t:file { read write getattr };

Comment 5 errata-xmlrpc 2013-11-21 10:45:50 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


Note You need to log in before you can comment on or make changes to this bug.