Bug 1270210 - SELinux is preventing openfortivpn from read, write access on the chr_file ptmx.
SELinux is preventing openfortivpn from read, write access on the chr_file ptmx.
Status: CLOSED EOL
Product: Fedora
Classification: Fedora
Component: NetworkManager (Show other bugs)
23
x86_64 Unspecified
medium Severity medium
: ---
: ---
Assigned To: Lubomir Rintel
Fedora Extras Quality Assurance
abrt_hash:f64baff97bc81738c722d12f8a1...
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-10-09 05:47 EDT by Berend De Schouwer
Modified: 2016-12-20 09:55 EST (History)
11 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-12-20 09:55:58 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
ausearch recent (304 bytes, text/plain)
2016-02-10 05:37 EST, Berend De Schouwer
no flags Details

  None (edit)
Description Berend De Schouwer 2015-10-09 05:47:40 EDT
Description of problem:
Start a Fortisslvpn connections
SELinux is preventing openfortivpn from read, write access on the chr_file ptmx.

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

If you believe that openfortivpn should be allowed read write access on the ptmx 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 openfortivpn /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:ptmx_t:s0
Target Objects                ptmx [ chr_file ]
Source                        openfortivpn
Source Path                   openfortivpn
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-147.fc23.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 4.2.3-300.fc23.x86_64 #1 SMP Mon
                              Oct 5 15:42:54 UTC 2015 x86_64 x86_64
Alert Count                   1
First Seen                    2015-10-09 11:46:28 SAST
Last Seen                     2015-10-09 11:46:28 SAST
Local ID                      df69892a-3b2a-4002-9b14-d78dd05a954f

Raw Audit Messages
type=AVC msg=audit(1444383988.991:795): avc:  denied  { read write } for  pid=6270 comm="openfortivpn" name="ptmx" dev="devtmpfs" ino=1122 scontext=system_u:system_r:NetworkManager_t:s0 tcontext=system_u:object_r:ptmx_t:s0 tclass=chr_file permissive=0


Hash: openfortivpn,NetworkManager_t,ptmx_t,chr_file,read,write

Version-Release number of selected component:
selinux-policy-3.13.1-147.fc23.noarch

Additional info:
reporter:       libreport-2.6.2
hashmarkername: setroubleshoot
kernel:         4.2.3-300.fc23.x86_64
type:           libreport
Comment 1 Miroslav Grepl 2015-10-13 06:54:21 EDT
Does it work correctly with

# grep openfortivpn /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp
Comment 2 Berend De Schouwer 2015-10-13 07:06:21 EDT
No.

There used to be selinux policy problems, but those were fixed.

$ sudo grep openfortivpn /var/log/audit/audit.log | audit2allow -M mypol
Nothing to do


I now get (in journald)
Oct 13 13:00:48 sieve-deschouwer-co-za NetworkManager[1429]: ERROR:  forkpty: Permission denied


The VPN actually connects, and authenticated.  Then it dies because it can't open a pty.

There might be a policykit problem?  The gnome-session/gjs logs are there because it asks for a /vpn/ password, not a sudo password.

Full log:

Oct 13 13:00:33 sieve-deschouwer-co-za NetworkManager[1429]: <info>  Starting VPN service 'fortisslvpn'...
Oct 13 13:00:33 sieve-deschouwer-co-za NetworkManager[1429]: <info>  VPN service 'fortisslvpn' started (org.freedesktop.NetworkManager.fortisslvpn), PID 17725
Oct 13 13:00:33 sieve-deschouwer-co-za gnome-session[1619]: (gnome-shell:1647): Gjs-WARNING **: JS ERROR: TypeError: a._connection is null
Oct 13 13:00:33 sieve-deschouwer-co-za gnome-session[1619]: NMVPNSection<.setActiveConnections/<@resource:///org/gnome/shell/ui/status/network.js:1534
Oct 13 13:00:33 sieve-deschouwer-co-za gnome-session[1619]: NMVPNSection<.setActiveConnections@resource:///org/gnome/shell/ui/status/network.js:1533
Oct 13 13:00:33 sieve-deschouwer-co-za gnome-session[1619]: wrapper@resource:///org/gnome/gjs/modules/lang.js:169
Oct 13 13:00:33 sieve-deschouwer-co-za gnome-session[1619]: NMApplet<._syncVPNConnections@resource:///org/gnome/shell/ui/status/network.js:1822
Oct 13 13:00:33 sieve-deschouwer-co-za gnome-session[1619]: wrapper@resource:///org/gnome/gjs/modules/lang.js:169
Oct 13 13:00:33 sieve-deschouwer-co-za NetworkManager[1429]: <info>  VPN service 'fortisslvpn' appeared; activating connections
Oct 13 13:00:37 sieve-deschouwer-co-za audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=fprintd comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Oct 13 13:00:41 sieve-deschouwer-co-za NetworkManager[1429]: <info>  VPN connection 'Argility' (ConnectInteractive) reply received.
Oct 13 13:00:41 sieve-deschouwer-co-za NetworkManager[1429]: <info>  VPN plugin state changed: starting (3)
Oct 13 13:00:41 sieve-deschouwer-co-za NetworkManager[1429]: ** Message: openfortivpn started with pid 17737
Oct 13 13:00:41 sieve-deschouwer-co-za NetworkManager[1429]: <info>  VPN connection 'Argility' (Connect) reply received.
Oct 13 13:00:47 sieve-deschouwer-co-za NetworkManager[1429]: INFO:   Connected to gateway.
Oct 13 13:00:47 sieve-deschouwer-co-za NetworkManager[1429]: INFO:   Authenticated.
Oct 13 13:00:47 sieve-deschouwer-co-za NetworkManager[1429]: INFO:   Remote gateway has allocated a VPN.
Oct 13 13:00:48 sieve-deschouwer-co-za NetworkManager[1429]: ERROR:  forkpty: Permission denied
Oct 13 13:00:48 sieve-deschouwer-co-za NetworkManager[1429]: INFO:   Closed connection to gateway.
Oct 13 13:00:48 sieve-deschouwer-co-za NetworkManager[1429]: INFO:   Logged out.
Oct 13 13:00:48 sieve-deschouwer-co-za NetworkManager[1429]: <info>  VPN plugin state changed: stopped (6)
Oct 13 13:00:48 sieve-deschouwer-co-za NetworkManager[1429]: <info>  VPN plugin state change reason: unknown (0)
Oct 13 13:00:48 sieve-deschouwer-co-za NetworkManager[1429]: <warn>  error disconnecting VPN: Could not process the request because no VPN connection was active.
Comment 3 Berend De Schouwer 2015-10-13 07:09:07 EDT
There used to be AVC warnings interspersed with the NetworkManager lines.  The only remaining audit log is me running 'sudo' for 'sudo journalctl -f'
Comment 4 Berend De Schouwer 2016-02-10 04:01:03 EST
Description of problem:
Start a Forti SSL VPN connection in NetworkManager

Version-Release number of selected component:
selinux-policy-3.13.1-158.4.fc23.noarch

Additional info:
reporter:       libreport-2.6.4
hashmarkername: setroubleshoot
kernel:         4.4.0-0.rc6.git1.2.fc24.x86_64
type:           libreport
Comment 5 Berend De Schouwer 2016-02-10 04:10:54 EST
I'm getting these AVC warnings again, using F23.

Running semodule doesn't fix the problem.  selinux keeps moaning.
audit2allow says:

#!!!! This avc is allowed in the current policy
allow NetworkManager_t ptmx_t:chr_file { write read open };
Comment 6 Berend De Schouwer 2016-02-10 04:27:53 EST
setenforce 0 does work
audit2allow does not work

So I need a different selinux rule to get this client working.
Comment 7 Lukas Vrabec 2016-02-10 04:34:07 EST
Hi Berend, 
Could you reproduce the issue and after that you run:
# ausearch -m AVC -ts recent 

And attach output. 

Thank you.
Comment 8 Berend De Schouwer 2016-02-10 05:37 EST
Created attachment 1122730 [details]
ausearch recent

Output of 'ausearch -m AVC -ts recent'
Comment 9 Berend De Schouwer 2016-02-10 05:39:11 EST
I am aware it's complaining about { ioctl } and not { write read open }
Comment 10 Tom Ghyselinck 2016-03-09 02:49:17 EST
Description of problem:
1. Using GNOME NetworkManager, define the Fortinet VPN access.
2. Make a VPN connection using the fortinet VPN
3. Error


Additional info:
reporter:       libreport-2.6.4
hashmarkername: setroubleshoot
kernel:         4.4.3-300.fc23.x86_64
type:           libreport
Comment 11 redhat 2016-08-04 09:57:00 EDT
same problem as the others. my solution was to disable selinux. a fix would be fantastic :)
Comment 12 Fedora End Of Life 2016-11-24 07:44:16 EST
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '23'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 23 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.
Comment 13 Fedora End Of Life 2016-12-20 09:55:58 EST
Fedora 23 changed to end-of-life (EOL) status on 2016-12-20. Fedora 23 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

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