Crate shared_buffer

source ·
Expand description

Utilities for safely operating on memory shared between untrusting processes.

shared-buffer provides support for safely operating on memory buffers which are shared with another process which is untrusted. The Rust memory model assumes that only code running in the current process - and thus either trusted or generated by Rust itself - operates on a given region of memory. As a result, simply treating a region of memory to which another, untrusted process has read or write access as equivalent to normal process memory is unsafe. This crate provides the SharedBuffer type, which has methods that allow safe access to such memory.

Examples of issues that could arise if shared memory were treated as normal memory include:

  • Unintentionally leaking sensitive values to another process
  • Allowing other processes to cause an invalid sequence of memory to be interpreted as a given type

Structs

A shared region of memory.
An immutable slice into a SharedBuffer.
A mutable slice into a SharedBuffer.