Bug 1638954 - SELinux is preventing postgrey from starting (dac_override)
Summary: SELinux is preventing postgrey from starting (dac_override)
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 28
Hardware: x86_64
OS: Linux
Target Milestone: ---
Assignee: Lukas Vrabec
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2018-10-13 12:14 UTC by Joel Uckelman
Modified: 2018-11-09 05:25 UTC (History)
6 users (show)

Fixed In Version: selinux-policy-3.14.1-48.fc28
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2018-11-09 05:25:33 UTC
Type: Bug

Attachments (Terms of Use)

Description Joel Uckelman 2018-10-13 12:14:22 UTC
Description of problem:

SELinux is preventing 706F737467726579202D2D756E6978 from using the dac_override capability.

*****  Plugin dac_override (91.4 confidence) suggests   **********************

If you want to help identify if domain needs this access or you have a file with the wrong permissions on your system
Then turn on full auditing to get path information about the offending file and generate the error again.

Turn on full auditing
# auditctl -w /etc/shadow -p w
Try to recreate AVC. Then execute
# ausearch -m avc -ts recent
If you see PATH record check ownership/permissions on file, and fix it,
otherwise report as a bugzilla.

*****  Plugin catchall (9.59 confidence) suggests   **************************

If you believe that 706F737467726579202D2D756E6978 should have the dac_override capability by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
allow this access for now by executing:
# ausearch -c '706F737467726579202D2D756E6978' --raw | audit2allow -M my-706F737467726579202D2D756E6978
# semodule -X 300 -i my-706F737467726579202D2D756E6978.pp

Additional Information:
Source Context                system_u:system_r:postgrey_t:s0
Target Context                system_u:system_r:postgrey_t:s0
Target Objects                Unknown [ capability ]
Source                        706F737467726579202D2D756E6978
Source Path                   706F737467726579202D2D756E6978
Port                          <Unknown>
Host                          <Unknown>
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.14.1-44.fc28.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     nym
Platform                      Linux nym 4.18.12-200.fc28.x86_64 #1 SMP Thu Oct 4
                              15:46:35 UTC 2018 x86_64 x86_64
Alert Count                   20
First Seen                    2018-10-12 21:16:26 UTC
Last Seen                     2018-10-13 12:05:06 UTC
Local ID                      e1fc36dd-a577-4b02-9551-f81cbdfbf73f

Raw Audit Messages
type=AVC msg=audit(1539432306.51:606): avc:  denied  { dac_override } for  pid=2366 comm=706F737467726579202D2D756E6978 capability=1  scontext=system_u:system_r:postgrey_t:s0 tcontext=system_u:system_r:postgrey_t:s0 tclass=capability permissive=0

Hash: 706F737467726579202D2D756E6978,postgrey_t,postgrey_t,capability,dac_override

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


How reproducible:


Steps to Reproduce:
1. systemctl start postgrey.service

Actual results:

postgrey fails to start.

From journalctl:

Oct 13 12:05:06 nym postgrey[2366]: 2018/10/13-12:05:06 postgrey (type Net::Serv
er::Multiplex) starting! pid(2366)
Oct 13 12:05:06 nym systemd[1]: Started Postfix Greylisting Service.
Oct 13 12:05:06 nym audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294
967295 subj=system_u:system_r:init_t:s0 msg='unit=postgrey comm="systemd" exe="/
usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Oct 13 12:05:06 nym audit[2366]: AVC avc:  denied  { dac_override } for  pid=236
6 comm=706F737467726579202D2D756E6978 capability=1  scontext=system_u:system_r:p
ostgrey_t:s0 tcontext=system_u:system_r:postgrey_t:s0 tclass=capability permissi
Oct 13 12:05:06 nym postgrey[2366]: Binding to UNIX socket file "/var/spool/post
Oct 13 12:05:06 nym postgrey[2366]: FATAL: ERROR: Can't connect to UNIX socket a
t file /var/spool/postfix/postgrey/socket [Permission denied] at /usr/sbin/postg
rey line 788.
Oct 13 12:05:06 nym systemd[1]: postgrey.service: Main process exited, code=exit
ed, status=13/n/a
Oct 13 12:05:06 nym audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=42949
67295 subj=system_u:system_r:init_t:s0 msg='unit=postgrey comm="systemd" exe="/u
sr/lib/systemd/systemd" hostname=? addr=? terminal=? res=failed'
Oct 13 12:05:06 nym systemd[1]: postgrey.service: Failed with result 'exit-code'

Expected results:

postgrey starts successfullyprevent

Additional info:

Comment 1 Milos Malik 2018-11-02 20:14:43 UTC
Reproducible on Fedora 29 too:
type=PROCTITLE msg=audit(11/02/2018 21:13:00.994:5327) : proctitle=postgrey --unix=/var/spool/postfix/postgrey/socket --pidfile=/var/run/postgrey.pid --group=postgrey --user=postgrey --greylist-t 
type=PATH msg=audit(11/02/2018 21:13:00.994:5327) : item=1 name=/var/spool/postfix/postgrey/socket nametype=CREATE cap_fp=none cap_fi=none cap_fe=0 cap_fver=0 
type=PATH msg=audit(11/02/2018 21:13:00.994:5327) : item=0 name=/var/spool/postfix/postgrey/ inode=9876383 dev=fc:02 mode=dir,751 ouid=postgrey ogid=postfix rdev=00:00 obj=system_u:object_r:postgrey_spool_t:s0 nametype=PARENT cap_fp=none cap_fi=none cap_fe=0 cap_fver=0 
type=CWD msg=audit(11/02/2018 21:13:00.994:5327) : cwd=/ 
type=SOCKADDR msg=audit(11/02/2018 21:13:00.994:5327) : saddr={ fam=local path=/var/spool/postfix/postgrey/socket } 
type=SYSCALL msg=audit(11/02/2018 21:13:00.994:5327) : arch=x86_64 syscall=bind success=no exit=EACCES(Permission denied) a0=0x5 a1=0x560fedb2ee80 a2=0x6e a3=0x0 items=2 ppid=1 pid=13783 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=postgrey --unix exe=/usr/bin/perl subj=system_u:system_r:postgrey_t:s0 key=(null) 
type=AVC msg=audit(11/02/2018 21:13:00.994:5327) : avc:  denied  { dac_override } for  pid=13783 comm=postgrey --unix capability=dac_override  scontext=system_u:system_r:postgrey_t:s0 tcontext=system_u:system_r:postgrey_t:s0 tclass=capability permissive=0 

# ls -dl /var/spool/postfix/postgrey/
drwxr-x--x. 2 postgrey postfix 6 Jul 15 04:29 /var/spool/postfix/postgrey/
# ls -al /var/spool/postfix/postgrey/
total 0
drwxr-x--x.  2 postgrey postfix   6 Jul 15 04:29 .
drwxr-xr-x. 17 root     root    217 Nov  2 21:12 ..

Comment 2 Lukas Vrabec 2018-11-04 12:51:31 UTC
commit cc1a2104c278f70ce52c27eb552875fc421e9dc6 (HEAD -> rawhide)
Author: Lukas Vrabec <lvrabec@redhat.com>
Date:   Sun Nov 4 13:51:11 2018 +0100

    Add dac_override capability to postgrey_t domain BZ(1638954)

Comment 3 Fedora Update System 2018-11-05 08:21:14 UTC
selinux-policy-3.14.1-48.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-8004d37878

Comment 4 Fedora Update System 2018-11-06 23:27:22 UTC
selinux-policy-3.14.1-48.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-8004d37878

Comment 5 Fedora Update System 2018-11-09 05:25:33 UTC
selinux-policy-3.14.1-48.fc28 has been pushed to the Fedora 28 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.