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 1146529 - selinux prevents hosted engine to be deployed on EL7 with iscsi support
Summary: selinux prevents hosted engine to be deployed on EL7 with iscsi support
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: selinux-policy
Version: 7.0
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: rc
: ---
Assignee: Miroslav Grepl
QA Contact: Martin Žember
URL:
Whiteboard:
: 1150427 (view as bug list)
Depends On:
Blocks: 784395 1067162 1142709 1149634 1154727
TreeView+ depends on / blocked
 
Reported: 2014-09-25 12:27 UTC by Sandro Bonazzola
Modified: 2015-07-13 04:14 UTC (History)
10 users (show)

Fixed In Version: selinux-policy-3.13.1-3.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1146531 1154727 (view as bug list)
Environment:
Last Closed: 2015-03-05 10:41:19 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
ausearch output (62.96 KB, text/plain)
2014-09-29 13:15 UTC, Sandro Bonazzola
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1148712 0 unspecified CLOSED avc denials accessing sanlock socket while deploying hosted engine 2021-02-22 00:41:40 UTC
Red Hat Product Errata RHBA-2015:0458 0 normal SHIPPED_LIVE selinux-policy bug fix and enhancement update 2015-03-05 15:17:00 UTC

Internal Links: 1148712

Description Sandro Bonazzola 2014-09-25 12:27:27 UTC
Description of problem:
deploying hosted engine on EL7 hosts leads to Bug #1142709 where libvirt / vdsm / qemu encounters multiple selinux denials making hosted-engine deploy fail on EL7.

Version-Release number of selected component (if applicable):
# rpm -qa|egrep "(selinux-policy|libvirt|qemu)"|sort 
ipxe-roms-qemu-20130517-5.gitc4bce43.el7.noarch
libvirt-client-1.1.1-29.el7_0.1.x86_64
libvirt-daemon-1.1.1-29.el7_0.1.x86_64
libvirt-daemon-config-nwfilter-1.1.1-29.el7_0.1.x86_64
libvirt-daemon-driver-interface-1.1.1-29.el7_0.1.x86_64
libvirt-daemon-driver-network-1.1.1-29.el7_0.1.x86_64
libvirt-daemon-driver-nodedev-1.1.1-29.el7_0.1.x86_64
libvirt-daemon-driver-nwfilter-1.1.1-29.el7_0.1.x86_64
libvirt-daemon-driver-qemu-1.1.1-29.el7_0.1.x86_64
libvirt-daemon-driver-secret-1.1.1-29.el7_0.1.x86_64
libvirt-daemon-driver-storage-1.1.1-29.el7_0.1.x86_64
libvirt-daemon-kvm-1.1.1-29.el7_0.1.x86_64
libvirt-lock-sanlock-1.1.1-29.el7_0.1.x86_64
libvirt-python-1.1.1-29.el7_0.1.x86_64
qemu-img-rhev-1.5.3-60.el7_0.2.x86_64
qemu-kvm-common-rhev-1.5.3-60.el7_0.2.x86_64
qemu-kvm-rhev-1.5.3-60.el7_0.2.x86_64
qemu-kvm-tools-rhev-1.5.3-60.el7_0.2.x86_64
selinux-policy-3.12.1-153.el7_0.10.noarch
selinux-policy-targeted-3.12.1-153.el7_0.10.noarch

How reproducible:
100%

Steps to Reproduce:
1. deploy hosted engine on EL7, see bug #1142709

Actual results:
multiple denials cause the deploy to fail

Expected results:
the deploy should succeed

Additional info:

Comment 2 Milos Malik 2014-09-25 13:29:10 UTC
What AVCs do you see?

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

Comment 3 Sandro Bonazzola 2014-09-29 13:02:51 UTC
Adding a needinfo on me for providing info requested on comment #2. I'll provide as soon as I can.

Comment 4 Sandro Bonazzola 2014-09-29 13:15:34 UTC
Created attachment 942310 [details]
ausearch output

ausearch -m avc -m user_avc -m selinux_err -i -ts 25/09/2014 >ausearch.txt

Comment 5 Sandro Bonazzola 2014-10-01 06:48:51 UTC
Not sure if related, but seems that the workaround pushed for fixing bug #1127460 resolves the selinux issues.

Comment 6 Miroslav Grepl 2014-10-06 12:58:56 UTC
type=AVC msg=audit(25/09/2014 07:56:32.083:1678) : avc:  denied  { write } for  pid=6963 comm=qemu-kvm path=/dev/dm-9 dev="devtmpfs" ino=66167 scontext=system_u:system_r:svirt_t:s0:c149,c360 tcontext=system_u:object_r:fixed_disk_device_t:s0 tclass=blk_file


this one is libvirt bug.


type=AVC msg=audit(25/09/2014 08:06:37.998:2573) : avc:  denied  { read } for  pid=25512 comm=ping path=/dev/dm-8 dev="devtmpfs" ino=130548 scontext=system_u:system_r:ping_t:s0 tcontext=system_u:object_r:fixed_disk_device_t:s0 tclass=blk_file

this is a leak. 

I added

commit 55a14f3158ce1a59b4b25c4dbbf6795ed6cf211d
Author: Miroslav Grepl <mgrepl>
Date:   Mon Oct 6 14:54:57 2014 +0200

    ALlow sanlock_t to read sysfs_t.

Comment 8 Simone Tiraboschi 2014-10-15 07:42:23 UTC
*** Bug 1150427 has been marked as a duplicate of this bug. ***

Comment 9 Simone Tiraboschi 2014-10-15 10:29:02 UTC
I tried to setup hosted-engine on RHEL7 with selinux-policy-3.13.1-4 but it's still blocked by selinux.

 time->Wed Oct 15 10:02:37 2014
 type=SYSCALL msg=audit(1413360157.163:3312): arch=c000003e syscall=2 success=no exit=-13 a0=7f2a48966410 a1=105002 a2=0 a3=1 items=0 ppid=1 pid=5195 auid=4294967295 uid=179 gid=179 euid=179 suid=179 fsuid=179 egid=179 sgid=179 fsgid=179 tty=(none) ses=4294967295 comm="sanlock" exe="/usr/sbin/sanlock" subj=system_u:system_r:sanlock_t:s0-s0:c0.c1023 key=(null)
 type=AVC msg=audit(1413360157.163:3312): avc:  denied  { read write } for  pid=5195 comm="sanlock" name="dm-9" dev="devtmpfs" ino=611495 scontext=system_u:system_r:sanlock_t:s0-s0:c0.c1023 tcontext=system_u:object_r:svirt_image_t:s0 tclass=blk_file

I'm not really sure it's a selinux-policy issue or a labeling problem from vdsm.
 [root@r70st1 ~]# ls -lZ /dev/dm-9 
 brw-rw----. vdsm qemu system_u:object_r:svirt_image_t:s0 /dev/dm-9

Comment 10 Nir Soffer 2014-10-15 10:58:25 UTC
(In reply to Miroslav Grepl from comment #6)
> type=AVC msg=audit(25/09/2014 07:56:32.083:1678) : avc:  denied  { write }
> for  pid=6963 comm=qemu-kvm path=/dev/dm-9 dev="devtmpfs" ino=66167
> scontext=system_u:system_r:svirt_t:s0:c149,c360
> tcontext=system_u:object_r:fixed_disk_device_t:s0 tclass=blk_file
> 
> 
> this one is libvirt bug.

This looks like vdsm image that lost the libvirt selinux label - bug 1127460. This should be fixed in latest ovirt 3.5.

Comment 11 Simone Tiraboschi 2014-10-15 13:03:06 UTC
(In reply to Nir Soffer from comment #10)
> (In reply to Miroslav Grepl from comment #6)
> > type=AVC msg=audit(25/09/2014 07:56:32.083:1678) : avc:  denied  { write }
> > for  pid=6963 comm=qemu-kvm path=/dev/dm-9 dev="devtmpfs" ino=66167
> > scontext=system_u:system_r:svirt_t:s0:c149,c360
> > tcontext=system_u:object_r:fixed_disk_device_t:s0 tclass=blk_file
> > 
> > 
> > this one is libvirt bug.
> 
> This looks like vdsm image that lost the libvirt selinux label - bug
> 1127460. This should be fixed in latest ovirt 3.5.

I runned it again updating to vdsm-4.16.7-1.el7 from a yesterday build and now vdsm it's able to start the VM over iscsi with sanlock.

Comment 12 Nikolai Sednev 2015-01-11 16:02:22 UTC
Works for me on these components:
rhevm-guest-agent-common-1.0.10-2.el6ev.noarch
rhevm-3.5.0-0.28.el6ev.noarch
ovirt-hosted-engine-ha-1.2.4-5.el7ev.noarch
sanlock-3.1.0-2.el7.x86_64
vdsm-4.16.8.1-5.el7ev.x86_64
ovirt-hosted-engine-setup-1.2.1-8.el7ev.noarch
qemu-kvm-rhev-1.5.3-60.el7_0.11.x86_64
ovirt-host-deploy-1.3.0-2.el7ev.noarch
libvirt-client-1.1.1-29.el7_0.4.x86_64
Linux version 3.10.0-123.19.1.el7.x86_64 (mockbuild.eng.bos.redhat.com) (gcc version 4.8.2 20140120 (Red Hat 4.8.2-16) (GCC) ) #1 SMP Mon Dec 15 14:04:04 EST 2014-on 3 hosts

Linux version 2.6.32-504.3.3.el6.x86_64 (mockbuild.eng.bos.redhat.com) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-9) (GCC) ) #1 SMP Fri Dec 12 16:05:43 EST 2014-on HE VM.


I installed HE over iSCSI LUN of 35Gig from first host running on RHEL7.0 and then added 2 more RHEL7.0 hosts to the HE setup, while using answer file from first host. All hosts became operational via WEBUI and all were deployed using iSCSI for HE VM creation and also another LUN on the same storage was used at separate LUN for guest-VM disks, all worked flawlessly.

Selinux was enforcing on all three hosts.

Comment 15 errata-xmlrpc 2015-03-05 10:41:19 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-0458.html


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