Bug 248256

Summary: SElinux prevents starting Xen guests
Product: [Fedora] Fedora Reporter: Felix Schwarz <felix.schwarz>
Component: selinux-policy-targetedAssignee: Daniel Walsh <dwalsh>
Status: CLOSED CURRENTRELEASE QA Contact: Ben Levenson <benl>
Severity: medium Docs Contact:
Priority: low    
Version: 7   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Current Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-08-22 14:10:31 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Felix Schwarz 2007-07-14 12:41:38 UTC
Description of problem:
On a fresh F7 system (after an additional autorelabel) SElinux prevents xen from
starting xen guests with 'xm create xenguest'.

Setroubleshoot showed these messages:
avc: denied { read, write } for comm="losetup" dev=dm-3 egid=0 euid=0
exe="/sbin/losetup" exit=-13 fsgid=0 fsuid=0 gid=0 items=0 name="el4_32_build"
pid=8929 scontext=system_u:system_r:fsadm_t:s0-s0:c0.c1023 sgid=0
subj=system_u:system_r:fsadm_t:s0-s0:c0.c1023 suid=0 tclass=file
tcontext=system_u:object_r:xen_image_t:s0 tty=(none) uid=0

avc: denied { append } for comm="losetup" dev=dm-0 egid=0 euid=0
exe="/sbin/losetup" exit=0 fsgid=0 fsuid=0 gid=0 items=0 name="xen-hotplug.log"
path="/var/log/xen/xen-hotplug.log" pid=8929
scontext=system_u:system_r:fsadm_t:s0-s0:c0.c1023 sgid=0
subj=system_u:system_r:fsadm_t:s0-s0:c0.c1023 suid=0 tclass=file
tcontext=system_u:object_r:xend_var_log_t:s0 tty=(none) uid=0


audit2allow generated these rules:
module local 1.0;

require {
        type fsadm_t;
        type udev_t;
        type xen_image_t;
        type xend_var_log_t;
        class capability sys_module;
        class file { read write append };
}

#============= fsadm_t ==============
allow fsadm_t xen_image_t:file { read write };
allow fsadm_t xend_var_log_t:file append;


Using the generated rules, I can start the guest.


Version-Release number of selected component (if applicable):
$ rpm -q selinux-policy
selinux-policy-2.6.4-26.fc7
$ rpm -q selinux-policy-targeted
selinux-policy-targeted-2.6.4-26.fc7

How reproducible:
Always

Steps to Reproduce:
0. targeted SElinux in enforcing mode
1. have a Xen guest image in /var/lib/xen/images
2. xm create xenguest
 
Actual results:
Xen guest is no started.

Expected results:
Xen guest begins to boot.

Additional info:

Comment 1 Daniel Walsh 2007-07-16 20:19:45 UTC
Fixed in selinux-policy-2.6.4-28.fc7

Comment 2 Daniel Walsh 2007-08-22 14:10:31 UTC
Closing as fixes are in the current release