-
Notifications
You must be signed in to change notification settings - Fork 653
MappedMutexGuard Send/Sync bound is unsound #2239
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
Comments
taiki-e
added a commit
to taiki-e/futures-rs
that referenced
this issue
Oct 23, 2020
Good catch! Filed #2240 to fix this. |
taiki-e
added a commit
that referenced
this issue
Oct 23, 2020
umanwizard
added a commit
to umanwizard/materialize-1
that referenced
this issue
Oct 31, 2020
This was referenced Apr 16, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello, we have noticed a soundness/memory safety issue in this crate which allows safe Rust code to trigger undefined behavior while scanning crates.io.
futures-rs/futures-util/src/lock/mutex.rs
Lines 404 to 405 in 7340d3d
Description
Send/Sync implementation for MappedMutexGuard only considers variance on T, while MappedMutexGuard dereferences to U.
This can lead to data race in safe Rust code when a closure used in
MutexGuard::map()
returns U that is unrelated to T.Demonstration
Output:
Return Code: 101
The text was updated successfully, but these errors were encountered: