Bug 1216941 - [SELinux] RHEL7:SMB: ctdbd does not have write permissions on fuse mount when SELinux is enabled
Summary: [SELinux] RHEL7:SMB: ctdbd does not have write permissions on fuse mount when...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Gluster Storage
Classification: Red Hat Storage
Component: samba
Version: rhgs-3.1
Hardware: Unspecified
OS: Unspecified
urgent
urgent
Target Milestone: ---
: RHGS 3.1.0
Assignee: Jose A. Rivera
QA Contact: surabhi
URL:
Whiteboard: SELinux
Depends On: 1215632
Blocks: 1202842 1212796 1224879
TreeView+ depends on / blocked
 
Reported: 2015-04-29 09:11 UTC by surabhi
Modified: 2015-07-29 04:42 UTC (History)
9 users (show)

Fixed In Version: ctdb2.5-2.5.5-3
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1224879 (view as bug list)
Environment:
Last Closed: 2015-07-29 04:42:26 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:1495 0 normal SHIPPED_LIVE Important: Red Hat Gluster Storage 3.1 update 2015-07-29 08:26:26 UTC

Description surabhi 2015-04-29 09:11:48 UTC
Description of problem:

With selinux in enforcing mode, when we start the gluster volume , the samba start hook script fails to execute and dows not create share in smb.conf.

If we try to start smb service without using hook script the service smb start succeeds.

But if create a volume and start a volume after which it is expected that hook scripts will run and create samba share in smb.conf doesn't work and fails with following errors.

If the same test is run in permissive mode, the hook scripts executes successfully and share gets created in smb.conf

The error in glusterd logs are as follows:

[2015-04-29 06:30:16.070804] E [run.c:190:runner_log] (--> /lib64/libglusterfs.so.0(_gf_log_callingfn+0x186)[0x7f75bdd2c116] (--> /lib64/libglusterfs.so.0(runner_log+0xfc)[0x7f75bdd7919c] (--> /usr/lib64/glusterfs/3.7.0alpha0/xlator/mgmt/glusterd.so(glusterd_hooks_run_hooks+0x47a)[0x7f75b2c2a1ba] (--> /usr/lib64/glusterfs/3.7.0alpha0/xlator/mgmt/glusterd.so(+0xd0772)[0x7f75b2c2a772] (--> /lib64/libpthread.so.0(+0x7df5)[0x7f75bce9bdf5] ))))) 0-management: Failed to execute script: /var/lib/glusterd/hooks/1/start/post/S30samba-start.sh --volname=vol1 --first=yes --version=1 --volume-op=start --gd-workdir=/var/lib/glusterd


the AVC denials are as follows:
type=AVC msg=audit(1430289182.264:582): avc:  denied  { getattr } for  pid=29427 comm="glusterd" path="/dev/random" dev="devtmpfs" ino=1032 scontext=system_u:system_r:glusterd_t:s0 tcontext=system_u:object_r:random_device_t:s0 tclass=chr_file


type=AVC msg=audit(1430289157.013:580): avc:  denied  { execute } for  pid=29632 comm="glusterd" name="S30samba-start.sh" dev="dm-0" ino=488775 scontext=system_u:system_r:glusterd_t:s0 tcontext=system_u:object_r:glusterd_var_lib_t:s0 tclass=file

type=AVC msg=audit(1430289156.998:579): avc:  denied  { execute } for  pid=29626 comm="glusterd" name="S29CTDBsetup.sh" dev="dm-0" ino=488774 scontext=system_u:system_r:glusterd_t:s0 tcontext=system_u:object_r:glusterd_var_lib_t:s0 tclass=file

type=AVC msg=audit(1430289143.445:573): avc:  denied  { execute } for  pid=29576 comm="glusterd" name="S30samba-stop.sh" dev="dm-0" ino=135416758 scontext=system_u:system_r:glusterd_t:s0 tcontext=system_u:object_r:glusterd_var_lib_t:s0 tclass=file



Version-Release number of selected component (if applicable):
samba-4.1.17-5.el7.centos.x86_64
glusterfs-3.7.0alpha0-0.17.gited96153.el7.centos.x86_64

How reproducible:
Always

Steps to Reproduce:
1.Install RHEL7.1, Install RHS samba rpms, gluster bits
2.create a gluster volume 
3.start the volume
4.check if share is created in smb.conf

Actual results:
hook script fails to execute and samba share is not create din smb.conf


Expected results:
samba share should get created in smb.conf after a volume start.


Additional info:

Looks like execution of hook script and editing smb.conf is prevented by selinux.We need to resolve this.

Comment 3 Prasanth 2015-06-23 09:41:51 UTC
Based on https://bugzilla.redhat.com/show_bug.cgi?id=1224879#c17, looks like the fix is required in gluster side. Could you please check and do the needful to fix the issue?

####
Yes, it should be turn on by default by Gluster.

setsebool -P use_fusefs_home_dirs 1
####

Comment 6 Jose A. Rivera 2015-06-24 20:11:40 UTC
Variable has been configured to be set as part of the post-installation procedures. Please verify this works. :)

Comment 7 surabhi 2015-07-03 06:05:17 UTC
With the above mentioned build the boolean is not properly set and issues are seen with CTDB failover tests. Opened a new BZ for CTDB failover issue. Once the fix is provided for this BZ , will verify the other BZ too.

Comment 8 surabhi 2015-07-04 07:46:27 UTC
The Boolean setsebool -P use_fusefs_home_dirs 1 is set now with the new ctdb build ctdb2.5-2.5.5-3.
The fail-over issues were because of other SELinux which are getting fixed as part of the fail-over bz.

Marking this BZ as verified.

Comment 9 errata-xmlrpc 2015-07-29 04:42:26 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, 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://rhn.redhat.com/errata/RHSA-2015-1495.html


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