Bug 2221433

Summary: SELinux is preventing mariadbd from 'search' accesses on the directory net.
Product: [Fedora] Fedora Reporter: dan
Component: mysql-selinuxAssignee: Michal Schorm <mschorm>
Status: NEW --- QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 38CC: dan, hhorak, ljavorsk, mschorm
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:4543e3b644fd226b4089e115da133e4c6f0af10dc68a4c015d3cf0a19425839a;VARIANT_ID=workstation;
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
File: description
none
File: os_info none

Description dan 2023-07-08 23:59:11 UTC
Description of problem:
SELinux is preventing mariadbd from 'search' accesses on the directory net.

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

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

Additional Information:
Source Context                system_u:system_r:mysqld_t:s0
Target Context                system_u:object_r:sysctl_net_t:s0
Target Objects                net [ dir ]
Source                        mariadbd
Source Path                   mariadbd
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
SELinux Policy RPM            selinux-policy-targeted-38.17-1.fc38.noarch
Local Policy RPM              mysql-selinux-1.0.5-3.fc38.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 6.3.8-200.fc38.x86_64 #1 SMP
                              PREEMPT_DYNAMIC Thu Jun 15 02:15:40 UTC 2023
                              x86_64
Alert Count                   22
First Seen                    2023-04-15 13:59:39 EDT
Last Seen                     2023-07-08 16:13:42 EDT
Local ID                      81b23eb7-79bb-4070-94f3-208998c1eebd

Raw Audit Messages
type=AVC msg=audit(1688847222.756:17470): avc:  denied  { search } for  pid=1379 comm="mariadbd" name="net" dev="proc" ino=18692 scontext=system_u:system_r:mysqld_t:s0 tcontext=system_u:object_r:sysctl_net_t:s0 tclass=dir permissive=0


Hash: mariadbd,mysqld_t,sysctl_net_t,dir,search

Version-Release number of selected component:
selinux-policy-targeted-38.17-1.fc38.noarch

Additional info:
reporter:       libreport-2.17.10
package:        selinux-policy-targeted-38.17-1.fc38.noarch
component:      mysql-selinux
hashmarkername: setroubleshoot
type:           libreport
reason:         SELinux is preventing mariadbd from 'search' accesses on the directory net.
kernel:         6.3.8-200.fc38.x86_64
component:      mysql-selinux



Potential duplicate: bug 2186996

Comment 1 dan 2023-07-08 23:59:14 UTC
Created attachment 1974816 [details]
File: description

Comment 2 dan 2023-07-08 23:59:15 UTC
Created attachment 1974817 [details]
File: os_info

Comment 3 Michal Schorm 2023-07-27 08:17:18 UTC
Hello,
could you please describe your intention or use-case, that led you to this situation?

Because I'd guess that the 'mariadbd' would likely want not only to 'search' the directory, but also operate on the files inside.
A description or reproducer would help me understand what's going on and fix the SELinux rules in more accurate way.

Comment 4 dan 2023-07-27 13:26:02 UTC
Cause is unknown.  I don't do anything special other than access the db across the network.