Bug 965398 - mail delivery causes avc denial
mail delivery causes avc denial
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: selinux-policy (Show other bugs)
7.0
All Linux
medium Severity high
: beta
: ---
Assigned To: Miroslav Grepl
Milos Malik
: Reopened
: 916624 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-05-21 03:36 EDT by Petr Sklenar
Modified: 2014-06-17 22:21 EDT (History)
4 users (show)

See Also:
Fixed In Version: selinux-policy-3.12.1-86.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-06-13 06:01:55 EDT
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 Petr Sklenar 2013-05-21 03:36:14 EDT
Description of problem:
mail delivery causes avc denial

Version-Release number of selected component (if applicable):
dovecot-2.2.1-3.el7.x86_64
mailx-12.5-8.el7.x86_64
selinux-policy-3.12.1-40.el7.noarch


How reproducible:
always

Steps to Reproduce:
1. alternatives --set mta /usr/sbin/sendmail.postfix
2. /bin/systemctl restart  dovecot.service
3. echo -e 'body-436287\n' |mail -s subj-436287 mailtest@localhost

Actual results:
various avc denials:

----
time->Sat May 18 05:55:01 2013
type=SYSCALL msg=audit(1368852901.798:1166): arch=c000003e syscall=4 success=no exit=-13 a0=7fb07847db07 a1=7fff22f199d0 a2=7fff22f199d0 a3=0 items=0 ppid=18307 pid=18311 auid=4294967295 uid=1003 gid=1006 euid=1003 suid=1003 fsuid=1003 egid=1006 sgid=1006 fsgid=1006 ses=4294967295 tty=(none) comm="deliver" exe="/usr/libexec/dovecot/dovecot-lda" subj=system_u:system_r:dovecot_deliver_t:s0 key=(null)
type=AVC msg=audit(1368852901.798:1166): avc:  denied  { getattr } for  pid=18311 comm="deliver" path="/dev/mqueue" dev="mqueue" ino=6484 scontext=system_u:system_r:dovecot_deliver_t:s0 tcontext=system_u:object_r:tmpfs_t:s0 tclass=dir
----

----
time->Sat May 18 06:36:37 2013
type=AVC msg=audit(1368873397.486:559): avc:  denied  { sys_resource } for  pid=41712 comm="dovecot" capability=24  scontext=system_u:system_r:dovecot_t:s0 tcontext=system_u:system_r:dovecot_t:s0 tclass=capability
Fail: AVC messages found.
--------
----
time->Sat May 18 02:23:04 2013
type=AVC msg=audit(1368858184.111:550): avc:  denied  { getattr } for  pid=3950 comm="deliver" path="/dev/mqueue" dev="mqueue" ino=7025 scontext=system_u:system_r:dovecot_deliver_t:s0 tcontext=system_u:object_r:tmpfs_t:s0 tclass=dir
----
----
time->Sat May 18 06:31:55 2013
type=SYSCALL msg=audit(1368873115.080:945): arch=c000003e syscall=4 success=no exit=-13 a0=7ffa76720b07 a1=7fff987fd270 a2=7fff987fd270 a3=0 items=0 ppid=8705 pid=8706 auid=4294967295 uid=1001 gid=1001 euid=1001 suid=1001 fsuid=1001 egid=1001 sgid=1001 fsgid=1001 ses=4294967295 tty=(none) comm="deliver" exe="/usr/libexec/dovecot/dovecot-lda" subj=system_u:system_r:dovecot_deliver_t:s0 key=(null)
type=AVC msg=audit(1368873115.080:945): avc:  denied  { getattr } for  pid=8706 comm="deliver" path="/dev/pts" dev="devpts" ino=1 scontext=system_u:system_r:dovecot_deliver_t:s0 tcontext=system_u:object_r:devpts_t:s0 tclass=dir
----
time->Sat May 18 06:31:55 2013
type=SYSCALL msg=audit(1368873115.080:946): arch=c000003e syscall=4 success=no exit=-13 a0=7ffa76720b07 a1=7fff987fd270 a2=7fff987fd270 a3=0 items=0 ppid=8705 pid=8706 auid=4294967295 uid=1001 gid=1001 euid=1001 suid=1001 fsuid=1001 egid=1001 sgid=1001 fsgid=1001 ses=4294967295 tty=(none) comm="deliver" exe="/usr/libexec/dovecot/dovecot-lda" subj=system_u:system_r:dovecot_deliver_t:s0 key=(null)
type=AVC msg=audit(1368873115.080:946): avc:  denied  { getattr } for  pid=8706 comm="deliver" path="/sys/fs/pstore" dev="pstore" ino=6565 scontext=system_u:system_r:dovecot_deliver_t:s0 tcontext=system_u:object_r:pstorefs_t:s0 tclass=dir
----


Expected results:
no avd denial

Additional info:
Comment 3 Petr Sklenar 2013-05-21 03:40:56 EDT
I am sorry its dupe of: bug 916624
anyway how is possible that there are denial only on rhel7? not on F19?

*** This bug has been marked as a duplicate of bug 916624 ***
Comment 4 Miroslav Grepl 2013-05-22 03:25:17 EDT
Well I see we don't have fixes on F19 too.

# cat /tmp/log |audit2allow


#============= dovecot_deliver_t ==============
allow dovecot_deliver_t devpts_t:dir getattr;
allow dovecot_deliver_t pstorefs_t:dir getattr;
allow dovecot_deliver_t tmpfs_t:dir getattr;


it means we don't have rules. Does mail delivery work correctly?


I would add 

commit f3e68656cd84b9fc76a248a538d1d666618c5a74
Author: Miroslav Grepl <mgrepl@redhat.com>
Date:   Wed May 22 09:23:20 2013 +0200

    Dontaudit to getattr on dirs for dovecot-deliver
Comment 5 Milos Malik 2013-05-22 04:14:24 EDT
There are more AVCs in the log files. It seems like dovecot is checking various mount points.
----
time->Sat May 18 06:31:55 2013
type=SYSCALL msg=audit(1368873115.079:944): arch=c000003e syscall=4 success=no exit=-13 a0=7ffa76720b06 a1=7fff987fd270 a2=7fff987fd270 a3=0 items=0 ppid=8705 pid=8706 auid=4294967295 uid=1001 gid=1001 euid=1001 suid=1001 fsuid=1001 egid=1001 sgid=1001 fsgid=1001 ses=4294967295 tty=(none) comm="deliver" exe="/usr/libexec/dovecot/dovecot-lda" subj=system_u:system_r:dovecot_deliver_t:s0 key=(null)
type=AVC msg=audit(1368873115.079:944): avc:  denied  { getattr } for  pid=8706 comm="deliver" path="/dev/shm" dev="tmpfs" ino=6553 scontext=system_u:system_r:dovecot_deliver_t:s0 tcontext=system_u:object_r:tmpfs_t:s0 tclass=dir
----
time->Sat May 18 06:31:55 2013
type=SYSCALL msg=audit(1368873115.080:945): arch=c000003e syscall=4 success=no exit=-13 a0=7ffa76720b07 a1=7fff987fd270 a2=7fff987fd270 a3=0 items=0 ppid=8705 pid=8706 auid=4294967295 uid=1001 gid=1001 euid=1001 suid=1001 fsuid=1001 egid=1001 sgid=1001 fsgid=1001 ses=4294967295 tty=(none) comm="deliver" exe="/usr/libexec/dovecot/dovecot-lda" subj=system_u:system_r:dovecot_deliver_t:s0 key=(null)
type=AVC msg=audit(1368873115.080:945): avc:  denied  { getattr } for  pid=8706 comm="deliver" path="/dev/pts" dev="devpts" ino=1 scontext=system_u:system_r:dovecot_deliver_t:s0 tcontext=system_u:object_r:devpts_t:s0 tclass=dir
----
time->Sat May 18 06:31:55 2013
type=SYSCALL msg=audit(1368873115.080:946): arch=c000003e syscall=4 success=no exit=-13 a0=7ffa76720b07 a1=7fff987fd270 a2=7fff987fd270 a3=0 items=0 ppid=8705 pid=8706 auid=4294967295 uid=1001 gid=1001 euid=1001 suid=1001 fsuid=1001 egid=1001 sgid=1001 fsgid=1001 ses=4294967295 tty=(none) comm="deliver" exe="/usr/libexec/dovecot/dovecot-lda" subj=system_u:system_r:dovecot_deliver_t:s0 key=(null)
type=AVC msg=audit(1368873115.080:946): avc:  denied  { getattr } for  pid=8706 comm="deliver" path="/sys/fs/pstore" dev="pstore" ino=6565 scontext=system_u:system_r:dovecot_deliver_t:s0 tcontext=system_u:object_r:pstorefs_t:s0 tclass=dir
----
time->Sat May 18 06:31:55 2013
type=SYSCALL msg=audit(1368873115.080:947): arch=c000003e syscall=4 success=no exit=-13 a0=7ffa76720b0a a1=7fff987fd270 a2=7fff987fd270 a3=0 items=0 ppid=8705 pid=8706 auid=4294967295 uid=1001 gid=1001 euid=1001 suid=1001 fsuid=1001 egid=1001 sgid=1001 fsgid=1001 ses=4294967295 tty=(none) comm="deliver" exe="/usr/libexec/dovecot/dovecot-lda" subj=system_u:system_r:dovecot_deliver_t:s0 key=(null)
type=AVC msg=audit(1368873115.080:947): avc:  denied  { getattr } for  pid=8706 comm="deliver" path="/proc/sys/fs/binfmt_misc" dev="binfmt_misc" ino=1 scontext=system_u:system_r:dovecot_deliver_t:s0 tcontext=system_u:object_r:binfmt_misc_fs_t:s0 tclass=dir
----
time->Sat May 18 06:31:55 2013
type=SYSCALL msg=audit(1368873115.081:948): arch=c000003e syscall=4 success=no exit=-13 a0=7ffa76720b07 a1=7fff987fd270 a2=7fff987fd270 a3=0 items=0 ppid=8705 pid=8706 auid=4294967295 uid=1001 gid=1001 euid=1001 suid=1001 fsuid=1001 egid=1001 sgid=1001 fsgid=1001 ses=4294967295 tty=(none) comm="deliver" exe="/usr/libexec/dovecot/dovecot-lda" subj=system_u:system_r:dovecot_deliver_t:s0 key=(null)
type=AVC msg=audit(1368873115.081:948): avc:  denied  { getattr } for  pid=8706 comm="deliver" path="/dev/mqueue" dev="mqueue" ino=6487 scontext=system_u:system_r:dovecot_deliver_t:s0 tcontext=system_u:object_r:tmpfs_t:s0 tclass=dir
----
time->Sat May 18 06:31:55 2013
type=SYSCALL msg=audit(1368873115.081:949): arch=c000003e syscall=4 success=no exit=-13 a0=7ffa76720b0a a1=7fff987fd270 a2=7fff987fd270 a3=0 items=0 ppid=8705 pid=8706 auid=4294967295 uid=1001 gid=1001 euid=1001 suid=1001 fsuid=1001 egid=1001 sgid=1001 fsgid=1001 ses=4294967295 tty=(none) comm="deliver" exe="/usr/libexec/dovecot/dovecot-lda" subj=system_u:system_r:dovecot_deliver_t:s0 key=(null)
type=AVC msg=audit(1368873115.081:949): avc:  denied  { getattr } for  pid=8706 comm="deliver" path="/dev/hugepages" dev="hugetlbfs" ino=10929 scontext=system_u:system_r:dovecot_deliver_t:s0 tcontext=system_u:object_r:hugetlbfs_t:s0 tclass=dir
----
time->Sat May 18 06:31:55 2013
type=SYSCALL msg=audit(1368873115.081:950): arch=c000003e syscall=4 success=no exit=-13 a0=7ffa76720b09 a1=7fff987fd270 a2=7fff987fd270 a3=0 items=0 ppid=8705 pid=8706 auid=4294967295 uid=1001 gid=1001 euid=1001 suid=1001 fsuid=1001 egid=1001 sgid=1001 fsgid=1001 ses=4294967295 tty=(none) comm="deliver" exe="/usr/libexec/dovecot/dovecot-lda" subj=system_u:system_r:dovecot_deliver_t:s0 key=(null)
type=AVC msg=audit(1368873115.081:950): avc:  denied  { getattr } for  pid=8706 comm="deliver" path="/sys/kernel/config" dev="configfs" ino=10930 scontext=system_u:system_r:dovecot_deliver_t:s0 tcontext=system_u:object_r:configfs_t:s0 tclass=dir
----
time->Sat May 18 06:31:55 2013
type=SYSCALL msg=audit(1368873115.082:951): arch=c000003e syscall=4 success=no exit=-13 a0=7ffa76720b0c a1=7fff987fd270 a2=7fff987fd270 a3=0 items=0 ppid=8705 pid=8706 auid=4294967295 uid=1001 gid=1001 euid=1001 suid=1001 fsuid=1001 egid=1001 sgid=1001 fsgid=1001 ses=4294967295 tty=(none) comm="deliver" exe="/usr/libexec/dovecot/dovecot-lda" subj=system_u:system_r:dovecot_deliver_t:s0 key=(null)
type=AVC msg=audit(1368873115.082:951): avc:  denied  { getattr } for  pid=8706 comm="deliver" path="/proc/sys/fs/binfmt_misc" dev="binfmt_misc" ino=1 scontext=system_u:system_r:dovecot_deliver_t:s0 tcontext=system_u:object_r:binfmt_misc_fs_t:s0 tclass=dir
----
Comment 6 Miroslav Grepl 2013-06-04 09:49:17 EDT
*** Bug 916624 has been marked as a duplicate of this bug. ***
Comment 7 Miroslav Grepl 2013-06-04 10:00:43 EDT
And how about the latest selinux-policy builds?
Comment 10 Miroslav Grepl 2013-07-22 04:24:28 EDT
#!!!! This avc has a dontaudit rule in the current policy
allow dovecot_deliver_t binfmt_misc_fs_t:dir getattr;
allow dovecot_deliver_t configfs_t:dir getattr;

#!!!! This avc has a dontaudit rule in the current policy
allow dovecot_deliver_t devpts_t:dir getattr;

#!!!! This avc has a dontaudit rule in the current policy
allow dovecot_deliver_t hugetlbfs_t:dir getattr;
allow dovecot_deliver_t pstorefs_t:dir getattr;

#!!!! This avc has a dontaudit rule in the current policy
allow dovecot_deliver_t tmpfs_t:dir getattr;
Comment 14 Ludek Smid 2014-06-13 06:01:55 EDT
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.

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