-
Notifications
You must be signed in to change notification settings - Fork 169
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
AtomicBucket<T> unconditionally implements Send/Sync #190
Comments
@JOE1994 Admittedly, I wasn't ever able to get the test case to hit the segfault. #191 should take care of this by constraining Really appreciate you filing this issue. Out of curiosity, what heuristic was used to discovered the code in this case? Just looking for unconstrained trait impls? |
@tobz Thank you for your prompt feedback!
Yes, we look for unconstrained trait impls to discover such cases :) |
May I ask if you could publish a minor release with the fix? Thank you :) |
I think we can cut a minor release soon, yeah. There's a few big changes since the last releases so we just need to do a little bit of coordination. I'll open another issue around cutting a release so I don't forget. |
New releases including the fix have been cut: #201 |
Hello,
we (Rust group @sslab-gatech) found a memory-safety/soundness issue in this crate while scanning Rust code on crates.io for potential vulnerabilities.
Issue Description
AtomicBucket<T>
automatically implements Send/Sync unconditionally, due to the fact thatBlock<T>
unconditionally implements Send/Sync.Unconditional impl of
Sync
allows users to create data race toT: !Sync
by using theAtomicBucket::data_with
API to concurrently access&T
from multiple threads.Unconditional impl of
Send
allows users to sendT: !Send
to another thread by pushingT
toAtomicBucket<T>
and then moving it to another thread.This issue exists in older versions too (v0.4.0-alpha.1),
but I used the newer version of the crate (v0.6.2) in the poc below,
as the older version fails to build on my pc at the moment..
Reproduction
Below is an example program that exhibits undefined behavior using safe APIs of
metrics-util
.Show Detail
Output:
Tested Environment
The text was updated successfully, but these errors were encountered: