Bug 2526123 - selinux-policy update breaks SSH port forwarding
Summary: selinux-policy update breaks SSH port forwarding
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 44
Hardware: All
OS: Linux
high
high
Target Milestone: ---
Assignee: Zdenek Pytela
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2026-08-31 05:05 UTC by Peter Bieringer
Modified: 2026-10-24 06:00 UTC (History)
20 users (show)

Fixed In Version: selinux-policy-44.9-1.fc44
Clone Of:
Environment:
Last Closed: 2026-09-22 07:32:58 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github fedora-selinux selinux-policy pull 3403 0 None open Ssh use cases 2026-09-10 14:02:10 UTC

Internal Links: 2540774

Description Peter Bieringer 2026-08-31 05:05:28 UTC
selinux policy breaks SSH forwarding:

F44 since selinux-policy-44.7-1.fc44
rawhide since selinux-policy-targeted-45.9-1.fc45

Reproducible: Always

Steps to Reproduce:
selinux-policy-44.8-1.fc44.noarch

setenforce 0:

ssh localhost -R 8080:127.0.0.1:80 "ss -n -l -t | grep :8080"
LISTEN 0      128        127.0.0.1:8080       0.0.0.0:*   
LISTEN 0      128            [::1]:8080          [::]:*   

setenforce 1:

ssh localhost -R 8080:127.0.0.1:80 "ss -n -l -t | grep :8080"
Warning: remote port forwarding failed for listen port 8080


this is a follow-up of https://bugzilla.redhat.com/show_bug.cgi?id=2502040

it also affects rawhide
selinux-policy-45.15-1.fc46.noarch

Comment 1 nik 2026-09-04 08:38:25 UTC
I'm on selinux-policy-44.8-1.fc44.noarch and forwarding is broken.

I'm posting here since I'm doing something slightly less standard: forwarding a TCP port to a Unix socket in a container, and I got this:

sshd-session[5184]: error: connect to /********************/gui.sock port -2 failed: Permission denied
audit[5184]: AVC avc:  denied  { write } for  pid=5184 comm="sshd-session" name="gui.sock" dev="dm-1" ino=1049674 scontext=system_u:system_r:sshd_session_t:s0-s0:c0.c1023 tcontext=system_u:object_r:container_file_t:s0:c187,c529 tclass=sock_file permissive=0
audit[5184]: SYSCALL arch=c000003e syscall=42 success=no exit=-13 a0=6 a1=559928dc6150 a2=6e a3=0 items=0 ppid=5156 pid=5184 auid=1000 uid=1000 gid=1000 euid=1000 suid=1000 fsuid=1000 egid=1000 sgid=1000 fsgid=1000 tty=(none) ses=2 comm="sshd-session" exe="/usr/libexec/openssh/sshd-session" subj=system_u:system_r:sshd_session_t:s0-s0:c0.c1023 key=(null)

This used to work before the update.

Comment 2 Ralf Ertzinger 2026-09-04 12:57:05 UTC
Also affects using a machine as a proxy/jump host (-J/-W), which I guess is very similar to port forwarding

```
type=AVC msg=audit(1788525607.537:1602298): avc:  denied  { name_connect } for  pid=3888943 comm="sshd-session" dest=22 scontext=system_u:system_r:sshd_session_t:s0-s0:c0.c1023 tcontext=system_u:object_r:ssh_port_t:s0 tclass=tcp_socket permissive=0
```

selinux-policy-44.8-1.fc44.noarch

Comment 3 ultrafilter 2026-09-06 10:37:08 UTC
I'm still getting from VS Code:
Failed to set up dynamic port forwarding connection over SSH to the VS Code Server. ([Show log](command:opensshremotes.showLog "Show log"))
Remote SSH log
Failed to set up socket for dynamic port forward to remote port 42685: Socket closed. TCP port forwarding may be disabled, or the remote server may have crashed. See the VS Code Server log above for details.

Comment 4 ultrafilter 2026-09-13 05:05:23 UTC
I had to do the following

sudo ausearch -c 'sshd' --raw | audit2allow -M my_sshd_port
sudo semodule -i my_sshd_port.pp

as a workaround.

Comment 5 ultrafilter 2026-09-13 05:09:00 UTC
(In reply to ultrafilter from comment #4)
> I had to do the following
> 
> sudo ausearch -c 'sshd' --raw | audit2allow -M my_sshd_port
> sudo semodule -i my_sshd_port.pp
> 
> as a workaround.

cat my_sshd_port.te

module my_sshd_port 1.0;

require {
        type sshd_session_t;
        type ephemeral_port_t;
        type ssh_home_t;
        class sock_file { create unlink };
        class tcp_socket name_connect;
}

#============= sshd_session_t ==============

#!!!! This avc can be allowed using the boolean 'nis_enabled'
allow sshd_session_t ephemeral_port_t:tcp_socket name_connect;

#!!!! This avc is allowed in the current policy
allow sshd_session_t ssh_home_t:sock_file { create unlink };

Comment 6 Alex McCabe 2026-09-13 12:31:16 UTC
Adding a data point: I'm trying to connect VS Code on my local machine to Fedora Server 44, using the Remote-SSH extension in VS Code.

selinux-policy-targeted.noarch                 44.8-1.fc44

Running:

sudo ausearch -c 'sshd' --raw | audit2allow -M my_sshd_port

Generated this file, which is different from the one in #4 - every require entry in this file is in the file in #4, but #4 has entries which aren't in this file. In any case, it fixed the problem when applied.

module my_sshd_port 1.0;

require {
        type ephemeral_port_t;
        type sshd_session_t;
        class tcp_socket name_connect;
}

#============= sshd_session_t ==============

#!!!! This avc can be allowed using the boolean 'nis_enabled'
allow sshd_session_t ephemeral_port_t:tcp_socket name_connect;

Comment 7 Fedora Update System 2026-09-14 14:37:43 UTC
FEDORA-2026-1413268892 (selinux-policy-44.9-1.fc44) has been submitted as an update to Fedora 44.
https://bodhi.fedoraproject.org/updates/FEDORA-2026-1413268892

Comment 8 Fedora Update System 2026-09-15 01:42:42 UTC
FEDORA-2026-1413268892 has been pushed to the Fedora 44 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2026-1413268892`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2026-1413268892

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 9 Fedora Update System 2026-09-16 00:54:31 UTC
FEDORA-2026-1413268892 (selinux-policy-44.9-1.fc44) has been pushed to the Fedora 44 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 10 "FeRD" (Frank Dana) 2026-09-18 17:50:19 UTC
Reopening.

I jumped straight from selinux-policy-targeted-44.4 to the selinux-policy-targeted-44.9 I just installed this morning, and I'm NOW unable to make VNC connections over forwarded TCP ports using:

#!/bin/sh
export VNC_VIA_CMD='/usr/bin/ssh -f -L "$L":"$H":"$R" "$G" sleep 2'
exec /usr/bin/vncviewer localhost:1 -via $myserver

In the server's journal, I see:

Sep 18 13:22:48 setroubleshoot[139025]: SELinux is preventing /usr/libexec/openssh/sshd-session from name_connect access on the tcp_socket port 5901.
                                        
                                        *****  Plugin catchall (100. confidence) suggests   **************************
                                        
                                        If you believe that sshd-session should be allowed name_connect access on the port 5901 tcp_socket 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:
                                        # ausearch -c 'sshd-session' --raw | audit2allow -M my-sshdsession
                                        # semodule -X 300 -i my-sshdsession.pp


...Why was this potentially-disruptive change to the policy for sshd-session pushed to the active Fedora release (F44) at all? Making such a major change to the permissions config for a heavily-used service seems like the sort of thing that should be done only in rawhide, so it can be tested for the next distro release.

Comment 11 nik 2026-09-19 16:29:12 UTC
I tried selinux-policy-44.9-1.fc44, the problem I described above still persists (forwarding a TCP port to a Unix socket in a container)

Comment 12 Zdenek Pytela 2026-09-22 07:32:58 UTC
The bug as reported has been resolved. For new issues please open a new bug.

Comment 13 Peter Bieringer 2026-10-24 06:00:59 UTC
issue is returning with selinux-policy-45.22, see https://bugzilla.redhat.com/show_bug.cgi?id=2560255


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