Bug 379571 - SSH can't use the -R option
SSH can't use the -R option
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: selinux-policy-targeted (Show other bugs)
8
All Linux
low Severity low
: ---
: ---
Assigned To: Daniel Walsh
Ben Levenson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-11-13 04:24 EST by Aurelien Bompard
Modified: 2008-01-30 14:06 EST (History)
0 users

See Also:
Fixed In Version: Current
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-01-30 14:06:19 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)

  None (edit)
Description Aurelien Bompard 2007-11-13 04:24:21 EST
Description of problem:

The -R option of ssh allows it to open a listening TCP port on the server, which
would be tunnelled back to the client. Please look at the -R option in the ssh
man page for more info, it is well described there.
The targeted policy as in package selinux-policy-targeted-3.0.8-47.fc8 prevents
the server from listening on the specified port (which could be any port), so I
had to add the following semodule to re-enable this feature :
-------------------------------------
module sshanyport 1.0;

require {
        type sshd_t;
        type port_t;
        class tcp_socket name_bind;
}

#============= sshd_t ==============
allow sshd_t port_t:tcp_socket name_bind;
-------------------------------------

Please add it to the default policy, or make it tunable by a boolean.

Thanks.

How reproducible:
Always

Steps to Reproduce:
1. ssh -R2222:127.0.0.1:22 user@server
2. watch it fail on the client and on the server with the following AVC:

type=AVC msg=audit(1194894279.908:1794): avc:  denied  { name_bind } for 
pid=14773 comm="sshd" src=2222 scontext=system_u:system_r:sshd_t:s0-s0:c0.c1023
tcontext=system_u:object_r:port_t:s0 tclass=tcp_socket
Comment 1 Daniel Walsh 2007-11-13 15:06:55 EST
Fixed in selinux-policy-3.0.8-54.fc8
Comment 2 Daniel Walsh 2008-01-30 14:06:19 EST
Bulk closing a old selinux policy bugs that were in the modified state.  If the
bug is still not fixed.  Please reopen.

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