Bug 1140426 - SELinux is preventing /usr/sbin/openvpn from read, write access on the chr_file tun.
Summary: SELinux is preventing /usr/sbin/openvpn from read, write access on the chr_fi...
Keywords:
Status: CLOSED DUPLICATE of bug 1139646
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 21
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:d7bef0e9428267ae982197888f6...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-09-10 23:58 UTC by Adam Williamson
Modified: 2014-09-15 08:54 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-09-15 08:54:14 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1139646 0 unspecified CLOSED SELinux is preventing /usr/bin/qemu-system-x86_64 from 'ioctl' accesses on the chr_file /dev/net/tun. 2021-02-22 00:41:40 UTC

Internal Links: 1139646

Description Adam Williamson 2014-09-10 23:58:03 UTC
Description of problem:
Happens when I try to log in to the Red Hat VPN using OpenVPN via NetworkManager.
SELinux is preventing /usr/sbin/openvpn from read, write access on the chr_file tun.

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

If you believe that openvpn should be allowed read write 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:c151,c840
Target Objects                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.17.0-0.rc3.git2.2.fc22.1.x86_64
                              #1 SMP Thu Sep 4 16:43:36 UTC 2014 x86_64 x86_64
Alert Count                   1
First Seen                    2014-09-10 16:56:42 PDT
Last Seen                     2014-09-10 16:56:42 PDT
Local ID                      129c107b-ff42-4c7e-8fe2-9e60ff0a3d02

Raw Audit Messages
type=AVC msg=audit(1410393402.364:7777): avc:  denied  { read write } for  pid=21265 comm="openvpn" name="tun" dev="devtmpfs" ino=13429 scontext=system_u:system_r:openvpn_t:s0 tcontext=system_u:object_r:svirt_image_t:s0:c151,c840 tclass=chr_file permissive=0


type=SYSCALL msg=audit(1410393402.364:7777): arch=x86_64 syscall=open success=no exit=EACCES a0=7f823973efdd a1=2 a2=0 a3=0 items=0 ppid=21250 pid=21265 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,write

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.17.0-0.rc3.git2.2.fc22.1.x86_64
type:           libreport

Comment 1 Adam Williamson 2014-09-11 00:28:56 UTC
Oh, I see. This is fall-out from https://bugzilla.redhat.com/show_bug.cgi?id=1139646 , I think, which gave /dev/net/tun the svirt_image_t type.

Comment 2 Mike Ruckman 2014-09-11 00:51:13 UTC
I've confirmed this locally as well.

Workaround is the following:
# grep openvpn /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Comment 3 Robbie Harwood 2014-09-12 20:00:57 UTC
This is also preventing /usr/sbin/vpnc from doing similarly:

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

If you believe that vpnc 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 vpnc /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:vpnc_t:s0
Target Context                system_u:object_r:svirt_image_t:s0:c706,c928
Target Objects                /dev/net/tun [ chr_file ]
Source                        vpnc
Source Path                   /usr/sbin/vpnc
Port                          <Unknown>
Host                          thriss
Source RPM Packages           vpnc-0.5.3-23.svn457.fc22.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-81.fc22.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Host Name                     thriss
Platform                      Linux thriss 3.17.0-0.rc4.git3.1.fc22.x86_64 #1
                              SMP Thu Sep 11 13:17:37 UTC 2014 x86_64 x86_64
Alert Count                   56
First Seen                    2014-09-12 13:22:39 EDT
Last Seen                     2014-09-12 16:00:01 EDT
Local ID                      f5142b3c-aebd-485a-9c63-3ccdc0c2f584

Raw Audit Messages
type=AVC msg=audit(1410552001.433:828): avc:  denied  { read } for  pid=2234 comm="vpnc" path="/dev/net/tun" dev="devtmpfs" ino=14367 scontext=system_u:system_r:vpnc_t:s0 tcontext=system_u:object_r:svirt_image_t:s0:c706,c928 tclass=chr_file permissive=1


type=SYSCALL msg=audit(1410552001.433:828): arch=x86_64 syscall=read success=yes exit=168 a0=5 a1=7f85fec78708 a2=1000 a3=0 items=0 ppid=2053 pid=2234 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=vpnc exe=/usr/sbin/vpnc subj=system_u:system_r:vpnc_t:s0 key=(null)

Hash: vpnc,vpnc_t,svirt_image_t,chr_file,read

Comment 4 Miroslav Grepl 2014-09-15 08:54:14 UTC

*** This bug has been marked as a duplicate of bug 1139646 ***


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