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
In order to use create a rustix backend for the getrandom crate that would pass its tests using memory sanitizer, these functions nedd to __msan_unpoison their output buffer only when they succeed, when #[cfg(sanitize = "memory")] (only available on Nightly):
rand::getrandom_uninit
,io::read
rand::getrandom_uninit is the most urgent, as people probably won't be running memory sanitizer on a kernel so old that getrandom would fall back to reading from /dev/urandom.
Do you have an example of this intrinsic being used? I'm not familiar enough with memory sanitizers to know what to do here.
I documented what LLVM libc does in src/util_syscall_linux.rs in rust-random/getrandom#463, and that PR also shows in src/linux_android.rshow to wraplibc::syscal` with it. It's not an intrinsic, but a function that is provided by memory sanitizer, and memory sanitizer itself is provided by libstd/libcore normally, but I don't know for sure if it just picks up what's in libc or whether it separately links memory sanitizer even when libc isn't available.
In order to use create a rustix backend for the
getrandom
crate that would pass its tests using memory sanitizer, these functions nedd to__msan_unpoison
their output buffer only when they succeed, when#[cfg(sanitize = "memory")]
(only available on Nightly):rand::getrandom_uninit
rand::getrandom_uninit
is the most urgent, as people probably won't be running memory sanitizer on a kernel so old thatgetrandom
would fall back to reading from/dev/urandom
.See rust-random/getrandom#463 for my attempt to do this directly within
getrandom
.The text was updated successfully, but these errors were encountered: