RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1191989 - [HC] selinux denials running glusterd
Summary: [HC] selinux denials running glusterd
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: selinux-policy
Version: 7.1
Hardware: All
OS: Linux
high
medium
Target Milestone: rc
: ---
Assignee: Lukas Vrabec
QA Contact: Milos Malik
Bara Ancincova
URL:
Whiteboard: gluster
Depends On:
Blocks: RHEV_HyperConverged_SLA
TreeView+ depends on / blocked
 
Reported: 2015-02-12 10:59 UTC by Sandro Bonazzola
Modified: 2015-11-19 10:26 UTC (History)
8 users (show)

Fixed In Version: selinux-policy-3.13.1-26.el7
Doc Type: Bug Fix
Doc Text:
SELinux policy for Red Hat Gluster Storage has been added Previously, SELinux policy for Red Hat Gluster Storage (RHGS) components was missing, and Gluster worked correctly only when SELinux was in permissive mode. With this update, SELinux policy rules for the *glusterd* (glusterFS Management Service), *glusterfsd* (NFS sever), *smbd*, *nfsd*, *rpcd*, adn *ctdbd* processes have been updated providing SELinux support for Gluster.
Clone Of:
Environment:
Last Closed: 2015-11-19 10:26:09 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
ausearch -m avc -m user_avc -m selinux_err -i -ts today (14.17 KB, text/plain)
2015-02-12 11:57 UTC, Sandro Bonazzola
no flags Details
setenforce 0 ; scenario; ausearch -m avc -m user_avc -m selinux_err -i -ts today (4.32 KB, text/plain)
2015-02-12 15:17 UTC, Sandro Bonazzola
no flags Details
fresh ausearch output (352.09 KB, text/plain)
2015-04-24 12:37 UTC, Sandro Bonazzola
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:2300 0 normal SHIPPED_LIVE selinux-policy bug fix update 2015-11-19 09:55:26 UTC

Description Sandro Bonazzola 2015-02-12 10:59:34 UTC
time->Thu Feb 12 11:48:17 2015
type=SYSCALL msg=audit(1423738097.736:374): arch=c000003e syscall=59 success=no exit=-13 a0=7f5a7c008c70 a1=7f5a7c008a40 a2=7f5a9b200460 a3=8 items=0 ppid=16529 pid=16632 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="glusterd" exe="/usr/sbin/glusterfsd" subj=system_u:system_r:glusterd_t:s0 key=(null)
type=AVC msg=audit(1423738097.736:374): avc:  denied  { execute } for  pid=16632 comm="glusterd" name="S31ganesha-set.sh" dev="sda1" ino=3311 scontext=system_u:system_r:glusterd_t:s0 tcontext=system_u:object_r:glusterd_var_lib_t:s0 tclass=file
----
time->Thu Feb 12 11:48:18 2015
type=SYSCALL msg=audit(1423738098.047:375): arch=c000003e syscall=59 success=no exit=-13 a0=7f5a7c008c70 a1=7f5a7c008a40 a2=7f5a9b200460 a3=8 items=0 ppid=16529 pid=16639 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="glusterd" exe="/usr/sbin/glusterfsd" subj=system_u:system_r:glusterd_t:s0 key=(null)
type=AVC msg=audit(1423738098.047:375): avc:  denied  { execute } for  pid=16639 comm="glusterd" name="S30samba-set.sh" dev="sda1" ino=3310 scontext=system_u:system_r:glusterd_t:s0 tcontext=system_u:object_r:glusterd_var_lib_t:s0 tclass=file

gluster packages are from upstream repository:

glusterfs-3.6.2-1.el7.x86_64
glusterfs-api-3.6.2-1.el7.x86_64
glusterfs-cli-3.6.2-1.el7.x86_64
glusterfs-fuse-3.6.2-1.el7.x86_64
glusterfs-libs-3.6.2-1.el7.x86_64
glusterfs-rdma-3.6.2-1.el7.x86_64
glusterfs-server-3.6.2-1.el7.x86_64

Comment 1 Milos Malik 2015-02-12 11:10:14 UTC
What is the full path to S31ganesha-set.sh and S30samba-set.sh files? Which package do they come from?

Please provide the selinux-policy-targeted version too.

Comment 2 Milos Malik 2015-02-12 11:12:17 UTC
Are there other SELinux denials on your machine?

# ausearch -m avc -m user_avc -m selinux_err -i -ts today

Comment 4 Sandro Bonazzola 2015-02-12 11:57:16 UTC
Created attachment 990893 [details]
ausearch -m avc -m user_avc -m selinux_err -i -ts today

(In reply to Milos Malik from comment #1)
> What is the full path to S31ganesha-set.sh and S30samba-set.sh files?

# locate S31ganesha-set.sh S30samba-set.sh
/var/lib/glusterd/hooks/1/set/post/S30samba-set.sh
/var/lib/glusterd/hooks/1/set/post/S31ganesha-set.sh


> Which package do they come from?

# rpm -qf \
 /var/lib/glusterd/hooks/1/set/post/S30samba-set.sh \
 /var/lib/glusterd/hooks/1/set/post/S31ganesha-set.sh
glusterfs-server-3.6.2-1.el7.x86_64
glusterfs-server-3.6.2-1.el7.x86_64
 
> Please provide the selinux-policy-targeted version too.

# rpm -qv selinux-policy-targeted
selinux-policy-targeted-3.13.1-23.el7.noarch

(In reply to Milos Malik from comment #2)
> Are there other SELinux denials on your machine?
> 
> # ausearch -m avc -m user_avc -m selinux_err -i -ts today

See the attachment

Comment 5 Milos Malik 2015-02-12 12:41:56 UTC
Could you re-run your scenario in permissive mode and attach those AVCs too?

# setenforce 0
# your scenario
# setenforce 1

Comment 6 Sandro Bonazzola 2015-02-12 15:17:46 UTC
Created attachment 990972 [details]
setenforce 0 ; scenario; ausearch -m avc -m user_avc -m selinux_err -i -ts today

(In reply to Milos Malik from comment #5)
> Could you re-run your scenario in permissive mode and attach those AVCs too?
> 
> # setenforce 0
> # your scenario
> # setenforce 1

See attached output

Comment 8 Miroslav Grepl 2015-04-09 09:47:41 UTC
Could you try to label them as bin_t and re-test it?

#chcon -t bin_t /var/lib/glusterd/hooks/1/set/post/S30samba-set.sh
#chcon -t bin_t /var/lib/glusterd/hooks/1/set/post/S31ganesha-set.sh

Comment 9 Sandro Bonazzola 2015-04-24 12:37:46 UTC
Created attachment 1018453 [details]
fresh ausearch output

Comment 10 Sandro Bonazzola 2015-04-24 12:41:38 UTC
Miroslav, it works better if you set a needinfo on me :-)
I'll try again applying your changes in comment #8.

In the meanwhile, can you take a look at attachment in comment #9 ?
It's a fresh output from ausearch -m avc from today on the same kind of deployment I was trying when I opened this bug.

I'd also suggest this for inclusion in 7.1.z.

Comment 11 Milos Malik 2015-04-24 12:53:56 UTC
Based on AVCs in the last attachment:
 * glusterd wants to access /dev/random
 * glusterd wants to execute various shell scripts under /var/lib/glusterd/hooks
 * dhclient wants to access /run/dhclient-ovirtmgmt.pid file
 * sanlock wants to access a symbolic link somewhere under /run/libvirt/

Comment 12 Sandro Bonazzola 2015-05-05 09:49:08 UTC
(In reply to Miroslav Grepl from comment #8)
> Could you try to label them as bin_t and re-test it?
> 
> #chcon -t bin_t /var/lib/glusterd/hooks/1/set/post/S30samba-set.sh
> #chcon -t bin_t /var/lib/glusterd/hooks/1/set/post/S31ganesha-set.sh

above commands solve the issue reported in comment #0

Do you need another BZ for the denials in comment #9?

Comment 13 Miroslav Grepl 2015-06-10 14:36:08 UTC
$ matchpathcon /var/lib/glusterd/hooks/*/*.sh
/var/lib/glusterd/hooks/*/*.sh	system_u:object_r:bin_t:s0

Comment 17 errata-xmlrpc 2015-11-19 10:26:09 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/RHBA-2015-2300.html


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