Bug 1145619 - selinux denials prevent mariadb/galera from starting on non-primary nodes
Summary: selinux denials prevent mariadb/galera from starting on non-primary nodes
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 20
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Lukas Vrabec
QA Contact: Ben Levenson
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-09-23 11:25 UTC by Giulio Fidente
Modified: 2014-10-16 02:00 UTC (History)
7 users (show)

Fixed In Version: selinux-policy-3.12.1-189.fc20
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-10-16 02:00:57 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
mariadb service startup denials (20.13 KB, text/plain)
2014-09-23 11:25 UTC, Giulio Fidente
no flags Details
mariadb_service_startup_policy_fixes (3.33 KB, text/plain)
2014-09-23 22:41 UTC, Giulio Fidente
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Launchpad 1373150 0 None None None Never

Description Giulio Fidente 2014-09-23 11:25:05 UTC
Created attachment 940405 [details]
mariadb service startup denials

Description of problem:
when starting the mariadb service on a non primary node of a mariadb/galera cluster, selinux prevents wsrep/rsync from syncing up correctly with primary node so backup node will fail to start

list of denials (captured in permissive mode) is attached


Version-Release number of selected component (if applicable):
selinux-policy-targeted-3.12.1-183.fc20.noarch
selinux-policy-3.12.1-183.fc20.noarch
mariadb-galera-common-5.5.38-1.fc20.x86_64
mariadb-galera-server-5.5.38-1.fc20.x86_64
mariadb-libs-5.5.39-1.fc20.x86_64
mariadb-5.5.39-1.fc20.x86_64


How reproducible:
configure a mariadb/galera cluster with wsrep/rsync, start the primary node, make a non primary node to join the cluster


Actual results:
mariadb service fails to start on the non primary node

Comment 1 Ryan O'Hara 2014-09-23 13:12:01 UTC
I think you need openstack-selinux installed.

Comment 2 Ryan O'Hara 2014-09-23 16:39:25 UTC
(In reply to Ryan O'Hara from comment #1)
> I think you need openstack-selinux installed.

Nevermind. I was reminded that there is no openstack-selinux package for Fedora. Sounds like we need to port the galera policy bits to base policy in Fedora. Comments?

Comment 4 Giulio Fidente 2014-09-23 22:41:13 UTC
Created attachment 940626 [details]
mariadb_service_startup_policy_fixes

Ryan, using audit2allow I generated the required policy changes.

These are all or in part provided by openstack-selinux I suppose but I decided to attach the .te file here anyway so we can do compare or merge as needed.

Comment 5 Ryan Hallisey 2014-09-24 15:27:42 UTC
allow mysqld_t kerberos_port_t:tcp_socket name_bind;
allow mysqld_t rsync_exec_t:file { read getattr open execute execute_no_trans };

The rest of the rules are already in policy.

Comment 6 Giulio Fidente 2014-09-26 11:22:51 UTC
Ryan, that means in the policy provided by openstack-selinux ? How do we get access to that from Fedora?

Comment 7 Ryan Hallisey 2014-09-26 15:11:10 UTC
openstack-selinux is not in Fedora.  When the the changes are added to 
selinux-policy it will be fixed in Fedora.

Comment 8 Ryan O'Hara 2014-09-26 16:18:53 UTC
(In reply to Ryan Hallisey from comment #7)
> openstack-selinux is not in Fedora.  When the the changes are added to 
> selinux-policy it will be fixed in Fedora.

Do we have an ETA? I believe this is blocking RDO deployments on Fedora.

Comment 9 Ryan Hallisey 2014-10-01 15:02:32 UTC
I don't know.  When openstack-selinux policy is merged into selinux-policy you should see it in Fedora.

Comment 10 Miroslav Grepl 2014-10-02 09:50:50 UTC
commit 972bca1cf1254738134d1195025b57a7c26a8d44
Author: Dan Walsh <dwalsh>
Date:   Mon Jul 14 13:40:59 2014 -0400

    Mysql can execute scripts when run in a cluster to see if someone is listening on a socket, basically runs lsof.  Cluster team found it needed these access to make it work

Comment 11 Fedora Update System 2014-10-07 13:36:30 UTC
selinux-policy-3.12.1-189.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/selinux-policy-3.12.1-189.fc20

Comment 12 Fedora Update System 2014-10-08 19:02:26 UTC
Package selinux-policy-3.12.1-189.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing selinux-policy-3.12.1-189.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-12350/selinux-policy-3.12.1-189.fc20
then log in and leave karma (feedback).

Comment 13 Fedora Update System 2014-10-16 02:00:57 UTC
selinux-policy-3.12.1-189.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.


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