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
During an internal Google unsafe Rust review of Caliptra the reviewer had a few comments about drivers/src/fips_test_hooks.rs.
As a general comment for the file, the reviewer said the safety comments on functions appear to describe the general behavior of the function (a typical doc comment) but do not specify any soundness invariants and the unsafe code inside functions is not documented/justified.
Then specifically called out the following items:
codelet byte_0 = unsafe { &mut *mut_u8 };: This is unsound: T may have uninitialized bits, and it is illegal to dereference a pointer that exposes those.
codelet soc_ifc = unsafe { SocIfcReg::new() };: There is no safety comment explaining how SocIfcReg::new's invariants are satisfied, and those invariants are not propagated to the caller.
codelet soc_ifc = unsafe { SocIfcReg::new() };: Same as above
The text was updated successfully, but these errors were encountered:
During an internal Google unsafe Rust review of Caliptra the reviewer had a few comments about
drivers/src/fips_test_hooks.rs
.As a general comment for the file, the reviewer said the safety comments on functions appear to describe the general behavior of the function (a typical doc comment) but do not specify any soundness invariants and the unsafe code inside functions is not documented/justified.
Then specifically called out the following items:
let byte_0 = unsafe { &mut *mut_u8 };
: This is unsound:T
may have uninitialized bits, and it is illegal to dereference a pointer that exposes those.let soc_ifc = unsafe { SocIfcReg::new() };
: There is no safety comment explaining howSocIfcReg::new
's invariants are satisfied, and those invariants are not propagated to the caller.let soc_ifc = unsafe { SocIfcReg::new() };
: Same as aboveThe text was updated successfully, but these errors were encountered: