[MDEV-30520] SELinux incorrectly labeled mariadbd Created: 2023-01-31 Updated: 2024-02-07 |
|
| Status: | Stalled |
| Project: | MariaDB Server |
| Component/s: | Packaging |
| Affects Version/s: | 10.6.11 |
| Fix Version/s: | 10.5 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Frank | Assignee: | Daniel Black |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Rocky9 |
||
| Issue Links: |
|
||||||||
| Description |
|
It looks like the rpm packaged version will have an SELinux problem on systems running RHEL-9 or one of it clones. SElinux error:
I have found some hints for the problem: |
| Comments |
| Comment by Daniel Black [ 2023-01-31 ] | ||||||||||||||||||||||||||||||||||||||||||||
|
It looks like the mariadb unix socket is missing a label. Try:
setsebool httpd_can_network_connect_db 1 might be be required as a coverall boolean from httpd -> (db sockets). I agree we need to look closer at packaged selinux rules and the delta to the OS provided ones. > Also the none LTS version from maria.org Like https://mariadb.org/mariadb-10-11-is-lts/ - ETA 2 weeks. | ||||||||||||||||||||||||||||||||||||||||||||
| Comment by Frank [ 2023-01-31 ] | ||||||||||||||||||||||||||||||||||||||||||||
|
I found the problem.
MariaDB 10.6:
| ||||||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Black [ 2023-01-31 ] | ||||||||||||||||||||||||||||||||||||||||||||
|
Thank you. That sounds quite solvable. | ||||||||||||||||||||||||||||||||||||||||||||
| Comment by Frank [ 2023-01-31 ] | ||||||||||||||||||||||||||||||||||||||||||||
|
As an dirty work around until the rpm package is fixed:
It will change: | ||||||||||||||||||||||||||||||||||||||||||||
| Comment by Frank [ 2023-01-31 ] | ||||||||||||||||||||||||||||||||||||||||||||
|
Looking at the default file context list will show problem:
semanage fcontext -l|grep mariadb
For me the "magic" is this line: | ||||||||||||||||||||||||||||||||||||||||||||
| Comment by Ivan [ 2023-07-24 ] | ||||||||||||||||||||||||||||||||||||||||||||
|
I confirm the issue on AlmaLinux 9.2 and MariaDB 10.11. | ||||||||||||||||||||||||||||||||||||||||||||
| Comment by Oleksandr Byelkin [ 2023-07-26 ] | ||||||||||||||||||||||||||||||||||||||||||||
|
I do not see what review here | ||||||||||||||||||||||||||||||||||||||||||||
| Comment by Oleksandr Byelkin [ 2023-07-26 ] | ||||||||||||||||||||||||||||||||||||||||||||
|
OK, there is pull request https://github.com/MariaDB/server/pull/2711 | ||||||||||||||||||||||||||||||||||||||||||||
| Comment by Glenn van Es [ 2023-10-06 ] | ||||||||||||||||||||||||||||||||||||||||||||
|
I was also facing this issue, got a permission denied error on our websites, when changing localhost to 127.0.0.1 in the config the websites worked initially, I still don't entirely understand why that does work. Plesk helped us out to fix the issue with the workaround here: | ||||||||||||||||||||||||||||||||||||||||||||
| Comment by Jamie Burchell [ 2023-10-24 ] | ||||||||||||||||||||||||||||||||||||||||||||
|
Ran in to this issue today when installing 10.11 from the MariaDB repo on Rocky Linux 9. Also noticed each time the socket file was created, it did not maintain the correct label (system_u:object_r:mysqld_var_run_t:s0) until I ran restorecon on it. There seems to be other issues with the packaging here as when uninstalling (dnf remove MariaDB MariaDB-server) it only removed 6 of the 18 packages it had installed, leaving behind: Removed MariaDB-client-10.11.5-1.el9.x86_64 @@System | ||||||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Black [ 2023-10-24 ] | ||||||||||||||||||||||||||||||||||||||||||||
|
Did submit https://github.com/devexp-db/mysql-selinux/pull/5 to add to the upstream selinux package. | ||||||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Black [ 2023-11-22 ] | ||||||||||||||||||||||||||||||||||||||||||||
|
Upstream policy merged into fc40. |