[Bug 3345] sshd freeze when build without HAVE_PSELECT

bugzilla-daemon at mindrot.org bugzilla-daemon at mindrot.org
Wed Sep 8 11:31:11 AEST 2021


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

Darren Tucker <dtucker at dtucker.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dtucker at dtucker.net

--- Comment #1 from Darren Tucker <dtucker at dtucker.net> ---
(In reply to Yaroslav from comment #0)
> In openbsd-compat/bsd-pselect.c file in pselect() function.
> 
> Line 196 incorrect call to select() function.
> If unmasked !=0 , nfds need +1

For the common case nfds should already have the 1 added by the caller,
eg in sshd.c:

    /* Wait until a connection arrives or a child exits. */
    ret = pselect(maxfd+1, fdset, NULL, NULL, NULL, &osigset);

I could see this being a problem in the case where notify_pipe[0] is
higher than any descriptor in the fdsets, in which case I think the +1
should be added to notify_pipe[0]:

          nfds = MAX(nfds, notify_pipe[0]+1);

Would that solve the problem?  Also, out of curiosity, what platform is
this (you indicated "Other")?

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


More information about the openssh-bugs mailing list