Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 941234 - net-misc/openssh-9.8_p1-r2 failed to rexec sshd-session
Summary: net-misc/openssh-9.8_p1-r2 failed to rexec sshd-session
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: SELinux (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: SE Linux Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-10-10 11:12 UTC by Nicolas PARLANT
Modified: 2024-10-16 14:31 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolas PARLANT 2024-10-10 11:12:01 UTC
Hi,
After upgrade to 9.8_p1-r2, sshd denied all connections with that error : 
sshd[1772]: fatal: rexec of /usr/lib64/misc/sshd-session failed: Permission denied

That policy is needed :
allow sshd_t lib_t:file execute_no_trans;
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-10-12 03:28:03 UTC
From 9.8 notes:

 * sshd(8): the server has been split into a listener binary, sshd(8),
   and a per-session binary "sshd-session". This allows for a much
   smaller listener binary, as it no longer needs to support the SSH
   protocol. As part of this work, support for disabling privilege
   separation (which previously required code changes to disable) and
   disabling re-execution of sshd(8) has been removed. Further
   separation of sshd-session into additional, minimal binaries is
   planned for the future.
Comment 2 Alexander Wetzel 2024-10-12 16:06:47 UTC
I hit the same issue, so I can second the bug.

My fix was to set /usr/lib/misc/sshd-session to bin_t (merged user installation):
# semanage fcontext -a -t bin_t /usr/lib/misc/sshd-session
# restorecon restorecon /usr/lib/misc/sshd-session

That should be better than using execute_no_trans.
Comment 3 Nicolas PARLANT 2024-10-12 16:47:36 UTC
Right, that's the trick I did too, using example from /usr/lib64/misc/sftp-server

execute_no_trans was the output of audit2allow
Comment 4 Nicolas PARLANT 2024-10-12 18:30:44 UTC
Well, everything is here thanks to 0xC0ncord, with sshd_exec_t :
https://github.com/SELinuxProject/refpolicy/pull/793
https://github.com/SELinuxProject/refpolicy/issues/797

I think/hope unstable policies fixed that.
Comment 5 Kenton Groombridge gentoo-dev 2024-10-16 13:51:38 UTC
SELinux policies 2.20240916-r1 are now stable which include the needed patch.