Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add memory sanitizer support #521

Merged
merged 3 commits into from
Oct 16, 2024
Merged

Add memory sanitizer support #521

merged 3 commits into from
Oct 16, 2024

Conversation

newpavlov
Copy link
Member

Add new getrandom_sanitize flag which enables unpoisoning of buffer passed to getrandom_uninit.

@@ -474,7 +486,20 @@ pub fn getrandom_uninit(dest: &mut [MaybeUninit<u8>]) -> Result<&mut [u8], Error
if !dest.is_empty() {
imp::getrandom_inner(dest)?;
}

#[cfg(getrandom_sanitize)]
#[cfg(sanitize = "memory")]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#[cfg(sanitize = "memory")] requires Nightly compiler and enabled cfg_sanitize feature, so it's gated behind getrandom_sanitize instead of being used directly.

@newpavlov newpavlov merged commit f622215 into master Oct 16, 2024
57 checks passed
@newpavlov newpavlov deleted the msan_support branch October 16, 2024 06:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant