GHSA-gv7f-5qqh-vxfx: xous has unsound usages of `core::slice::from_raw_parts`
We consider asslice and asslicemut unsound because: the pointer with any bit patterns could be cast to the slice of arbitrary types. The pointer could be created by unsafe new and deprecated fromparts. We consider that fromparts should be removed in latest version because it will help trigger unsoundness in asslice. With new declared as unsafe, asslice should also declared as unsafe.
Published Dec 30, 2024
Affected packages
xous
- Ecosystem
- Rust (crates.io)
- Affected
- < 0.9.51
- Fixed in
- 0.9.51
- Check
cargo tree -i xous
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
We consider as_slice and as_slice_mut unsound because: the pointer with any bit patterns could be cast to the slice of arbitrary types. The pointer could be created by unsafe new and deprecated from_parts. We consider that from_parts should be removed in latest version because it will help trigger unsoundness in as_slice. With new declared as unsafe, as_slice should also declared as unsafe.
This was patched in by marking two functions as unsafe.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
