Bug 1456199 - selinux AVC denial seen when qemu-kvm process tries to write in to /var/run/gluster
Summary: selinux AVC denial seen when qemu-kvm process tries to write in to /var/run/g...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Gluster Storage
Classification: Red Hat Storage
Component: libgfapi
Version: rhgs-3.3
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ---
: RHGS 3.3.0
Assignee: Niels de Vos
QA Contact: SATHEESARAN
URL:
Whiteboard:
Depends On: 1455994
Blocks: Gluster-HC-3 1417151 1445570
TreeView+ depends on / blocked
 
Reported: 2017-05-27 15:56 UTC by SATHEESARAN
Modified: 2017-09-25 11:22 UTC (History)
5 users (show)

Fixed In Version: selinux-policy-3.13.1-160
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-09-25 11:22:26 UTC
Embargoed:


Attachments (Terms of Use)

Description SATHEESARAN 2017-05-27 15:56:52 UTC
Description of problem:
-----------------------
When triggering the statedump of gfapi application(QEMU), avc denial logged in audit.log and statedump is not dumped in to /var/run/gluster

Version-Release number of selected component (if applicable):
-------------------------------------------------------------
RHEL 7.3 ( 3.10.0-514.16.1.el7.x86_64 )
libselinux-utils-2.5-6.el7.x86_64
selinux-policy-3.13.1-102.el7_3.16.noarch
libselinux-2.5-6.el7.x86_64
libselinux-python-2.5-6.el7.x86_64
selinux-policy-targeted-3.13.1-102.el7_3.16.noarch
RHGS 3.3.0 interim build ( glusterfs-3.8.4-25.el7rhgs )

How reproducible:
------------------
Always

Steps to Reproduce:
-------------------
1. Create a QEMU process that uses QEMU driver for glusterfs (libgfapi)
2. Trigger gfapi application statedump from gluster node

Actual results:
---------------
No gfapi statedump under /var/run/gluster and AVC denial message logged in audit.log

Expected results:
-----------------
gfapi application should dump the statedump under /var/run/gluster


Additional info:
----------------
Snip from audit.log
<snip>
type=AVC msg=audit(1495796194.193:981): avc:  denied  { write } for  pid=14873 comm="qemu-kvm" name="gluster" dev="tmpfs" ino=109984 scontext=system_u:system_r:svirt_t:s0:c399,c698 tcontext=system_u:object_r:glusterd_var_run_t:s0 tclass=dir
</snip>

Comment 3 SATHEESARAN 2017-06-19 18:12:32 UTC
Tested with selinux-policy-3.13.1-160

1. selinux boolean virt_use_glusterd is available
# getsebool -a | grep glusterd
virt_use_glusterd --> on

2. When this boolean is set to 'on' and gfapi statedump could be triggered and written to /var/run/gluster

Comment 4 SATHEESARAN 2017-06-19 18:13:07 UTC
(In reply to SATHEESARAN from comment #3)
> Tested with selinux-policy-3.13.1-160
> 
> 1. selinux boolean virt_use_glusterd is available
> # getsebool -a | grep glusterd
> virt_use_glusterd --> on
> 
> 2. When this boolean is set to 'on' and gfapi statedump could be triggered
> and written to /var/run/gluster

Also tested with RHGS 3.3.0 interim build ( glusterfs-3.8.4-27.el7rhgs )


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