Closed JOE1994 closed 3 years ago
Cool! Thanks for discovering. I guess it's a first for everyone when someone else discovers an unsoundness issue in your own code ;-)
I believe the commit referenced above resolves the issue. Would you mind reviewing it and reopen it in case you disagree? Thanks!
The fix looks good to me :+1: Thank you for your feedback!
Hello 🦀 , while scanning crates.io, we (Rust group @sslab-gatech) have noticed a soundness/memory safety issue in this crate which allows safe Rust code to trigger undefined behavior.
Issue
It is possible to make
ARefss
contain a non-Send
/ non-Sync
object, since there is noSend + Sync
bound onV
in theARefss::map()
function.Proof of Concept
I wrote a short program that can trigger undefined behavior in safe Rust using this crate.
Test environment
reffers-0.6.0
rustc 1.47.0 (18bf6b4f0 2020-10-07)
release
mode.Error message from the program
Thank you for checking out this issue 🦀