Description
This is a tracking ticket for potential ideas for Rust security improvements to the core language and standard library to be submitted via the RFC process at https://github.com/rust-lang/rfcs
The idea here is list some potential RFC items and then coordinate who (if anybody) wants to work on them. Once we've figured that out we can go from there.
Feel free to edit the list below or request it be edited in the comments:
Secure Zeroing Intrinsic
Potential Authors: @tarcieri
Stabilize core::intrinsics::volatile_set_memory, at least for the case where val
(i.e. byte to write) is 0
, for the purposes of securely zeroizing memory.
This avoids the need to rely on OS-specific APIs/FFI or "weird tricks" to ensure secure memory zeroing operations are not optimized away.
Annotations for Overflow Behavior
Potential Authors: ???
Stabilize an annotation API similar to what the overflower crate provides on nightly Rust, with annotations like:
#[overflow(panic)]
#[overflow(wrap)]
#[overflow(saturate)]
Byte-level conversions between types
Potential Authors: @joshlf
Add traits and auto impls to the language to express the idea that, given any valid instance of T
, the bytes of that instance also constitute a valid instance of U
. Particularly useful for zero-copy parsing/serialization, SIMD, and unlocking Atomic<T>
.
An early draft that will need to be completely overhauled is here. Code which implements a subset of this concept is here.
Fixed-capacity Vec
view
Potential Authors: @Shnatsel
This is used to address a use case for appending contents of a vector to itself. This is a common pattern in decompressors of all kinds (gzip, audio, images), but people doing it in practice tend to end up with implementations that are slow, unsafe, or both. See this pre-RFC for rather in-depth info.