Bug 704121

Summary: SELinux is preventing ntpd (ntpd_t) "write" to nss (sssd_var_lib_t)
Product: Red Hat Enterprise Linux 5 Reporter: Petr Šplíchal <psplicha>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED ERRATA QA Contact: Milos Malik <mmalik>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.7CC: dwalsh, mmalik, ohudlick
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: selinux-policy-2.4.6-306.el5 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-07-21 09:20:20 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Petr Šplíchal 2011-05-12 08:24:18 UTC
Description of problem:

When sssd is enabled, (re)starting ntpd results in AVC denial:

type=AVC msg=audit(1305187892.471:342): avc:  denied  { write }
for  pid=4192 comm="ntpd" name="nss" dev=dm-0 ino=5177826
scontext=root:system_r:ntpd_t:s0
tcontext=root:object_r:sssd_var_lib_t:s0 tclass=sock_file

type=SYSCALL msg=audit(1305187892.471:342): arch=80000016
syscall=102 success=no exit=-13 a0=3 a1=3ffffb6e510 a2=6e
a3=3ff00000001 items=0 ppid=1 pid=4192 auid=0 uid=0 gid=0 euid=0
suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=6 comm="ntpd"
exe="/usr/sbin/ntpd" subj=root:system_r:ntpd_t:s0 key=(null)

Version-Release number of selected component (if applicable):
sssd-1.2.1-39.el5
ntp-4.2.2p1-9.el5_4.1
authconfig-5.3.21-7.el5
selinux-policy-2.4.6-302.el5

Steps to Reproduce:
1. add "domains = local" to the [sssd] section of /etc/sssd/sssd.conf
2. uncomment [domain/local] section in the same config
3. authconfig --update --enablesssd
4. service ntpd restart

Additional info:
The actual socket file is /var/lib/sss/pipes/nss

# ls -lZ /var/lib/sss/pipes/
srw-rw-rw-  root root root:object_r:sssd_var_lib_t     nss
srw-rw-rw-  root root root:object_r:sssd_var_lib_t     pam
drwx------  root root system_u:object_r:sssd_var_lib_t private

Comment 1 Milos Malik 2011-05-12 08:30:26 UTC
Petr helped me to reproduce the scenario. First AVC appeared immediately. Second AVC appeared few seconds after.
----
time->Thu May 12 04:08:05 2011
type=SYSCALL msg=audit(1305187685.773:47): arch=80000016 syscall=102 success=no exit=-13 a0=3 a1=3ffffe6d540 a2=6e a3=3ff00000002 items=0 ppid=1 pid=26113 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=1 comm="ntpd" exe="/sbin/ntpd" subj=root:system_r:ntpd_t:s0 key=(null)
type=AVC msg=audit(1305187685.773:47): avc:  denied  { write } for  pid=26113 comm="ntpd" name="nss" dev=dm-0 ino=5963923 scontext=root:system_r:ntpd_t:s0 tcontext=root:object_r:sssd_var_lib_t:s0 tclass=sock_file
----
time->Thu May 12 04:08:32 2011
type=SYSCALL msg=audit(1305187712.123:50): arch=80000016 syscall=102 success=no exit=-13 a0=3 a1=3ffff8af558 a2=6e a3=3ff00000002 items=0 ppid=26764 pid=26765 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="procmail" exe="/usr/bin/procmail" subj=system_u:system_r:procmail_t:s0 key=(null)
type=AVC msg=audit(1305187712.123:50): avc:  denied  { write } for  pid=26765 comm="procmail" name="nss" dev=dm-0 ino=5963923 scontext=system_u:system_r:procmail_t:s0 tcontext=root:object_r:sssd_var_lib_t:s0 tclass=sock_file
----

Comment 2 Miroslav Grepl 2011-05-12 16:12:24 UTC
Ok, we have this in RHEL6.

Comment 3 Miroslav Grepl 2011-05-19 15:31:39 UTC
Fixed in selinux-policy-2.4.6-306.el5

Comment 6 errata-xmlrpc 2011-07-21 09:20:20 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-1069.html

Comment 7 errata-xmlrpc 2011-07-21 11:56:49 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-1069.html