-
Notifications
You must be signed in to change notification settings - Fork 2
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
Demuxer
can carry non-Send types across thread boundaries
#4
Comments
Hello! |
vany-egorov
pushed a commit
that referenced
this issue
Jan 21, 2021
Thank you for accepting the fix 👍 |
No problem :) New release uploaded. Thanks! |
This was referenced Jan 21, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello 🦀 , we (Rust group @sslab-gatech) found an undefined-behavior issue in this crate while scanning Rust code on crates.io for potential vulnerabilities.
Issue
Send
is unconditionally implemented forDemuxer
, so that it is possible for a non-Send implementor ofDemuxerEvents
trait to be sent across thread boundaries.Proof of Concept
Here is a simple program where
Demuxer
is used to move aMutexGuard
(!Send
object) to another thread.It is also possible to create data races by inserting non-Send types like
Rc
orCell
intoDemuxer
(which is not demonstrated in the example code below).
Suggested Fix
Adding a trait bound
T: Send
as below will allow the compiler to preventDemuxer
from moving!Send
types across thread boundaries.Thank you for reviewing this issue 👍
The text was updated successfully, but these errors were encountered: