-
Notifications
You must be signed in to change notification settings - Fork 85
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
Unsound implementation in MemoryRange::as_slice/as_slice_mut
#410
Comments
Nobody seems to be using The call to |
@xobs yes. I think we can remind the user who combines the usage of |
I think that a better API would have been to turn a |
I created #411 to address this issue. |
this got merged, so i think we can close this issue? |
The source of unsoundness
xous-core/xous-rs/src/definitions.rs
Lines 318 to 324 in f17ce55
We consider
as_slice
unsound because: at line 324, the pointer with any bit patterns could be cast to the slice of arbitrary types. The pointer could be created by unsafenew
and deprecatedfrom_parts
. We consider thatfrom_parts
should be removed in latest version because it will help trigger unsoundness inas_slice
. Withnew
declared as unsafe,as_slice
should also declared as unsafe.To reproduce the bug
to run with miri,
The text was updated successfully, but these errors were encountered: