Bug 581117

Summary: SELinux is preventing /usr/bin/vmnet-bridge "read write" access to device vmnet0.
Product: [Fedora] Fedora Reporter: Mijax <mijax.mijax>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 12CC: bony, dwalsh, mgrepl, pronetin
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard: setroubleshoot_trace_hash:212c639de4f34682e7a6d5fb28d3151135cd4db918a9a1581c2c486abab5f98e
Fixed In Version: selinux-policy-3.6.32-113.fc12 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-05-03 16:08:34 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 Mijax 2010-04-10 09:47:24 UTC
Summary:

SELinux is preventing /usr/bin/vmnet-bridge "read write" access to device
vmnet0.

Detailed Description:

SELinux has denied vmnet-bridge "read write" access to device vmnet0. vmnet0 is
mislabeled, this device has the default label of the /dev directory, which
should not happen. All Character and/or Block Devices should have a label. You
can attempt to change the label of the file using restorecon -v 'vmnet0'. If
this device remains labeled device_t, then this is a bug in SELinux policy.
Please file a bg report. If you look at the other similar devices labels, ls -lZ
/dev/SIMILAR, and find a type that would work for vmnet0, you can use chcon -t
SIMILAR_TYPE 'vmnet0', If this fixes the problem, you can make this permanent by
executing semanage fcontext -a -t SIMILAR_TYPE 'vmnet0' If the restorecon
changes the context, this indicates that the application that created the
device, created it without using SELinux APIs. If you can figure out which
application created the device, please file a bug report against this
application.

Allowing Access:

Attempt restorecon -v 'vmnet0' or chcon -t SIMILAR_TYPE 'vmnet0'

Additional Information:

Source Context                system_u:system_r:vmware_host_t:s0-s0:c0.c1023
Target Context                system_u:object_r:device_t:s0
Target Objects                vmnet0 [ chr_file ]
Source                        vmnet-dhcpd
Source Path                   /usr/bin/vmnet-dhcpd
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.6.32-108.fc12
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Plugin Name                   device
Host Name                     (removed)
Platform                      Linux (removed)
                              2.6.31.12-174.2.22.fc12.i686.PAE #1 SMP Fri Feb 19
                              19:10:04 UTC 2010 i686 athlon
Alert Count                   57
First Seen                    Fri 09 Apr 2010 05:28:53 PM IRDT
Last Seen                     Sat 10 Apr 2010 02:16:25 PM IRDT
Local ID                      ba815c92-bb50-4b4e-a3ae-a71deb8a9210
Line Numbers                  

Raw Audit Messages            

node=(removed) type=AVC msg=audit(1270892785.379:48): avc:  denied  { read write } for  pid=1423 comm="vmnet-bridge" name="vmnet0" dev=tmpfs ino=10691 scontext=system_u:system_r:vmware_host_t:s0-s0:c0.c1023 tcontext=system_u:object_r:device_t:s0 tclass=chr_file

node=(removed) type=SYSCALL msg=audit(1270892785.379:48): arch=40000003 syscall=5 success=no exit=-13 a0=9ea24b8 a1=8002 a2=0 a3=ffffffff items=0 ppid=1 pid=1423 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="vmnet-bridge" exe="/usr/bin/vmnet-bridge" subj=system_u:system_r:vmware_host_t:s0-s0:c0.c1023 key=(null)



Hash String generated from  device,vmnet-dhcpd,vmware_host_t,device_t,chr_file,read,write
audit2allow suggests:

#============= vmware_host_t ==============
allow vmware_host_t device_t:chr_file { read write };

Comment 1 Daniel Walsh 2010-04-11 12:26:13 UTC
Miroslav, lets add

dev_rw_generic_chr_files(vmware_host_t) to allow this.  This is really a vmware bug in that they do not create devices with the proper label.  I don't believe we have a better solution.

Mijax could you report this as a bug to vmware, although they probably know about it.  (Of course you could always try kvm. :^)

Comment 2 Daniel Walsh 2010-04-11 12:30:07 UTC
*** Bug 581120 has been marked as a duplicate of this bug. ***

Comment 3 Daniel Walsh 2010-04-11 12:30:37 UTC
*** Bug 581123 has been marked as a duplicate of this bug. ***

Comment 4 Miroslav Grepl 2010-04-13 12:18:46 UTC
Fixed in selinux-policy-3.6.32-111.fc12

Comment 5 Mijax 2010-04-17 05:16:19 UTC
I update selinux-policy but not solved and still occur this alert.

Comment 6 Miroslav Grepl 2010-04-19 06:58:34 UTC
Mijax,
did you also update selinux-policy-targeted from koji?


I am seeing

# sesearch -A -s vmware_host_t -t device_t -c chr_file -p write
Found 1 semantic av rules:
   allow vmware_host_t device_t : chr_file { ioctl read write getattr lock append open } ;

Comment 7 Fedora Update System 2010-04-23 12:43:57 UTC
selinux-policy-3.6.32-113.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/selinux-policy-3.6.32-113.fc12

Comment 8 Fedora Update System 2010-04-27 02:22:33 UTC
selinux-policy-3.6.32-113.fc12 has been pushed to the Fedora 12 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update selinux-policy'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/selinux-policy-3.6.32-113.fc12

Comment 9 Prot 2010-04-27 17:46:06 UTC
I have this problem too.
When i use 'yum update', after updating, my selinux-policy and selinux-policy-targeted is still selinux-policy-3.6.32-110.fc12.noarch & selinux-policy-targeted-3.6.32-110.fc12.noarch!!

Is there update for selinux in repository?

Comment 10 Miroslav Grepl 2010-04-27 18:00:50 UTC
Did you use updates-testing repo?

yum --enablerepo=updates-testing update selinux-policy-targeted

Comment 11 Prot 2010-04-27 18:33:31 UTC
Ok. solved after updating from testing repository.

Comment 12 Fedora Update System 2010-05-03 16:06:37 UTC
selinux-policy-3.6.32-113.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.