Fedora Account System
Red Hat Associate
Red Hat Customer
Description: On Fedora 45, SSH remote TCP forwarding to port 8080 fails when SELinux is enforcing. The same command works when SELinux is permissive. Version-Release number: Fedora 45 Workstation x86_64, running in KVM Kernel: 7.3.1-200.fc45.x86_64 selinux-policy-45.23-1.fc45.noarch openssh-server-10.5p1-1.fc45.x86_64 How reproducible: Always in this test. Steps to Reproduce: 1. Set SELinux to enforcing: setenforce 1 2. Run: ssh -R 8080:127.0.0.1:80 root@localhost 'ss -n -l -t | grep :8080' Actual Results: SSH prints: Warning: remote port forwarding failed for listen port 8080 Expected Results: The remote forward should work while SELinux is enforcing. With SELinux permissive, the same command succeeds and shows listeners on 127.0.0.1:8080 and [::1]:8080. AVC: avc: denied { name_bind } for comm=sshd-session src=8080 scontext=system_u:system_r:sshd_session_t:s0-s0:c0.c1023 tcontext=system_u:object_r:http_cache_port_t:s0 tclass=tcp_socket permissive=0 Port 8080 is labeled http_cache_port_t (semanage port -l). Related bugs: BZ 2560255: https://bugzilla.redhat.com/show_bug.cgi?id=2560255 That bug reports OpenSSH agent forwarding and Unix socket problems. This report may be related, but it is a different reproducer and AVC. BZ 2523732: https://bugzilla.redhat.com/show_bug.cgi?id=2523732 This reports another sshd_session_t forwarding denial, mainly name_connect. BZ 2526123: https://bugzilla.redhat.com/show_bug.cgi?id=2526123 This is the earlier closed SELinux forwarding bug for Fedora 44.
*** This bug has been marked as a duplicate of bug 2523732 ***