Bug 2134726

Summary: SELinux is preventing /usr/sbin/ns-slapd from 'search' accesses on the directory /proc/sys/fs/binfmt_misc
Product: Red Hat Enterprise Linux 9 Reporter: Ding-Yi Chen <dchen>
Component: selinux-policyAssignee: Nikola Knazekova <nknazeko>
Status: CLOSED ERRATA QA Contact: Milos Malik <mmalik>
Severity: medium Docs Contact:
Priority: medium    
Version: 9.0CC: apeetham, lvrabec, mmalik, zpytela
Target Milestone: rcKeywords: Triaged
Target Release: 9.2   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: selinux-policy-34.1.46-1.el9 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-05-09 08:16:52 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 Ding-Yi Chen 2022-10-14 06:48:44 UTC
Description of problem:
SELinux is preventing /usr/sbin/ns-slapd from 'search' accesses on the directory /proc/sys/fs/binfmt_misc.

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

If you believe that ns-slapd should be allowed search access on the binfmt_misc directory 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 'ns-slapd' --raw | audit2allow -M my-nsslapd
# semodule -X 300 -i my-nsslapd.pp

Additional Information:
Source Context                system_u:system_r:dirsrv_t:s0
Target Context                system_u:object_r:sysctl_fs_t:s0
Target Objects                /proc/sys/fs/binfmt_misc [ dir ]
Source                        ns-slapd
Source Path                   /usr/sbin/ns-slapd
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           389-ds-base-2.0.14-1.el9.x86_64
Target RPM Packages           
SELinux Policy RPM            selinux-policy-targeted-34.1.29-1.el9_0.2.noarch
Local Policy RPM              selinux-policy-targeted-34.1.29-1.el9_0.2.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 5.14.0-70.26.1.el9_0.x86_64 #1 SMP
                              PREEMPT Fri Sep 2 16:07:40 EDT 2022 x86_64 x86_64
Alert Count                   11
First Seen                    2022-10-14 16:22:27 AEST
Last Seen                     2022-10-14 16:22:27 AEST

Raw Audit Messages
type=AVC msg=audit(1665728547.594:1821144): avc:  denied  { search } for  pid=38068 comm="ns-slapd" name="fs" dev="proc" ino=13413 scontext=system_u:system_r:dirsrv_t:s0 tcontext=system_u:object_r:sysctl_fs_t:s0 tclass=dir permissive=0


type=SYSCALL msg=audit(1665728547.594:1821144): arch=x86_64 syscall=newfstatat success=no exit=EACCES a0=ffffff9c a1=7f806a02f032 a2=7f80705edd30 a3=0 items=1 ppid=1 pid=38068 auid=4294967295 uid=389 gid=389 euid=389 suid=389 fsuid=389 egid=389 sgid=389 fsgid=389 tty=(none) ses=4294967295 comm=ns-slapd exe=/usr/sbin/ns-slapd subj=system_u:system_r:dirsrv_t:s0 key=(null)

type=CWD msg=audit(1665728547.594:1821144): cwd=/var/log/dirsrv/slapd-EXAMPLE-COM

type=PATH msg=audit(1665728547.594:1821144): item=0 name=/proc/sys/fs/binfmt_misc nametype=UNKNOWN cap_fp=0 cap_fi=0 cap_fe=0 cap_fver=0 cap_frootid=0

Hash: ns-slapd,dirsrv_t,sysctl_fs_t,dir,search

Comment 2 Ding-Yi Chen 2022-10-14 06:52:09 UTC
# sesearch -s dirsrv_t -t sysctl_fs_t -c dir -p search -A --dontaudit

Returned nothing

Comment 13 errata-xmlrpc 2023-05-09 08:16:52 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 (selinux-policy bug fix and enhancement update), 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-2023:2483