Bug 1058028 - SELinux is preventing /usr/bin/sshpass from read, write access on the chr_file ptmx.
Summary: SELinux is preventing /usr/bin/sshpass from read, write access on the chr_fil...
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: NetworkManager-ssh
Version: 20
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Dan Fruehauf
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:ba340d94a479fb2fc91f615e03a...
: 1058027 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-01-26 14:38 UTC by Elad Alfassa
Modified: 2015-06-29 14:46 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-06-29 14:46:25 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Elad Alfassa 2014-01-26 14:38:40 UTC
Description of problem:
This happened when I installed the NetworkManager ssh vpn plugin and set it to authenticate using password authentication.
SELinux is preventing /usr/bin/sshpass from read, write access on the chr_file ptmx.

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

If you believe that sshpass 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 sshpass /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                        sshpass
Source Path                   /usr/bin/sshpass
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           sshpass-1.05-5.fc20.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.12.1-119.fc20.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 3.12.8-300.fc20.x86_64 #1 SMP Thu
                              Jan 16 01:07:50 UTC 2014 x86_64 x86_64
Alert Count                   1
First Seen                    2014-01-26 16:37:12 IST
Last Seen                     2014-01-26 16:37:12 IST
Local ID                      310ae01b-a968-471d-b902-c975f39cd2b9

Raw Audit Messages
type=AVC msg=audit(1390747032.732:337): avc:  denied  { read write } for  pid=6678 comm="sshpass" name="ptmx" dev="devtmpfs" ino=7107 scontext=system_u:system_r:NetworkManager_t:s0 tcontext=system_u:object_r:ptmx_t:s0 tclass=chr_file


type=SYSCALL msg=audit(1390747032.732:337): arch=x86_64 syscall=open success=no exit=EACCES a0=3496f7b9d5 a1=2 a2=0 a3=8 items=0 ppid=6666 pid=6678 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 ses=4294967295 tty=(none) comm=sshpass exe=/usr/bin/sshpass subj=system_u:system_r:NetworkManager_t:s0 key=(null)

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

Additional info:
reporter:       libreport-2.1.11
hashmarkername: setroubleshoot
kernel:         3.12.8-300.fc20.x86_64
type:           libreport

Comment 1 Miroslav Grepl 2014-01-27 11:11:06 UTC
Ok, I guess it does work. Could you try to switch to permissive mode to get it working and execute

# ausearch -m avc -ts recent

Comment 2 Miroslav Grepl 2014-01-27 11:11:17 UTC
*** Bug 1058027 has been marked as a duplicate of this bug. ***

Comment 3 Elad Alfassa 2014-01-27 11:37:31 UTC
----
time->Mon Jan 27 13:35:35 2014
type=SYSCALL msg=audit(1390822535.340:244): arch=c000003e syscall=16 success=yes exit=0 a0=3 a1=5401 a2=7fff996d49c0 a3=8 items=0 ppid=7547 pid=7557 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 ses=4294967295 tty=(none) comm="sshpass" exe="/usr/bin/sshpass" subj=system_u:system_r:NetworkManager_t:s0 key=(null)
type=AVC msg=audit(1390822535.340:244): avc:  denied  { ioctl } for  pid=7557 comm="sshpass" path="/dev/ptmx" dev="devtmpfs" ino=134 scontext=system_u:system_r:NetworkManager_t:s0 tcontext=system_u:object_r:ptmx_t:s0 tclass=chr_file
----
time->Mon Jan 27 13:35:35 2014
type=SYSCALL msg=audit(1390822535.339:243): arch=c000003e syscall=2 success=yes exit=3 a0=3496f7b9d5 a1=2 a2=0 a3=8 items=0 ppid=7547 pid=7557 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 ses=4294967295 tty=(none) comm="sshpass" exe="/usr/bin/sshpass" subj=system_u:system_r:NetworkManager_t:s0 key=(null)
type=AVC msg=audit(1390822535.339:243): avc:  denied  { open } for  pid=7557 comm="sshpass" path="/dev/ptmx" dev="devtmpfs" ino=134 scontext=system_u:system_r:NetworkManager_t:s0 tcontext=system_u:object_r:ptmx_t:s0 tclass=chr_file
type=AVC msg=audit(1390822535.339:243): avc:  denied  { read write } for  pid=7557 comm="sshpass" name="ptmx" dev="devtmpfs" ino=134 scontext=system_u:system_r:NetworkManager_t:s0 tcontext=system_u:object_r:ptmx_t:s0 tclass=chr_file
----
time->Mon Jan 27 13:35:35 2014
type=SYSCALL msg=audit(1390822535.340:245): arch=c000003e syscall=2 success=yes exit=4 a0=34971bdb80 a1=102 a2=34971b8700 a3=7fd87bb0ba10 items=0 ppid=7547 pid=7557 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 ses=4294967295 tty=(none) comm="sshpass" exe="/usr/bin/sshpass" subj=system_u:system_r:NetworkManager_t:s0 key=(null)
type=AVC msg=audit(1390822535.340:245): avc:  denied  { open } for  pid=7557 comm="sshpass" path="/dev/pts/1" dev="devpts" ino=4 scontext=system_u:system_r:NetworkManager_t:s0 tcontext=system_u:object_r:devpts_t:s0 tclass=chr_file

Comment 4 Miroslav Grepl 2014-01-27 18:08:34 UTC
Does it work with

# grep sshpass /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

in enforcing mode?

Comment 5 Elad Alfassa 2014-01-27 20:27:14 UTC
Since this NetworkManager plugin doesn't seem to work even with SELinux in permissive mode, I can't really test if this policy will help. I'm closing this bug as I have no further interest in testing this plugin (I wasted 2 hours trying to get it to work with no success, I don't want to waste any more time on this).

Comment 6 Martin Cermak 2014-02-04 17:12:58 UTC
Filed bug 1061365 and since sshpass itself works fine for me in the enforcing mode, I'm reassigning this to the NetworkManager-ssh component.

Comment 7 Dan Fruehauf 2014-02-04 22:52:05 UTC
(In reply to Elad Alfassa from comment #5)
> Since this NetworkManager plugin doesn't seem to work even with SELinux in
> permissive mode, I can't really test if this policy will help. I'm closing
> this bug as I have no further interest in testing this plugin (I wasted 2
> hours trying to get it to work with no success, I don't want to waste any
> more time on this).

What didn't work?

Comment 8 Dan Fruehauf 2014-02-04 22:52:32 UTC
(In reply to Martin Cermak from comment #6)
> Filed bug 1061365 and since sshpass itself works fine for me in the
> enforcing mode, I'm reassigning this to the NetworkManager-ssh component.

Martin thanks, as said it already has a bug upstream.

Comment 9 Fedora End Of Life 2015-05-29 10:41:13 UTC
This message is a reminder that Fedora 20 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 20. 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 '20'.

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 20 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 10 Fedora End Of Life 2015-06-29 14:46:25 UTC
Fedora 20 changed to end-of-life (EOL) status on 2015-06-23. Fedora 20 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.