Bug 1141879

Summary: SELinux is preventing /usr/sbin/openvpn from 'read' accesses on the chr_file /dev/net/tun.
Product: [Fedora] Fedora Reporter: Michal Kovarik <mkovarik>
Component: libvirtAssignee: Michal Privoznik <mprivozn>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 21CC: agedosier, berrange, clalancette, crobinso, dominick.grift, dwalsh, itamar, jforbes, laine, libvirt-maint, lvrabec, mgrepl, mprivozn, vbenes, veillard, virt-maint
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:0f404977d1a7d88a823c1d40cb12848ef3b6e826f02cf9b736484dd9bbcb653b
Fixed In Version: libvirt-1.2.8-4.fc21 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-09-23 04:20:43 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 Michal Kovarik 2014-09-15 16:02:35 UTC
Description of problem:
Start virtual machine in virt-manager. 
SELinux is preventing /usr/sbin/openvpn from 'read' accesses on the chr_file /dev/net/tun.

*****  Plugin catchall (100. confidence) suggests   **************************

If you believe that openvpn should be allowed read access on the tun chr_file by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# grep openvpn /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:openvpn_t:s0
Target Context                system_u:object_r:svirt_image_t:s0:c277,c814
Target Objects                /dev/net/tun [ chr_file ]
Source                        openvpn
Source Path                   /usr/sbin/openvpn
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           openvpn-2.3.4-4.fc21.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-79.fc21.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 3.16.1-301.mst.fc21.x86_64 #1 SMP
                              Tue Aug 26 02:24:06 UTC 2014 x86_64 x86_64
Alert Count                   1
First Seen                    2014-09-15 17:58:01 CEST
Last Seen                     2014-09-15 17:58:01 CEST
Local ID                      2aba6d08-ad09-45de-a343-330c17fe0bcb

Raw Audit Messages
type=AVC msg=audit(1410796681.14:23085): avc:  denied  { read } for  pid=2240 comm="openvpn" path="/dev/net/tun" dev="devtmpfs" ino=154 scontext=system_u:system_r:openvpn_t:s0 tcontext=system_u:object_r:svirt_image_t:s0:c277,c814 tclass=chr_file permissive=0


type=SYSCALL msg=audit(1410796681.14:23085): arch=x86_64 syscall=read success=no exit=EACCES a0=5 a1=7f70260eba84 a2=5fc a3=7f70260dad80 items=0 ppid=1 pid=2240 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=openvpn exe=/usr/sbin/openvpn subj=system_u:system_r:openvpn_t:s0 key=(null)

Hash: openvpn,openvpn_t,svirt_image_t,chr_file,read

Version-Release number of selected component:
selinux-policy-3.13.1-79.fc21.noarch

Additional info:
reporter:       libreport-2.2.3
hashmarkername: setroubleshoot
kernel:         3.16.1-301.mst.fc21.x86_64
type:           libreport

Comment 1 Miroslav Grepl 2014-09-16 11:54:41 UTC
Did we revert changes causing these issues?

Comment 2 Cole Robinson 2014-09-16 13:14:50 UTC
Michal, has there been any ideas/progress on fixing this? I know there's a few bugs kicking around just not sure of the status

Comment 3 Cole Robinson 2014-09-18 12:43:38 UTC
*** Bug 1139662 has been marked as a duplicate of this bug. ***

Comment 4 Michal Privoznik 2014-09-18 14:20:59 UTC
Patch proposed upstream:

https://www.redhat.com/archives/libvir-list/2014-September/msg01163.html

Comment 5 Fedora Update System 2014-09-18 20:49:20 UTC
libvirt-1.2.8-4.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/libvirt-1.2.8-4.fc21

Comment 6 Fedora Update System 2014-09-19 17:44:45 UTC
Package libvirt-1.2.8-4.fc21:
* should fix your issue,
* was pushed to the Fedora 21 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing libvirt-1.2.8-4.fc21'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-11111/libvirt-1.2.8-4.fc21
then log in and leave karma (feedback).

Comment 7 Fedora Update System 2014-09-23 04:20:43 UTC
libvirt-1.2.8-4.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, please make note of it in this bug report.