Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1471533 - SElinux is preventing esmtp from writing .esmtp_queue/<hash>/mail on ecryptfs
Summary: SElinux is preventing esmtp from writing .esmtp_queue/<hash>/mail on ecryptfs
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 29
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Lukas Vrabec
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-07-16 17:41 UTC by Paul DeStefano
Modified: 2018-09-12 02:58 UTC (History)
7 users (show)

Fixed In Version: selinux-policy-3.14.2-22.fc29 selinux-policy-3.14.2-34.fc29
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-09-12 02:58:15 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Paul DeStefano 2017-07-16 17:41:59 UTC
Description of problem:
Since Beta F26, local mail is no longer getting delivered.  Now that F26 is released, I need to report it.  A complicating factor for my problem is that I'm running ecryptfs for home directory.  SELinux suggestions for restorecon are ineffective.

SELinux is preventing esmtp from read access on the file /home/testuser2/.esmtp_queue/Y0q2tLoZ/mail.

*****  Plugin restorecon (99.5 confidence) suggests   ************************

If you want to fix the label. 
/home/testuser2/.esmtp_queue/Y0q2tLoZ/mail default label should be mail_home_rw_t.
Then you can run restorecon. The access attempt may have been stopped due to insufficient permissions to access a parent directory in which case try to change the following command accordingly.
Do
# /sbin/restorecon -v /home/testuser2/.esmtp_queue/Y0q2tLoZ/mail

*****  Plugin catchall (1.49 confidence) suggests   **************************

If you believe that esmtp should be allowed read access on the mail file by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# ausearch -c 'esmtp' --raw | audit2allow -M my-esmtp
# semodule -X 300 -i my-esmtp.pp

Additional Information:
Source Context                system_u:system_r:system_mail_t:s0-s0:c0.c1023
Target Context                system_u:object_r:ecryptfs_t:s0
Target Objects                /home/testuser2/.esmtp_queue/Y0q2tLoZ/mail [ file
                              ]
Source                        esmtp
Source Path                   esmtp
Port                          <Unknown>
Host                          
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-259.fc26.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     
Platform                      Linux  4.11.9-300.fc26.x86_64 #1 SMP Wed
                              Jul 5 16:21:56 UTC 2017 x86_64 x86_64
Alert Count                   1
First Seen                    2017-07-16 10:30:07 PDT
Last Seen                     2017-07-16 10:30:07 PDT
Local ID                      87532187-de38-4751-9f5c-51693538e17a

Raw Audit Messages
type=AVC msg=audit(1500226207.685:277): avc:  denied  { read } for  pid=2082 comm="esmtp" path="/home/testuser2/.esmtp_queue/Y0q2tLoZ/mail" dev="ecryptfs" ino=1591836 scontext=system_u:system_r:system_mail_t:s0-s0:c0.c1023 tcontext=system_u:object_r:ecryptfs_t:s0 tclass=file permissive=0


Hash: esmtp,system_mail_t,ecryptfs_t,file,read


Version-Release number of selected component (if applicable):


How reproducible:
Always since F26 beta


Steps to Reproduce:
1. Install F25
2. Set up ecryptfs for user home directory
3. Upgrade to F26


Actual results:
SElinux prevents local e-mail delivery for ecryptfs user

Expected results:
E-mail should be delivered

Additional info:

Comment 1 Fedora End Of Life 2018-05-03 07:51:00 UTC
This message is a reminder that Fedora 26 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 26. 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 '26'.

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 26 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 2 Paul DeStefano 2018-05-03 07:56:20 UTC
AFAIK, this is happening with F27, F28, and F29.  F29 is completely broken on my system right now, so I cannot double check but I saw these AVCs very recently on that system.

Comment 3 Paul DeStefano 2018-05-07 19:08:00 UTC
Yes, I still see this on Fedora29.

Raw Audit Messages
type=AVC msg=audit(1525719616.871:531): avc:  denied  { read } for  pid=4049 comm="esmtp" path="/home/<username>/.esmtp_queue/ZUvwTCyi/mail" dev="ecryptfs" ino=1574733 scontext=system_u:system_r:system_mail_t:s0-s0:c0.c1023 tcontext=system_u:object_r:ecryptfs_t:s0 tclass=file permissive=0

Comment 4 Paul DeStefano 2018-05-07 19:08:54 UTC
selinux-policy-3.14.2-16.fc29.noarch

Comment 5 Paul DeStefano 2018-06-23 20:00:53 UTC
Cool, thanks!  I don't see these AVCs any more.

Comment 6 Jan Kurik 2018-08-14 11:20:50 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 29 development cycle.
Changing version to '29'.

Comment 7 Fedora Update System 2018-09-11 12:51:53 UTC
selinux-policy-3.14.2-34.fc29 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2018-db240a1726

Comment 8 Fedora Update System 2018-09-12 02:58:15 UTC
selinux-policy-3.14.2-34.fc29 has been pushed to the Fedora 29 stable repository. If problems still persist, please make note of it in this bug report.


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