Bug 1583086

Summary: SELinux is preventing /usr/sbin/nscd from map access on the file /usr/sbin/nscd
Product: Red Hat Enterprise Linux 7 Reporter: Lukas Slebodnik <lslebodn>
Component: selinux-policyAssignee: Lukas Vrabec <lvrabec>
Status: CLOSED ERRATA QA Contact: Milos Malik <mmalik>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.6CC: lvrabec, mgrepl, mmalik, plautrba, ssekidde
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-10-30 10:04:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Lukas Slebodnik 2018-05-28 08:16:25 UTC
SELinux is preventing /usr/sbin/nscd from map access on the file /usr/sbin/nscd.

*****  Plugin catchall (100. confidence) suggests   **************************

If you believe that nscd should be allowed map access on the nscd 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 'nscd' --raw | audit2allow -M my-nscd
# semodule -i my-nscd.pp


Additional Information:
Source Context                system_u:unconfined_r:groupadd_t:s0
Target Context                system_u:object_r:nscd_exec_t:s0
Target Objects                /usr/sbin/nscd [ file ]
Source                        nscd
Source Path                   /usr/sbin/nscd
Port                          <Unknown>
Host                          bkr-hv01-guest24.example.com
Source RPM Packages           nscd-2.17-245.el7.x86_64
Target RPM Packages           nscd-2.17-245.el7.x86_64
Policy RPM                    selinux-policy-3.13.1-197.el7.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Host Name                     bkr-hv01-guest24.example.com
Platform                      Linux bkr-hv01-guest24.example.com
                              3.10.0-893.el7.x86_64 #1 SMP Thu May 24 21:37:14
                              UTC 2018 x86_64 x86_64
Alert Count                   5
First Seen                    2018-05-26 09:13:22 EDT
Last Seen                     2018-05-26 09:14:36 EDT
Local ID                      5ba95aa1-d997-44c1-8b6d-9bbf92ce3b92

Raw Audit Messages
type=AVC msg=audit(1527340476.193:101): avc:  denied  { map } for  pid=13537 comm="nscd" path="/usr/sbin/nscd" dev="dm-0" ino=33554509 scontext=system_u:unconfined_r:groupadd_t:s0 tcontext=system_u:object_r:nscd_exec_t:s0 tclass=file permissive=1


type=SYSCALL msg=audit(1527340476.193:101): arch=x86_64 syscall=execve success=yes exit=0 a0=5617f58c3fe3 a1=7ffe6b7cbd10 a2=7ffe6b7cbd00 a3=7f8eb8808b10 items=0 ppid=13536 pid=13537 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=nscd exe=/usr/sbin/nscd subj=system_u:unconfined_r:nscd_t:s0 key=(null)

Hash: nscd,groupadd_t,nscd_exec_t,file,map

Comment 2 Lukas Slebodnik 2018-05-28 08:24:54 UTC
Similar AVC with useradd

SELinux is preventing /usr/sbin/nscd from map access on the file /usr/sbin/nscd.

*****  Plugin catchall (100. confidence) suggests   **************************

If you believe that nscd should be allowed map access on the nscd 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 'nscd' --raw | audit2allow -M my-nscd
# semodule -i my-nscd.pp


Additional Information:
Source Context                system_u:unconfined_r:useradd_t:s0
Target Context                system_u:object_r:nscd_exec_t:s0
Target Objects                /usr/sbin/nscd [ file ]
Source                        nscd
Source Path                   /usr/sbin/nscd
Port                          <Unknown>
Host                          bkr-hv01-guest24.example.com
Source RPM Packages           
Target RPM Packages           nscd-2.17-245.el7.x86_64
Policy RPM                    selinux-policy-3.13.1-197.el7.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Host Name                     bkr-hv01-guest24.example.com
Platform                      Linux bkr-hv01-guest24.example.com
                              3.10.0-893.el7.x86_64 #1 SMP Thu May 24 21:37:14
                              UTC 2018 x86_64 x86_64
Alert Count                   5
First Seen                    2018-05-26 09:13:22 EDT
Last Seen                     2018-05-26 09:14:36 EDT
Local ID                      8fa028fb-d6ce-40d1-ba45-461a6d77cff0

Raw Audit Messages
type=AVC msg=audit(1527340476.221:103): avc:  denied  { map } for  pid=13544 comm="nscd" path="/usr/sbin/nscd" dev="dm-0" ino=33554509 scontext=system_u:unconfined_r:useradd_t:s0 tcontext=system_u:object_r:nscd_exec_t:s0 tclass=file permissive=1


Hash: nscd,useradd_t,nscd_exec_t,file,map

Comment 3 Milos Malik 2018-06-12 14:53:14 UTC
Seen during the installation of memcached package:
----
type=PROCTITLE msg=audit(06/12/2018 10:49:32.477:418) : proctitle=(null) 
type=PATH msg=audit(06/12/2018 10:49:32.477:418) : item=1 name=/lib64/ld-linux-x86-64.so.2 inode=309380 dev=fd:00 mode=file,755 ouid=root ogid=root rdev=00:00 obj=system_u:object_r:ld_so_t:s0 objtype=NORMAL cap_fp=none cap_fi=none cap_fe=0 cap_fver=0 
type=PATH msg=audit(06/12/2018 10:49:32.477:418) : item=0 name=/usr/sbin/nscd inode=2890058 dev=fd:00 mode=file,755 ouid=root ogid=root rdev=00:00 obj=system_u:object_r:nscd_exec_t:s0 objtype=NORMAL cap_fp=none cap_fi=none cap_fe=0 cap_fver=0 
type=CWD msg=audit(06/12/2018 10:49:32.477:418) :  cwd=/ 
type=SYSCALL msg=audit(06/12/2018 10:49:32.477:418) : arch=x86_64 syscall=execve success=no exit=EACCES(Permission denied) a0=0x561a2e47b9c3 a1=0x7ffd35235cd0 a2=0x7ffd35235cc0 a3=0x7f7441a45b10 items=2 ppid=14688 pid=14692 auid=root uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=pts0 ses=3 comm=nscd exe=/usr/sbin/nscd subj=unconfined_u:unconfined_r:useradd_t:s0-s0:c0.c1023 key=(null) 
type=AVC msg=audit(06/12/2018 10:49:32.477:418) : avc:  denied  { map } for  pid=14692 comm=nscd path=/usr/sbin/nscd dev="dm-0" ino=2890058 scontext=unconfined_u:unconfined_r:useradd_t:s0-s0:c0.c1023 tcontext=system_u:object_r:nscd_exec_t:s0 tclass=file permissive=0 
----

Both sssd and nscd were stopped.

Comment 4 Milos Malik 2018-06-12 14:56:15 UTC
If memcached user/group do not exist then:

Downloading packages:
memcached-1.4.15-10.el7_3.1.x86_64.rpm                     |  85 kB   00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
groupadd: nscd did not terminate normally (signal 9)
groupadd: nscd did not terminate normally (signal 9)
groupadd: nscd did not terminate normally (signal 9)
useradd: nscd did not terminate normally (signal 9)
useradd: nscd did not terminate normally (signal 9)
useradd: nscd did not terminate normally (signal 9)
useradd: nscd did not terminate normally (signal 9)
  Installing : memcached-1.4.15-10.el7_3.1.x86_64                           1/1 
  Verifying  : memcached-1.4.15-10.el7_3.1.x86_64                           1/1 

Installed:
  memcached.x86_64 0:1.4.15-10.el7_3.1                                          

Complete!

Comment 8 errata-xmlrpc 2018-10-30 10:04:11 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:3111