Bug 1000791 - SELinux is preventing /usr/sbin/openvpn from 'name_bind' accesses on the tcp_socket .
SELinux is preventing /usr/sbin/openvpn from 'name_bind' accesses on the tcp_...
Product: Fedora
Classification: Fedora
Component: selinux-policy (Show other bugs)
x86_64 Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Lukas Vrabec
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2013-08-25 05:17 EDT by Hans de Goede
Modified: 2013-08-27 05:05 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-08-27 05:05:50 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Hans de Goede 2013-08-25 05:17:56 EDT
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.
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 05:19:57 EDT
This is with a fully up2date F-20 system.
Comment 2 Daniel Walsh 2013-08-26 15:41:41 EDT
 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 16:04:09 EDT
Yes, it looks Hans has the same problem with labeling.
Comment 4 Hans de Goede 2013-08-27 05:05:50 EDT
(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.

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