Bug 1290876 - SELinux prevents DSPAM to read its own data files when acting as a LDA
SELinux prevents DSPAM to read its own data files when acting as a LDA
Status: CLOSED EOL
Product: Fedora
Classification: Fedora
Component: selinux-policy (Show other bugs)
23
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Lukas Vrabec
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-12-11 13:30 EST by Gustavo Maciel Dias Vieira
Modified: 2016-12-20 11:56 EST (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-12-20 11:56:01 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Gustavo Maciel Dias Vieira 2015-12-11 13:30:41 EST
Description of problem:
If I setup DSPAM to act as LDA, SELinux blocks its access to its own data files, marked as dspam_rw_content_t. A really strange bug.

Version-Release number of selected component (if applicable):
dspam-3.10.2-18.fc23.x86_64
selinux-policy-3.13.1-155.fc23.noarch


How reproducible:
Deterministic


Steps to Reproduce:

My setup is this: I use Postfix as MDA and configured it to deliver mail to DSPAM with:

   mailbox_command = /usr/bin/dspam --deliver=innocent,spam

DSPAM is configured to process the message, tag it and pass it to be delived by Procmail with:

   TrustedDeliveryAgent "/usr/bin/procmail"
   UntrustedDeliveryAgent "/usr/bin/procmail"

Procmail will, as usual, parse the ~/.procmailrc file and deliver the message to /var/spool/mail or any other user writeable directory indicated in procmailrc.

The whole setup works perfectly in permissive mode.
Comment 1 Gustavo Maciel Dias Vieira 2015-12-11 13:31:29 EST
Here are the AVCs:

type=AVC msg=audit(1449843945.665:1053): avc:  denied  { getattr } for  pid=2801 comm="dspam" path="/var/lib/dspam/data" dev="sdb1" ino=392499 scontext=system_u:system_r:dspam_t:s0 tcontext=system_u:object_r:dspam_rw_content_t:s0 tclass=dir permissive=1
type=AVC msg=audit(1449843945.666:1054): avc:  denied  { append } for  pid=2801 comm="dspam" name="rootmail.lock" dev="sdb1" ino=402981 scontext=system_u:system_r:dspam_t:s0 tcontext=system_u:object_r:dspam_rw_content_t:s0 tclass=file permissive=1
type=AVC msg=audit(1449843945.666:1055): avc:  denied  { open } for  pid=2801 comm="dspam" path="/var/lib/dspam/data/r/o/rootmail/rootmail.lock" dev="sdb1" ino=402981 scontext=system_u:system_r:dspam_t:s0 tcontext=system_u:object_r:dspam_rw_content_t:s0 tclass=file permissive=1
type=AVC msg=audit(1449843945.667:1056): avc:  denied  { lock } for  pid=2801 comm="dspam" path="/var/lib/dspam/data/r/o/rootmail/rootmail.lock" dev="sdb1" ino=402981 scontext=system_u:system_r:dspam_t:s0 tcontext=system_u:object_r:dspam_rw_content_t:s0 tclass=file permissive=1
type=AVC msg=audit(1449843945.667:1057): avc:  denied  { read write } for  pid=2801 comm="dspam" name="rootmail.css" dev="sdb1" ino=405885 scontext=system_u:system_r:dspam_t:s0 tcontext=system_u:object_r:dspam_rw_content_t:s0 tclass=file permissive=1
type=AVC msg=audit(1449843945.682:1058): avc:  denied  { write } for  pid=2801 comm="dspam" name="rootmail.sig" dev="sdb1" ino=402992 scontext=system_u:system_r:dspam_t:s0 tcontext=system_u:object_r:dspam_rw_content_t:s0 tclass=dir permissive=1
type=AVC msg=audit(1449843945.682:1059): avc:  denied  { add_name } for  pid=2801 comm="dspam" name="566adce928011989883163.sig" scontext=system_u:system_r:dspam_t:s0 tcontext=system_u:object_r:dspam_rw_content_t:s0 tclass=dir permissive=1
type=AVC msg=audit(1449843945.683:1060): avc:  denied  { create } for  pid=2801 comm="dspam" name="566adce928011989883163.sig" scontext=system_u:system_r:dspam_t:s0 tcontext=system_u:object_r:dspam_rw_content_t:s0 tclass=file permissive=1
type=AVC msg=audit(1449843945.684:1061): avc:  denied  { getattr } for  pid=2801 comm="dspam" path="/var/lib/dspam/data/r/o/rootmail/rootmail.sig/566adce928011989883163.sig" dev="sdb1" ino=399871 scontext=system_u:system_r:dspam_t:s0 tcontext=system_u:object_r:dspam_rw_content_t:s0 tclass=file permissive=1


type=AVC msg=audit(1449849109.739:1765): avc:  denied  { search } for  pid=26287 comm="dspam" name="dspam-data" dev="sdb1" ino=392499 scontext=system_u:system_r:dspam_t:s0 tcontext=system_u:object_r:dspam_rw_content_t:s0 tclass=dir permissive=0
type=AVC msg=audit(1449849109.740:1766): avc:  denied  { search } for  pid=26287 comm="dspam" name="dspam-data" dev="sdb1" ino=392499 scontext=system_u:system_r:dspam_t:s0 tcontext=system_u:object_r:dspam_rw_content_t:s0 tclass=dir permissive=0
type=AVC msg=audit(1449849109.741:1767): avc:  denied  { search } for  pid=26287 comm="dspam" name="dspam-data" dev="sdb1" ino=392499 scontext=system_u:system_r:dspam_t:s0 tcontext=system_u:object_r:dspam_rw_content_t:s0 tclass=dir permissive=0
type=AVC msg=audit(1449849109.743:1768): avc:  denied  { search } for  pid=26287 comm="dspam" name="dspam-data" dev="sdb1" ino=392499 scontext=system_u:system_r:dspam_t:s0 tcontext=system_u:object_r:dspam_rw_content_t:s0 tclass=dir permissive=0
Comment 2 Gustavo Maciel Dias Vieira 2015-12-11 13:33:31 EST
If I take the AVCs in permissive mode and run audit2allow, I get:

#============= dspam_t ==============
allow dspam_t dspam_rw_content_t:dir { write getattr add_name search };
allow dspam_t dspam_rw_content_t:file { create read lock write getattr open append };


I made this into a module and installed it and DSPAM works in enforcing mode.

This bug is really strange, why isn't DSPAM able to RW dspam_rw_content_t?
Comment 3 Fedora Admin XMLRPC Client 2016-09-27 10:57:58 EDT
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 4 Fedora End Of Life 2016-11-24 09:10:22 EST
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '23'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 23 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.
Comment 5 Fedora End Of Life 2016-12-20 11:56:01 EST
Fedora 23 changed to end-of-life (EOL) status on 2016-12-20. Fedora 23 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

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