Bug 1000791

Summary: SELinux is preventing /usr/sbin/openvpn from 'name_bind' accesses on the tcp_socket .
Product: [Fedora] Fedora Reporter: Hans de Goede <hdegoede>
Component: selinux-policyAssignee: Lukas Vrabec <lvrabec>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 20CC: dominick.grift, dwalsh, lvrabec, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:828f9d900b8e072907b34678ae11f88efe89e908f0bf4a0f0d8b632abe66b888
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-08-27 09:05:50 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Hans de Goede 2013-08-25 09:17:56 UTC
Description of problem:
I tried to connect to an openvpn vpn using the gnome-3 NetworkManager "applet"
SELinux is preventing /usr/sbin/openvpn from 'name_bind' accesses on the tcp_socket .

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

If you believe that openvpn should be allowed name_bind access on the  tcp_socket 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:NetworkManager_t:s0
Target Context                system_u:object_r:openvpn_port_t:s0
Target Objects                 [ tcp_socket ]
Source                        openvpn
Source Path                   /usr/sbin/openvpn
Port                          1194
Host                          (removed)
Source RPM Packages           openvpn-2.3.2-3.fc20.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.12.1-72.fc20.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Host Name                     (removed)
Platform                      Linux (removed) 3.11.0-0.rc6.git2.1.fc20.x86_64 #1
                              SMP Thu Aug 22 21:36:09 UTC 2013 x86_64 x86_64
Alert Count                   2
First Seen                    2013-08-25 11:13:31 CEST
Last Seen                     2013-08-25 11:14:39 CEST
Local ID                      5c05b587-bb57-454f-a720-3d106a08fea7

Raw Audit Messages
type=AVC msg=audit(1377422079.298:463): avc:  denied  { name_bind } for  pid=3381 comm="openvpn" src=1194 scontext=system_u:system_r:NetworkManager_t:s0 tcontext=system_u:object_r:openvpn_port_t:s0 tclass=tcp_socket


type=SYSCALL msg=audit(1377422079.298:463): arch=x86_64 syscall=bind success=yes exit=0 a0=4 a1=7f82c5b598e8 a2=10 a3=7fffc1514f74 items=0 ppid=3346 pid=3381 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 ses=4294967295 tty=(none) comm=openvpn exe=/usr/sbin/openvpn subj=system_u:system_r:NetworkManager_t:s0 key=(null)

Hash: openvpn,NetworkManager_t,openvpn_port_t,tcp_socket,name_bind

Additional info:
reporter:       libreport-2.1.6
hashmarkername: setroubleshoot
kernel:         3.11.0-0.rc6.git2.1.fc20.x86_64
type:           libreport

Potential duplicate: bug 876983

Comment 1 Hans de Goede 2013-08-25 09:19:57 UTC
This is with a fully up2date F-20 system.

Comment 2 Daniel Walsh 2013-08-26 19:41:41 UTC
 ls -lZ /usr/sbin/openvpn 


Could you try 

restorecon -R -v /usr/sbin

And see if this fixes lots of labels?

Comment 3 Miroslav Grepl 2013-08-26 20:04:09 UTC
Yes, it looks Hans has the same problem with labeling.

Comment 4 Hans de Goede 2013-08-27 09:05:50 UTC
(In reply to Daniel Walsh from comment #2)
>  ls -lZ /usr/sbin/openvpn 
> 
> 
> Could you try 
> 
> restorecon -R -v /usr/sbin
> 
> And see if this fixes lots of labels?

Ah, yes that fixes a lot of labels. Seems somehow the re-labelling when doing a yum distro-sync from F-19 -> F-20 did not happen properly. I should have known better and done a "touch /.autorelabel && reboot" when I was having selinux troubles after the upgrade, sorry about the noise.