Bug 3410 - Since 8.9p1 MaxStartups >=1024, in sshd_config, causes "error: ppoll: Invalid argument"
Summary: Since 8.9p1 MaxStartups >=1024, in sshd_config, causes "error: ppoll: Invalid...
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: sshd (show other bugs)
Version: 8.9p1
Hardware: amd64 Linux
: P5 normal
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks: V_9_0
  Show dependency treegraph
 
Reported: 2022-03-22 01:24 AEDT by for.github.20200406
Modified: 2022-04-08 12:12 AEST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description for.github.20200406 2022-03-22 01:24:54 AEDT
Up to 8.8p1 a value of 4096 for MaxStartups in sshd_config was no problem.
Since 8.9p1 switched to usage of ppoll(2) the maximum value for MaxStartups is 1023.

Because this is default ppoll(2) behavior, the expected behavior of sshd would be:
- the documentation should be updated
- sshd -t should show MaxStartups > 1023 as problem (would have saved me some time, to identify MaxStartups as problem)
- maybe a MaxStartups > 1023 should be reduced to 1023 internally

PS: Maybe setting such a high value for MaxStartups is the wrong approach for e.g. allowing a massive threaded app access via ssh, but it was a working solution (in reality, I had a problem with ~100 unauthenticated connections, setting it to 1023 will be good enough).
Comment 1 Damien Miller 2022-03-22 10:05:52 AEDT
This was fixed shortly after release in git master and the V_8_9 stable branch:

commit 238ac091dd57316bc9690d9cc42229fe21ce0def
Author: djm@openbsd.org <djm@openbsd.org>
Date:   Tue Mar 1 01:59:19 2022 +0000

    upstream: pack pollfd array before server_accept_loop() ppoll()
    
    call, and terminate sshd if ppoll() returns errno==EINVAL
    
    avoids spin in ppoll when MaxStartups > RLIMIT_NOFILE, reported by
    Daniel Micay
    
    feedback/ok deraadt
    
    OpenBSD-Commit-ID: dbab1c24993ac977ec24d83283b8b7528f7c2c15
Comment 2 Damien Miller 2022-04-08 12:12:55 AEST
closing bug resolved during openssh-9.0 release cycle