Bug 981031 - Can't run pcsd with systemd due to avc denials
Can't run pcsd with systemd due to avc denials
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: selinux-policy (Show other bugs)
7.0
All Linux
urgent Severity urgent
: rc
: ---
Assigned To: Miroslav Grepl
Milos Malik
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-03 16:04 EDT by Chris Feist
Modified: 2014-06-17 22:23 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-06-13 05:49:16 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 Chris Feist 2013-07-03 16:04:44 EDT
Description of problem:


Version-Release number of selected component (if applicable):
selinux-policy-mls-3.12.1-52.el7.noarch
libselinux-utils-2.1.13-15.el7.x86_64
libselinux-2.1.13-15.el7.x86_64
libselinux-python-2.1.13-15.el7.x86_64
selinux-policy-targeted-3.12.1-52.el7.noarch
selinux-policy-3.12.1-52.el7.noarch
pcs-0.9.49-3.el7.x86_64


How reproducible:
Always

Steps to Reproduce:
1. systemctl start pcsd.service
2. Following AVC's show up until it fails
type=AVC msg=audit(1372881777.211:1752): avc:  denied  { read } for  pid=20947 comm="systemd-notify" path="/var/log/pcsd/pcsd-main.log" dev="dm-1" ino=3145740 scontext=system_u:system_r:systemd_notify_t:s0 tcontext=system_u:object_r:var_log_t:s0 tclass=file
type=SYSCALL msg=audit(1372881777.211:1752): arch=c000003e syscall=59 success=yes exit=0 a0=23841a8 a1=3087cc8 a2=23c0640 a3=0 items=0 ppid=20942 pid=20947 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 ses=4294967295 tty=(none) comm="systemd-notify" exe="/usr/bin/systemd-notify" subj=system_u:system_r:systemd_notify_t:s0 key=(null)
type=AVC msg=audit(1372881777.216:1753): avc:  denied  { create } for  pid=20947 comm="systemd-notify" scontext=system_u:system_r:systemd_notify_t:s0 tcontext=system_u:system_r:systemd_notify_t:s0 tclass=unix_dgram_socket
type=SYSCALL msg=audit(1372881777.216:1753): arch=c000003e syscall=41 success=no exit=-13 a0=1 a1=80002 a2=0 a3=1 items=0 ppid=20942 pid=20947 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 ses=4294967295 tty=(none) comm="systemd-notify" exe="/usr/bin/systemd-notify" subj=system_u:system_r:systemd_notify_t:s0 key=(null)
type=SERVICE_START msg=audit(1372881866.102:1754): pid=1 uid=0 auid=4294967295 ses=4294967295  subj=system_u:system_r:init_t:s0 msg=' comm="pcsd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=failed'


/var/log/pcsd/pcsd-main.log is the location where all logging is done.
Comment 2 Milos Malik 2013-07-04 03:18:11 EDT
I see the same AVCs in enforcing mode:
----
type=PATH msg=audit(07/04/2013 09:12:56.364:2749) : item=1 name=(null) inode=6424216 dev=08:04 mode=file,755 ouid=root ogid=root rdev=00:00 obj=system_u:object_r:ld_so_t:s0 
type=PATH msg=audit(07/04/2013 09:12:56.364:2749) : item=0 name=/bin/systemd-notify inode=6424890 dev=08:04 mode=file,755 ouid=root ogid=root rdev=00:00 obj=system_u:object_r:systemd_notify_exec_t:s0 
type=CWD msg=audit(07/04/2013 09:12:56.364:2749) :  cwd=/var/lib/pcsd 
type=EXECVE msg=audit(07/04/2013 09:12:56.364:2749) : argc=2 a0=systemd-notify a1=--ready 
type=SYSCALL msg=audit(07/04/2013 09:12:56.364:2749) : arch=x86_64 syscall=execve success=yes exit=0 a0=0x288d870 a1=0x3266228 a2=0x28a3380 a3=0x0 items=2 ppid=26944 pid=26949 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root ses=unset tty=(none) comm=systemd-notify exe=/usr/bin/systemd-notify subj=system_u:system_r:systemd_notify_t:s0 key=(null) 
type=AVC msg=audit(07/04/2013 09:12:56.364:2749) : avc:  denied  { read } for  pid=26949 comm=systemd-notify path=/var/log/pcsd/pcsd-main.log dev="sda4" ino=1968087 scontext=system_u:system_r:systemd_notify_t:s0 tcontext=system_u:object_r:var_log_t:s0 tclass=file 
----
type=SYSCALL msg=audit(07/04/2013 09:12:56.366:2750) : arch=x86_64 syscall=socket success=no exit=-13(Permission denied) a0=local a1=SOCK_DGRAM a2=ip a3=0x1 items=0 ppid=26944 pid=26949 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root ses=unset tty=(none) comm=systemd-notify exe=/usr/bin/systemd-notify subj=system_u:system_r:systemd_notify_t:s0 key=(null) 
type=AVC msg=audit(07/04/2013 09:12:56.366:2750) : avc:  denied  { create } for  pid=26949 comm=systemd-notify scontext=system_u:system_r:systemd_notify_t:s0 tcontext=system_u:system_r:systemd_notify_t:s0 tclass=unix_dgram_socket 
----

# systemctl --system daemon-reload
# rpm -qf /var/lib/pcsd
pcs-0.9.49-3.el7.x86_64
# rm -f /var/log/pcsd/pcsd-main.log
# service pcsd restart
Redirecting to /bin/systemctl restart  pcsd.service
(long pause)
Job for pcsd.service failed. See 'systemctl status pcsd.service' and 'journalctl -xn' for details.
# service pcsd status
Redirecting to /bin/systemctl status  pcsd.service
pcsd.service - PCS GUI and remote configuration interface
   Loaded: loaded (/usr/lib/systemd/system/pcsd.service; disabled)
   Active: failed (Result: timeout) since Thu 2013-07-04 09:14:26 CEST; 2min 2s ago
 Main PID: 26939
   CGroup: name=systemd:/system/pcsd.service

Jul 04 09:14:26 rhel70 systemd[1]: pcsd.service operation timed out. Termin...g.
Jul 04 09:14:26 rhel70 systemd[1]: Failed to start PCS GUI and remote confi...e.
Jul 04 09:14:26 rhel70 systemd[1]: Unit pcsd.service entered failed state.
# ls -Z /var/log/pcsd/
-rw-------. root root system_u:object_r:var_log_t:s0   pcsd-main.log
#
Comment 3 Miroslav Grepl 2013-07-04 10:49:05 EDT
Milos,

# ps -eZ |grep initrc


I guess we need a policy for pcs.
Comment 4 Milos Malik 2013-07-04 11:05:33 EDT
system_u:system_r:init_t:s0     root      4543     1  0 17:03 ?        00:00:00 /bin/sh /usr/lib/pcsd/pcsd start
system_u:system_r:initrc_t:s0   root      4547  4543  0 17:03 ?        00:00:00 /bin/bash -c ulimit -S -c 0 >/dev/null 2>&1 ; /usr/bin/ruby -I/usr/lib/pcsd /usr/lib/pcsd/ssl.rb
system_u:system_r:initrc_t:s0   root      4548  4547  0 17:03 ?        00:00:00 /usr/bin/ruby -I/usr/lib/pcsd /usr/lib/pcsd/ssl.rb
Comment 5 Miroslav Grepl 2013-07-22 02:38:12 EDT
commit 13c669ceeb1e092e031cd8edd6fcf059f2471398
Author: Miroslav Grepl <mgrepl@redhat.com>
Date:   Mon Jul 22 08:34:41 2013 +0200

    Add labeling for /usr/lib/pcsd/pcsd

commit 4415f79a5912a884b5cf57fe901cfaf4a0b28291
Author: Miroslav Grepl <mgrepl@redhat.com>
Date:   Mon Jul 22 08:30:07 2013 +0200

    Add labeling for /var/log/pcsd

commit dd6e7e4533e1f58fe102b78a2d9f1bf9aec09eff
Author: Miroslav Grepl <mgrepl@redhat.com>
Date:   Mon Jul 22 08:28:36 2013 +0200

    Add support for pcs which is a corosync and pacemaker configuration tool
Comment 7 Ludek Smid 2014-06-13 05:49:16 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.