-
Notifications
You must be signed in to change notification settings - Fork 400
xcb
connect_to_fd*
constructors unsound
#2355
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
Conversation
I've emailed @rtbo personally (they seem somewhat active on GitHub at least), let's see if they respond in the next two weeks. If not, we should go ahead and merge the advisory (please help remind me). |
Hi, |
Should be closed by rust-x-bindings/rust-xcb#283 |
That's a good point, this probably doesn't qualify as |
Sorry for not having a quicker response. I guess I can give my opinions (to be taken with a grain of salt). As long as someone can respond within a reasonable amount of time to major Maybe I am missing something, but the neither the Reference nor the Nomicon nor the FLS expressly state that calling foreign code in a way which causes undefined behavior in the foreign code (for whatever its definition of UB may be) to be undefined behavior in Rust. UB should cross FFI boundaries, because the opposite is absurd. That was my defense for calling this unsound: the POSIX standard says closing or using a file descriptor after close is UB, safe functions provided by I/O safety is in this weird place. Its main PR landed 3 years ago, but no one ever defined what constitutes UB when using a I believe the
Finally, I've made changes to the advisory now that a fixed version is out. I have still left it with no keyword and |
Thanks! |
Identifies a flaw in
xcb::Connection::connect_to_fd
andxcb::Connection::connect_to_fd_with_extensions
which allows file descriptors to be used after close and/or double closed. An issue was raised back in 2022 to mark these functions as unsafe with no additional context. I discovered this unsoundness causing problems working on a different project and reported my findings to xcb.It is unclear as to whether the project is maintained, though previously there was an issue raised as to its maintained status (see #653).
I did not put any categories or keywords. I just did not know what to put for them.