Skip to content

Add memory sanitizer (msan) support for rand::getrandom_uninit (and io::read) #1071

Description

@briansmith

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.

See rust-random/getrandom#463 for my attempt to do this directly within getrandom.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions