| Summary: | KbdInteractiveAuthentication and Golang goroutines scheduler | ||
|---|---|---|---|
| Product: | Portable OpenSSH | Reporter: | krasnovu |
| Component: | PAM support | Assignee: | Assigned to nobody <unassigned-bugs> |
| Status: | CLOSED INVALID | ||
| Severity: | normal | CC: | djm |
| Priority: | P5 | ||
| Version: | 9.1p1 | ||
| Hardware: | amd64 | ||
| OS: | Linux | ||
|
Description
krasnovu
2022-12-20 20:41:36 AEDT
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. (In reply to Damien Miller from comment #1) Thanks for the recommendations, Damien! OpenSSH 9.3 has been released. Close resolved bugs |