Bug 1031721

Summary: OpenLMI Hardware provider needs updated selinux policy
Product: Red Hat Enterprise Linux 7 Reporter: Peter Schiffer <pschiffe>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED CURRENTRELEASE QA Contact: Milos Malik <mmalik>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.0CC: mmalik, pschiffe, riehecky, tsmetana
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: selinux-policy-3.12.1-118.el7 Doc Type: Known Issue
Doc Text:
The OpenLMI hardware provider does not work on systems with SELinux running in enforcing mode.
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-13 13:14:51 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
avc_msgs.txt
none
avc_msgs.txt
none
avc.txt none

Description Peter Schiffer 2013-11-18 15:39:28 UTC
Created attachment 825730 [details]
avc_msgs.txt

Description of problem:
Support for physical disks was added to the OpenLMI Hardware provider. To provide this information, it needs access to smartctl and lsblk programs.

Please, add appropriate policies to the RHEL-7 and Fedora 20+.

Thanks.

Comment 2 Miroslav Grepl 2013-11-19 14:10:24 UTC
What is a path to OpenLMI Hardware provider?

Comment 3 Peter Schiffer 2013-11-19 14:16:59 UTC
It should be:
/usr/libexec/pegasus/cmpiLMI_Hardware-cimprovagt

Comment 4 Miroslav Grepl 2013-11-19 15:52:27 UTC
We probably want to add a new openlmi type using


$ cat mypol.te
policy_module(mypol,1.0)
pegasus_openlmi_domain_template(hardware)



# make -f /usr/share/selinux/devel/Makefile mypol.pp
# semodule -i mypol.pp
# chcon -t pegasus_openlmi_hardware_exec_t /usr/libexec/pegasus/cmpiLMI_Hardware-cimprovagt

re-test and collect all AVC msgs.

Comment 5 Peter Schiffer 2013-11-19 17:40:23 UTC
Created attachment 826216 [details]
avc_msgs.txt

recollected AVC msgs

Comment 6 Miroslav Grepl 2013-11-19 18:19:16 UTC
Something is wrong.

ls -lZ /usr/libexec/pegasus/cmpiLMI_Hardware-cimprovagt

Comment 7 Peter Schiffer 2013-11-20 10:43:14 UTC
# ls -lZ /usr/libexec/pegasus/cmpiLMI_Hardware-cimprovagt
-rwxr-xr-x. root root unconfined_u:object_r:pegasus_openlmi_hardware_exec_t:s0 /usr/libexec/pegasus/cmpiLMI_Hardware-cimprovagt

Comment 8 Miroslav Grepl 2013-11-21 10:12:05 UTC
Which is OK. We should not see pegasus_t but pegasus_openlmi_hardware_t.

Comment 9 Miroslav Grepl 2013-11-21 14:02:10 UTC
*** Bug 1032994 has been marked as a duplicate of this bug. ***

Comment 10 Miroslav Grepl 2013-11-21 14:04:55 UTC
Tomas,
could you try to play around the policy from the comment #4.

Comment 11 Miroslav Grepl 2013-12-09 20:44:07 UTC
Any update?

Comment 12 Peter Schiffer 2013-12-13 15:53:31 UTC
Created attachment 836360 [details]
avc.txt

Miroslav,

this is the latest avc log for the whole hardware provider (after calling all classes and associations).

Also, output of audit2allow says:

#============= pegasus_openlmi_hardware_t ==============
allow pegasus_openlmi_hardware_t dmidecode_exec_t:file { read getattr
open execute execute_no_trans };
allow pegasus_openlmi_hardware_t fixed_disk_device_t:blk_file { read
getattr open ioctl };
allow pegasus_openlmi_hardware_t fsadm_exec_t:file { read execute open
getattr execute_no_trans };
allow pegasus_openlmi_hardware_t hwdata_t:file { read getattr open };
allow pegasus_openlmi_hardware_t memory_device_t:chr_file { read open };
allow pegasus_openlmi_hardware_t self:capability sys_rawio;
allow pegasus_openlmi_hardware_t udev_var_run_t:file { read getattr open };

Do you need any other information to update selinux policy? Please don't forget we need it on both, RHEL-7 and Fedora 20+.

Thanks.

peter

Comment 13 Miroslav Grepl 2014-01-07 17:06:22 UTC
pegasus_openlmi_hardware_t is what I wanted to see.

Comment 14 Miroslav Grepl 2014-01-07 17:21:41 UTC
commit ced8c5191e38949395bec6067c371ebe40d582fc
Author: Miroslav Grepl <mgrepl>
Date:   Tue Jan 7 18:20:44 2014 +0100

    Add support for cmpiLMI_Hardware-cimprovagt provider

Comment 17 Tomas Smetana 2014-01-24 12:26:30 UTC
Sorry for the late update: I re-did the steps in comment #4:

[root@rawhide-local ~]# ls -lZ /usr/libexec/pegasus/cmpiLMI_Hardware-cimprovagt
-rwxr-xr-x. root root unconfined_u:object_r:pegasus_openlmi_hardware_exec_t:s0 /usr/libexec/pegasus/cmpiLMI_Hardware-cimprovagt

So this seems to be OK.

Comment 19 Ludek Smid 2014-06-13 13:14:51 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.