kernel/events: Allow numFDs greater than max FDs in select().

So long as the numFDs is <= FD_SETSIZE, anyway.

Fixes #19220.
This commit is contained in:
Augustin Cavalier 2024-11-01 23:42:02 -04:00
parent 7ee61327ce
commit 4ec199c6dc

View File

@ -968,7 +968,7 @@ _user_select(int numFDs, fd_set *userReadSet, fd_set *userWriteSet,
timeout = B_INFINITE_TIMEOUT;
}
if (numFDs < 0 || !check_max_fds(numFDs))
if (numFDs < 0 || (numFDs > FD_SETSIZE && !check_max_fds(numFDs)))
return B_BAD_VALUE;
if ((userReadSet != NULL && !IS_USER_ADDRESS(userReadSet))