[Bug 3511] KbdInteractiveAuthentication and Golang goroutines scheduler

bugzilla-daemon at mindrot.org bugzilla-daemon at mindrot.org
Wed Dec 21 15:55:41 AEDT 2022


https://bugzilla.mindrot.org/show_bug.cgi?id=3511

Damien Miller <djm at mindrot.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |djm at mindrot.org

--- Comment #1 from Damien Miller <djm at mindrot.org> ---
I don't know if Go is ideal for interfacing with a C ABI running in
another process - the golang runtime makes many assumptions about the
system that may not be true when loaded into another process' address
space. In the case of sshd, some of these assumptions likely relate to
threads (OpenSSH isn't, Golang is), fork/exec (which is tricky around
threads) and sshd clobbering file descriptors using closefrom().

The way I have seen other people attempt similar things is to use a
small C shim that compiles to the loadable module that talks via a
socket to the application logic that is written in Go. This keeps most
of the code in Go but provides a clean and minimal ABI that isn't
likely to make assumptions that cause problems.

The other approach is to write the whole thing in C, C++ or Rust, each
of which are more explicit about doing things that could cause problems
elsewhere.

-- 
You are receiving this mail because:
You are watching someone on the CC list of the bug.
You are watching the assignee of the bug.


More information about the openssh-bugs mailing list