You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there, we (Rust group @sslab-gatech) are scanning crates on crates.io for potential soundness bugs. We noticed that in these three code locations, unsafe memory is passed to Copy::copy, Copy::copy_mat and Gemv::gemv:
Copy and Gemv are currently public and safe traits to implement, maybe they should be marked as unsafe or the individual methods that can receive undefined memory marked as unsafe.
As a consequence, zero-initializing a variable of reference type causes instantaneous undefined behavior, no matter whether that reference ever gets used to access memory
which means that just doing something like this can invoke undefined behavior:
Hi there, we (Rust group @sslab-gatech) are scanning crates on crates.io for potential soundness bugs. We noticed that in these three code locations, unsafe memory is passed to
Copy::copy
,Copy::copy_mat
andGemv::gemv
:rust-blas/src/vector/mod.rs
Lines 30 to 38 in bf6d331
rust-blas/src/math/mat.rs
Lines 121 to 123 in bf6d331
rust-blas/src/math/matrix_vector.rs
Lines 23 to 29 in bf6d331
Copy
andGemv
are currently public and safe traits to implement, maybe they should be marked as unsafe or the individual methods that can receive undefined memory marked as unsafe.Also note that the
Into<Vec<T>>
implementation can invoke undefined behavior, see https://doc.rust-lang.org/std/mem/union.MaybeUninit.html#initialization-invariantwhich means that just doing something like this can invoke undefined behavior:
The text was updated successfully, but these errors were encountered: