Trait libafl::bolts::shmem::ShMemProvider [−][src]
pub trait ShMemProvider: Send + Clone + Default + Debug { type Mem: ShMem; fn new() -> Result<Self, Error>; fn new_map(&mut self, map_size: usize) -> Result<Self::Mem, Error>; fn from_id_and_size(
&mut self,
id: ShMemId,
size: usize
) -> Result<Self::Mem, Error>; fn from_description(
&mut self,
description: ShMemDescription
) -> Result<Self::Mem, Error> { ... } fn clone_ref(&mut self, mapping: &Self::Mem) -> Result<Self::Mem, Error> { ... } fn existing_from_env(&mut self, env_name: &str) -> Result<Self::Mem, Error> { ... } fn pre_fork(&mut self) -> Result<(), Error> { ... } fn post_fork(&mut self, _is_child: bool) -> Result<(), Error> { ... } fn release_map(&mut self, _map: &mut Self::Mem) { ... } }
Expand description
A ShMemProvider
provides access to shared maps.
They are the backbone of crate::bolts::llmp
for inter-process communication.
All you need for scaling on a new target is to implement this interface, as well as the respective ShMem
.
Associated Types
The actual shared map handed out by this ShMemProvider
.
Required methods
Create a new shared memory mapping
Provided methods
fn from_description(
&mut self,
description: ShMemDescription
) -> Result<Self::Mem, Error>
fn from_description(
&mut self,
description: ShMemDescription
) -> Result<Self::Mem, Error>
Get a mapping given a description
Create a new sharedmap reference from an existing id
and len
Reads an existing map config from env vars, then maps it
This method should be called before a fork or a thread creation event, allowing the ShMemProvider
to
get ready for a potential reset of thread specific info, and for potential reconnects.
Make sure to call Self::post_fork()
after threading!
This method should be called after a fork or after cloning/a thread creation event, allowing the ShMemProvider
to
reset thread specific info, and potentially reconnect.
Make sure to call Self::pre_fork()
before threading!
fn release_map(&mut self, _map: &mut Self::Mem)
fn release_map(&mut self, _map: &mut Self::Mem)
Release the resources associated with the given ShMem