Bug 2221433 - SELinux is preventing mariadbd from 'search' accesses on the directory net.
Summary: SELinux is preventing mariadbd from 'search' accesses on the directory net.
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: mysql-selinux
Version: 38
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Michal Schorm
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:4543e3b644fd226b4089e115da1...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-07-08 23:59 UTC by dan
Modified: 2023-07-27 13:49 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: ---
Embargoed:


Attachments (Terms of Use)
File: description (1.85 KB, text/plain)
2023-07-08 23:59 UTC, dan
no flags Details
File: os_info (734 bytes, text/plain)
2023-07-08 23:59 UTC, dan
no flags Details

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.


Note You need to log in before you can comment on or make changes to this bug.