-
Notifications
You must be signed in to change notification settings - Fork 667
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unsoundness in FdSet #1572
Milestone
Comments
taylordotfish
changed the title
Unsoundness in FdSet::insert and FdSet::remove
Unsoundness in FdSet
Oct 17, 2021
Yep, it's true. Would you be willing to submit a PR to fix it? |
Sure. Is adding bounds checking an acceptable approach, despite the minor runtime cost? |
Yes. After all, select users aren't overly concerned about the runtime cost. |
taylordotfish
added a commit
to taylordotfish/nix
that referenced
this issue
Oct 19, 2021
Ensure file descriptors are nonnegative and less than `FD_SETSIZE`. (Fixes nix-rust#1572.)
taylordotfish
added a commit
to taylordotfish/nix
that referenced
this issue
Oct 21, 2021
Ensure file descriptors are nonnegative and less than `FD_SETSIZE`. (Fixes nix-rust#1572.)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
FdSet::insert
,FdSet::remove
, andFdSet::contains
callFD_SET()
,FD_CLR()
, andFD_ISSET()
without any bounds checking, but those underlying libc functions cause undefined behavior when provided a file descriptor outside of the range0..FD_SETSIZE
.The text was updated successfully, but these errors were encountered: