No Uses* from fuzzer
(#2761)
* go * fixing stuf * hello from windows * more * lolg * lolf * fix * a --------- Co-authored-by: Your Name <you@example.com>
This commit is contained in:
parent
afc02ee3c2
commit
cc442f4dc8
@ -53,13 +53,12 @@ impl<EM, S, Z> Executor<EM, Z> for CustomExecutor<S>
|
|||||||
where
|
where
|
||||||
EM: UsesState<State = S>,
|
EM: UsesState<State = S>,
|
||||||
S: State + HasExecutions,
|
S: State + HasExecutions,
|
||||||
Z: UsesState<State = S>,
|
|
||||||
Self::Input: HasTargetBytes,
|
Self::Input: HasTargetBytes,
|
||||||
{
|
{
|
||||||
fn run_target(
|
fn run_target(
|
||||||
&mut self,
|
&mut self,
|
||||||
_fuzzer: &mut Z,
|
_fuzzer: &mut Z,
|
||||||
state: &mut Self::State,
|
state: &mut S,
|
||||||
_mgr: &mut EM,
|
_mgr: &mut EM,
|
||||||
input: &Self::Input,
|
input: &Self::Input,
|
||||||
) -> Result<ExitKind, libafl::Error> {
|
) -> Result<ExitKind, libafl::Error> {
|
||||||
|
@ -312,9 +312,8 @@ impl<M: Monitor> Instance<'_, M> {
|
|||||||
stages: &mut ST,
|
stages: &mut ST,
|
||||||
) -> Result<(), Error>
|
) -> Result<(), Error>
|
||||||
where
|
where
|
||||||
Z: Fuzzer<E, ClientMgr<M>, ST>
|
Z: Fuzzer<E, ClientMgr<M>, ClientState, ST>
|
||||||
+ UsesState<State = ClientState>
|
+ Evaluator<E, ClientMgr<M>, BytesInput, ClientState>,
|
||||||
+ Evaluator<E, ClientMgr<M>, State = ClientState>,
|
|
||||||
E: UsesState<State = ClientState>,
|
E: UsesState<State = ClientState>,
|
||||||
ST: StagesTuple<E, ClientMgr<M>, ClientState, Z>,
|
ST: StagesTuple<E, ClientMgr<M>, ClientState, Z>,
|
||||||
{
|
{
|
||||||
|
@ -357,7 +357,6 @@ pub enum SupportedExecutors<S, OT, FSV> {
|
|||||||
impl<S, OT, FSV, EM, Z> Executor<EM, Z> for SupportedExecutors<S, OT, FSV>
|
impl<S, OT, FSV, EM, Z> Executor<EM, Z> for SupportedExecutors<S, OT, FSV>
|
||||||
where
|
where
|
||||||
S: State,
|
S: State,
|
||||||
Z: UsesState<State = S>,
|
|
||||||
EM: UsesState<State = S>,
|
EM: UsesState<State = S>,
|
||||||
FSV: Executor<EM, Z, State = S>,
|
FSV: Executor<EM, Z, State = S>,
|
||||||
{
|
{
|
||||||
|
@ -22,7 +22,7 @@ use libafl::{
|
|||||||
CaptureTimeoutFeedback, ConstFeedback, CrashFeedback, MaxMapFeedback, TimeFeedback,
|
CaptureTimeoutFeedback, ConstFeedback, CrashFeedback, MaxMapFeedback, TimeFeedback,
|
||||||
},
|
},
|
||||||
fuzzer::StdFuzzer,
|
fuzzer::StdFuzzer,
|
||||||
inputs::{BytesInput, NopTargetBytesConverter},
|
inputs::{BytesInput, NopTargetBytesConverter, UsesInput},
|
||||||
mutators::{havoc_mutations, tokens_mutations, AFLppRedQueen, StdScheduledMutator, Tokens},
|
mutators::{havoc_mutations, tokens_mutations, AFLppRedQueen, StdScheduledMutator, Tokens},
|
||||||
observers::{CanTrack, HitcountsMapObserver, StdMapObserver, TimeObserver},
|
observers::{CanTrack, HitcountsMapObserver, StdMapObserver, TimeObserver},
|
||||||
schedulers::{
|
schedulers::{
|
||||||
@ -38,7 +38,6 @@ use libafl::{
|
|||||||
},
|
},
|
||||||
state::{
|
state::{
|
||||||
HasCorpus, HasCurrentTestcase, HasExecutions, HasLastReportTime, HasStartTime, StdState,
|
HasCorpus, HasCurrentTestcase, HasExecutions, HasLastReportTime, HasStartTime, StdState,
|
||||||
UsesState,
|
|
||||||
},
|
},
|
||||||
Error, Fuzzer, HasFeedback, HasMetadata, SerdeAny,
|
Error, Fuzzer, HasFeedback, HasMetadata, SerdeAny,
|
||||||
};
|
};
|
||||||
@ -649,20 +648,19 @@ pub fn fuzzer_target_mode(opt: &Opt) -> Cow<'static, str> {
|
|||||||
#[derive(Debug, Serialize, Deserialize, SerdeAny)]
|
#[derive(Debug, Serialize, Deserialize, SerdeAny)]
|
||||||
pub struct IsInitialCorpusEntryMetadata {}
|
pub struct IsInitialCorpusEntryMetadata {}
|
||||||
|
|
||||||
pub fn run_fuzzer_with_stages<Z, ST, E, EM>(
|
pub fn run_fuzzer_with_stages<E, EM, S, ST, Z>(
|
||||||
opt: &Opt,
|
opt: &Opt,
|
||||||
fuzzer: &mut Z,
|
fuzzer: &mut Z,
|
||||||
stages: &mut ST,
|
stages: &mut ST,
|
||||||
executor: &mut E,
|
executor: &mut E,
|
||||||
state: &mut <Z as UsesState>::State,
|
state: &mut S,
|
||||||
mgr: &mut EM,
|
mgr: &mut EM,
|
||||||
) -> Result<(), Error>
|
) -> Result<(), Error>
|
||||||
where
|
where
|
||||||
Z: Fuzzer<E, EM, ST>,
|
Z: Fuzzer<E, EM, S, ST>,
|
||||||
E: UsesState<State = Z::State>,
|
EM: ProgressReporter<State = S>,
|
||||||
EM: ProgressReporter<State = Z::State>,
|
ST: StagesTuple<E, EM, S, Z>,
|
||||||
ST: StagesTuple<E, EM, Z::State, Z>,
|
S: HasLastReportTime + HasExecutions + HasMetadata + UsesInput,
|
||||||
<Z as UsesState>::State: HasLastReportTime + HasExecutions + HasMetadata,
|
|
||||||
{
|
{
|
||||||
if opt.bench_just_one {
|
if opt.bench_just_one {
|
||||||
fuzzer.fuzz_loop_for(stages, executor, state, mgr, 1)?;
|
fuzzer.fuzz_loop_for(stages, executor, state, mgr, 1)?;
|
||||||
|
@ -77,7 +77,7 @@ where
|
|||||||
E::Observers: ObserversTuple<E::Input, E::State>,
|
E::Observers: ObserversTuple<E::Input, E::State>,
|
||||||
CS: Scheduler<E::Input, E::State> + RemovableScheduler<E::Input, E::State>,
|
CS: Scheduler<E::Input, E::State> + RemovableScheduler<E::Input, E::State>,
|
||||||
EM: EventFirer<State = E::State>,
|
EM: EventFirer<State = E::State>,
|
||||||
Z: HasScheduler<Scheduler = CS, State = E::State>,
|
Z: HasScheduler<E::Input, E::State, Scheduler = CS>,
|
||||||
{
|
{
|
||||||
// don't delete this else it won't work after restart
|
// don't delete this else it won't work after restart
|
||||||
let current = *state.corpus().current();
|
let current = *state.corpus().current();
|
||||||
|
@ -30,6 +30,7 @@ use crate::events::llmp::COMPRESS_THRESHOLD;
|
|||||||
#[cfg(feature = "scalability_introspection")]
|
#[cfg(feature = "scalability_introspection")]
|
||||||
use crate::state::HasScalabilityMonitor;
|
use crate::state::HasScalabilityMonitor;
|
||||||
use crate::{
|
use crate::{
|
||||||
|
corpus::Corpus,
|
||||||
events::{
|
events::{
|
||||||
AdaptiveSerializer, CustomBufEventResult, Event, EventConfig, EventFirer, EventManager,
|
AdaptiveSerializer, CustomBufEventResult, Event, EventConfig, EventFirer, EventManager,
|
||||||
EventManagerHooksTuple, EventManagerId, EventProcessor, EventRestarter,
|
EventManagerHooksTuple, EventManagerId, EventProcessor, EventRestarter,
|
||||||
@ -39,7 +40,7 @@ use crate::{
|
|||||||
fuzzer::{EvaluatorObservers, ExecutionProcessor},
|
fuzzer::{EvaluatorObservers, ExecutionProcessor},
|
||||||
inputs::{Input, NopInput, UsesInput},
|
inputs::{Input, NopInput, UsesInput},
|
||||||
observers::{ObserversTuple, TimeObserver},
|
observers::{ObserversTuple, TimeObserver},
|
||||||
state::{HasExecutions, HasLastReportTime, NopState, State, Stoppable, UsesState},
|
state::{HasCorpus, HasExecutions, HasLastReportTime, NopState, State, Stoppable, UsesState},
|
||||||
Error, HasMetadata,
|
Error, HasMetadata,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -49,8 +50,8 @@ pub(crate) const _LLMP_TAG_TO_MAIN: Tag = Tag(0x3453453);
|
|||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct CentralizedEventManager<EM, EMH, S, SP>
|
pub struct CentralizedEventManager<EM, EMH, S, SP>
|
||||||
where
|
where
|
||||||
EM: UsesState,
|
EM: UsesState<State = S>,
|
||||||
EMH: EventManagerHooksTuple<EM::State>,
|
EMH: EventManagerHooksTuple<S>,
|
||||||
S: State,
|
S: State,
|
||||||
SP: ShMemProvider,
|
SP: ShMemProvider,
|
||||||
{
|
{
|
||||||
@ -114,8 +115,8 @@ impl CentralizedEventManagerBuilder {
|
|||||||
time_obs: Option<Handle<TimeObserver>>,
|
time_obs: Option<Handle<TimeObserver>>,
|
||||||
) -> Result<CentralizedEventManager<EM, EMH, S, SP>, Error>
|
) -> Result<CentralizedEventManager<EM, EMH, S, SP>, Error>
|
||||||
where
|
where
|
||||||
EM: UsesState,
|
EM: UsesState<State = S>,
|
||||||
EMH: EventManagerHooksTuple<EM::State>,
|
EMH: EventManagerHooksTuple<S>,
|
||||||
S: State,
|
S: State,
|
||||||
SP: ShMemProvider,
|
SP: ShMemProvider,
|
||||||
{
|
{
|
||||||
@ -135,7 +136,6 @@ impl CentralizedEventManagerBuilder {
|
|||||||
///
|
///
|
||||||
/// If the port is not yet bound, it will act as a broker; otherwise, it
|
/// If the port is not yet bound, it will act as a broker; otherwise, it
|
||||||
/// will act as a client.
|
/// will act as a client.
|
||||||
#[cfg(feature = "std")]
|
|
||||||
pub fn build_on_port<EM, EMH, S, SP>(
|
pub fn build_on_port<EM, EMH, S, SP>(
|
||||||
self,
|
self,
|
||||||
inner: EM,
|
inner: EM,
|
||||||
@ -145,8 +145,8 @@ impl CentralizedEventManagerBuilder {
|
|||||||
time_obs: Option<Handle<TimeObserver>>,
|
time_obs: Option<Handle<TimeObserver>>,
|
||||||
) -> Result<CentralizedEventManager<EM, EMH, S, SP>, Error>
|
) -> Result<CentralizedEventManager<EM, EMH, S, SP>, Error>
|
||||||
where
|
where
|
||||||
EM: UsesState,
|
EM: UsesState<State = S>,
|
||||||
EMH: EventManagerHooksTuple<EM::State>,
|
EMH: EventManagerHooksTuple<S>,
|
||||||
S: State,
|
S: State,
|
||||||
SP: ShMemProvider,
|
SP: ShMemProvider,
|
||||||
{
|
{
|
||||||
@ -165,7 +165,6 @@ impl CentralizedEventManagerBuilder {
|
|||||||
|
|
||||||
/// If a client respawns, it may reuse the existing connection, previously
|
/// If a client respawns, it may reuse the existing connection, previously
|
||||||
/// stored by [`LlmpClient::to_env()`].
|
/// stored by [`LlmpClient::to_env()`].
|
||||||
#[cfg(feature = "std")]
|
|
||||||
pub fn build_existing_client_from_env<EM, EMH, S, SP>(
|
pub fn build_existing_client_from_env<EM, EMH, S, SP>(
|
||||||
self,
|
self,
|
||||||
inner: EM,
|
inner: EM,
|
||||||
@ -175,8 +174,8 @@ impl CentralizedEventManagerBuilder {
|
|||||||
time_obs: Option<Handle<TimeObserver>>,
|
time_obs: Option<Handle<TimeObserver>>,
|
||||||
) -> Result<CentralizedEventManager<EM, EMH, S, SP>, Error>
|
) -> Result<CentralizedEventManager<EM, EMH, S, SP>, Error>
|
||||||
where
|
where
|
||||||
EM: UsesState,
|
EM: UsesState<State = S>,
|
||||||
EMH: EventManagerHooksTuple<EM::State>,
|
EMH: EventManagerHooksTuple<S>,
|
||||||
S: State,
|
S: State,
|
||||||
SP: ShMemProvider,
|
SP: ShMemProvider,
|
||||||
{
|
{
|
||||||
@ -193,7 +192,6 @@ impl CentralizedEventManagerBuilder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Create an existing client from description
|
/// Create an existing client from description
|
||||||
#[cfg(feature = "std")]
|
|
||||||
pub fn existing_client_from_description<EM, EMH, S, SP>(
|
pub fn existing_client_from_description<EM, EMH, S, SP>(
|
||||||
self,
|
self,
|
||||||
inner: EM,
|
inner: EM,
|
||||||
@ -203,8 +201,8 @@ impl CentralizedEventManagerBuilder {
|
|||||||
time_obs: Option<Handle<TimeObserver>>,
|
time_obs: Option<Handle<TimeObserver>>,
|
||||||
) -> Result<CentralizedEventManager<EM, EMH, S, SP>, Error>
|
) -> Result<CentralizedEventManager<EM, EMH, S, SP>, Error>
|
||||||
where
|
where
|
||||||
EM: UsesState,
|
EM: UsesState<State = S>,
|
||||||
EMH: EventManagerHooksTuple<EM::State>,
|
EMH: EventManagerHooksTuple<S>,
|
||||||
S: State,
|
S: State,
|
||||||
SP: ShMemProvider,
|
SP: ShMemProvider,
|
||||||
{
|
{
|
||||||
@ -222,8 +220,8 @@ impl CentralizedEventManagerBuilder {
|
|||||||
}
|
}
|
||||||
impl<EM, EMH, S, SP> UsesState for CentralizedEventManager<EM, EMH, S, SP>
|
impl<EM, EMH, S, SP> UsesState for CentralizedEventManager<EM, EMH, S, SP>
|
||||||
where
|
where
|
||||||
EM: UsesState,
|
EM: UsesState<State = S>,
|
||||||
EMH: EventManagerHooksTuple<EM::State>,
|
EMH: EventManagerHooksTuple<S>,
|
||||||
S: State,
|
S: State,
|
||||||
SP: ShMemProvider,
|
SP: ShMemProvider,
|
||||||
{
|
{
|
||||||
@ -232,8 +230,8 @@ where
|
|||||||
|
|
||||||
impl<EM, EMH, S, SP> AdaptiveSerializer for CentralizedEventManager<EM, EMH, S, SP>
|
impl<EM, EMH, S, SP> AdaptiveSerializer for CentralizedEventManager<EM, EMH, S, SP>
|
||||||
where
|
where
|
||||||
EM: AdaptiveSerializer + UsesState,
|
EM: AdaptiveSerializer + UsesState<State = S>,
|
||||||
EMH: EventManagerHooksTuple<EM::State>,
|
EMH: EventManagerHooksTuple<S>,
|
||||||
S: State,
|
S: State,
|
||||||
SP: ShMemProvider,
|
SP: ShMemProvider,
|
||||||
{
|
{
|
||||||
@ -270,9 +268,10 @@ where
|
|||||||
|
|
||||||
impl<EM, EMH, S, SP> EventFirer for CentralizedEventManager<EM, EMH, S, SP>
|
impl<EM, EMH, S, SP> EventFirer for CentralizedEventManager<EM, EMH, S, SP>
|
||||||
where
|
where
|
||||||
EM: AdaptiveSerializer + EventFirer + HasEventManagerId,
|
EM: AdaptiveSerializer + EventFirer<State = S> + HasEventManagerId,
|
||||||
EMH: EventManagerHooksTuple<EM::State>,
|
EMH: EventManagerHooksTuple<S>,
|
||||||
S: State,
|
S: State + HasCorpus,
|
||||||
|
S::Corpus: Corpus<Input = S::Input>,
|
||||||
SP: ShMemProvider,
|
SP: ShMemProvider,
|
||||||
{
|
{
|
||||||
fn should_send(&self) -> bool {
|
fn should_send(&self) -> bool {
|
||||||
@ -342,8 +341,8 @@ where
|
|||||||
|
|
||||||
impl<EM, EMH, S, SP> EventRestarter for CentralizedEventManager<EM, EMH, S, SP>
|
impl<EM, EMH, S, SP> EventRestarter for CentralizedEventManager<EM, EMH, S, SP>
|
||||||
where
|
where
|
||||||
EM: EventRestarter,
|
EM: EventRestarter<State = S>,
|
||||||
EMH: EventManagerHooksTuple<EM::State>,
|
EMH: EventManagerHooksTuple<S>,
|
||||||
S: State,
|
S: State,
|
||||||
SP: ShMemProvider,
|
SP: ShMemProvider,
|
||||||
{
|
{
|
||||||
@ -368,17 +367,18 @@ where
|
|||||||
|
|
||||||
impl<E, EM, EMH, S, SP, Z> EventProcessor<E, Z> for CentralizedEventManager<EM, EMH, S, SP>
|
impl<E, EM, EMH, S, SP, Z> EventProcessor<E, Z> for CentralizedEventManager<EM, EMH, S, SP>
|
||||||
where
|
where
|
||||||
EM: AdaptiveSerializer + EventProcessor<E, Z> + EventFirer + HasEventManagerId,
|
EM: AdaptiveSerializer + EventProcessor<E, Z> + EventFirer<State = S> + HasEventManagerId,
|
||||||
EMH: EventManagerHooksTuple<EM::State>,
|
EMH: EventManagerHooksTuple<S>,
|
||||||
E: HasObservers + Executor<Self, Z, State = Self::State>,
|
E: HasObservers + Executor<Self, Z, State = Self::State>,
|
||||||
E::Observers:
|
E::Observers:
|
||||||
ObserversTuple<<Self as UsesInput>::Input, <Self as UsesState>::State> + Serialize,
|
ObserversTuple<<Self as UsesInput>::Input, <Self as UsesState>::State> + Serialize,
|
||||||
for<'a> E::Observers: Deserialize<'a>,
|
for<'a> E::Observers: Deserialize<'a>,
|
||||||
S: State,
|
S: State + HasCorpus,
|
||||||
|
S::Corpus: Corpus<Input = S::Input>,
|
||||||
Self::State: HasExecutions + HasMetadata,
|
Self::State: HasExecutions + HasMetadata,
|
||||||
SP: ShMemProvider,
|
SP: ShMemProvider,
|
||||||
Z: EvaluatorObservers<Self, E::Observers, State = Self::State>
|
Z: EvaluatorObservers<E, Self, <S::Corpus as Corpus>::Input, S>
|
||||||
+ ExecutionProcessor<Self, E::Observers, State = Self::State>,
|
+ ExecutionProcessor<Self, <S::Corpus as Corpus>::Input, E::Observers, S>,
|
||||||
{
|
{
|
||||||
fn process(
|
fn process(
|
||||||
&mut self,
|
&mut self,
|
||||||
@ -408,20 +408,21 @@ where
|
|||||||
E::Observers:
|
E::Observers:
|
||||||
ObserversTuple<<Self as UsesInput>::Input, <Self as UsesState>::State> + Serialize,
|
ObserversTuple<<Self as UsesInput>::Input, <Self as UsesState>::State> + Serialize,
|
||||||
for<'a> E::Observers: Deserialize<'a>,
|
for<'a> E::Observers: Deserialize<'a>,
|
||||||
EM: AdaptiveSerializer + EventManager<E, Z>,
|
EM: AdaptiveSerializer + EventManager<E, Z, State = S>,
|
||||||
EM::State: HasExecutions + HasMetadata + HasLastReportTime,
|
EM::State: HasExecutions + HasMetadata + HasLastReportTime,
|
||||||
EMH: EventManagerHooksTuple<EM::State>,
|
EMH: EventManagerHooksTuple<S>,
|
||||||
S: State,
|
S: State + HasCorpus,
|
||||||
|
S::Corpus: Corpus<Input = S::Input>,
|
||||||
SP: ShMemProvider,
|
SP: ShMemProvider,
|
||||||
Z: EvaluatorObservers<Self, E::Observers, State = Self::State>
|
Z: EvaluatorObservers<E, Self, <S::Corpus as Corpus>::Input, S>
|
||||||
+ ExecutionProcessor<Self, E::Observers, State = Self::State>,
|
+ ExecutionProcessor<Self, <S::Corpus as Corpus>::Input, E::Observers, S>,
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<EM, EMH, S, SP> HasCustomBufHandlers for CentralizedEventManager<EM, EMH, S, SP>
|
impl<EM, EMH, S, SP> HasCustomBufHandlers for CentralizedEventManager<EM, EMH, S, SP>
|
||||||
where
|
where
|
||||||
EM: HasCustomBufHandlers,
|
EM: HasCustomBufHandlers<State = S>,
|
||||||
EMH: EventManagerHooksTuple<EM::State>,
|
EMH: EventManagerHooksTuple<S>,
|
||||||
S: State,
|
S: State,
|
||||||
SP: ShMemProvider,
|
SP: ShMemProvider,
|
||||||
{
|
{
|
||||||
@ -438,19 +439,21 @@ where
|
|||||||
|
|
||||||
impl<EM, EMH, S, SP> ProgressReporter for CentralizedEventManager<EM, EMH, S, SP>
|
impl<EM, EMH, S, SP> ProgressReporter for CentralizedEventManager<EM, EMH, S, SP>
|
||||||
where
|
where
|
||||||
EM: AdaptiveSerializer + ProgressReporter + HasEventManagerId,
|
EM: AdaptiveSerializer + ProgressReporter<State = S> + HasEventManagerId,
|
||||||
EM::State: HasMetadata + HasExecutions + HasLastReportTime,
|
EM::State: HasMetadata + HasExecutions + HasLastReportTime,
|
||||||
EMH: EventManagerHooksTuple<EM::State>,
|
EMH: EventManagerHooksTuple<S>,
|
||||||
S: State,
|
S: State + HasCorpus,
|
||||||
|
S::Corpus: Corpus<Input = S::Input>,
|
||||||
SP: ShMemProvider,
|
SP: ShMemProvider,
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<EM, EMH, S, SP> HasEventManagerId for CentralizedEventManager<EM, EMH, S, SP>
|
impl<EM, EMH, S, SP> HasEventManagerId for CentralizedEventManager<EM, EMH, S, SP>
|
||||||
where
|
where
|
||||||
EM: HasEventManagerId + UsesState,
|
EM: HasEventManagerId + UsesState<State = S>,
|
||||||
EMH: EventManagerHooksTuple<EM::State>,
|
EMH: EventManagerHooksTuple<S>,
|
||||||
S: State,
|
S: State + HasCorpus,
|
||||||
|
S::Corpus: Corpus<Input = S::Input>,
|
||||||
SP: ShMemProvider,
|
SP: ShMemProvider,
|
||||||
{
|
{
|
||||||
fn mgr_id(&self) -> EventManagerId {
|
fn mgr_id(&self) -> EventManagerId {
|
||||||
@ -460,9 +463,10 @@ where
|
|||||||
|
|
||||||
impl<EM, EMH, S, SP> CentralizedEventManager<EM, EMH, S, SP>
|
impl<EM, EMH, S, SP> CentralizedEventManager<EM, EMH, S, SP>
|
||||||
where
|
where
|
||||||
EM: UsesState,
|
EM: UsesState<State = S>,
|
||||||
EMH: EventManagerHooksTuple<EM::State>,
|
EMH: EventManagerHooksTuple<S>,
|
||||||
S: State,
|
S: State + HasCorpus,
|
||||||
|
S::Corpus: Corpus<Input = S::Input>,
|
||||||
SP: ShMemProvider,
|
SP: ShMemProvider,
|
||||||
{
|
{
|
||||||
/// Describe the client event manager's LLMP parts in a restorable fashion
|
/// Describe the client event manager's LLMP parts in a restorable fashion
|
||||||
@ -472,7 +476,6 @@ where
|
|||||||
|
|
||||||
/// Write the config for a client [`EventManager`] to env vars, a new
|
/// Write the config for a client [`EventManager`] to env vars, a new
|
||||||
/// client can reattach using [`CentralizedEventManagerBuilder::build_existing_client_from_env()`].
|
/// client can reattach using [`CentralizedEventManagerBuilder::build_existing_client_from_env()`].
|
||||||
#[cfg(feature = "std")]
|
|
||||||
pub fn to_env(&self, env_name: &str) {
|
pub fn to_env(&self, env_name: &str) {
|
||||||
self.client.to_env(env_name).unwrap();
|
self.client.to_env(env_name).unwrap();
|
||||||
}
|
}
|
||||||
@ -485,9 +488,10 @@ where
|
|||||||
|
|
||||||
impl<EM, EMH, S, SP> CentralizedEventManager<EM, EMH, S, SP>
|
impl<EM, EMH, S, SP> CentralizedEventManager<EM, EMH, S, SP>
|
||||||
where
|
where
|
||||||
EM: UsesState + EventFirer + AdaptiveSerializer + HasEventManagerId,
|
EM: UsesState<State = S> + EventFirer + AdaptiveSerializer + HasEventManagerId,
|
||||||
EMH: EventManagerHooksTuple<EM::State>,
|
EMH: EventManagerHooksTuple<S>,
|
||||||
S: State + Stoppable,
|
S: State + Stoppable + HasCorpus,
|
||||||
|
S::Corpus: Corpus<Input = S::Input>,
|
||||||
SP: ShMemProvider,
|
SP: ShMemProvider,
|
||||||
{
|
{
|
||||||
#[cfg(feature = "llmp_compression")]
|
#[cfg(feature = "llmp_compression")]
|
||||||
@ -535,8 +539,8 @@ where
|
|||||||
ObserversTuple<<Self as UsesInput>::Input, <Self as UsesState>::State> + Serialize,
|
ObserversTuple<<Self as UsesInput>::Input, <Self as UsesState>::State> + Serialize,
|
||||||
<Self as UsesState>::State: UsesInput + HasExecutions + HasMetadata,
|
<Self as UsesState>::State: UsesInput + HasExecutions + HasMetadata,
|
||||||
for<'a> E::Observers: Deserialize<'a>,
|
for<'a> E::Observers: Deserialize<'a>,
|
||||||
Z: ExecutionProcessor<Self, E::Observers, State = <Self as UsesState>::State>
|
Z: EvaluatorObservers<E, Self, <S::Corpus as Corpus>::Input, S>
|
||||||
+ EvaluatorObservers<Self, E::Observers>,
|
+ ExecutionProcessor<Self, <S::Corpus as Corpus>::Input, E::Observers, S>,
|
||||||
{
|
{
|
||||||
// TODO: Get around local event copy by moving handle_in_client
|
// TODO: Get around local event copy by moving handle_in_client
|
||||||
let self_id = self.client.sender().id();
|
let self_id = self.client.sender().id();
|
||||||
@ -585,8 +589,8 @@ where
|
|||||||
ObserversTuple<<Self as UsesInput>::Input, <Self as UsesState>::State> + Serialize,
|
ObserversTuple<<Self as UsesInput>::Input, <Self as UsesState>::State> + Serialize,
|
||||||
<Self as UsesState>::State: UsesInput + HasExecutions + HasMetadata,
|
<Self as UsesState>::State: UsesInput + HasExecutions + HasMetadata,
|
||||||
for<'a> E::Observers: Deserialize<'a> + Serialize,
|
for<'a> E::Observers: Deserialize<'a> + Serialize,
|
||||||
Z: ExecutionProcessor<Self, E::Observers, State = <Self as UsesState>::State>
|
Z: EvaluatorObservers<E, Self, <S::Corpus as Corpus>::Input, S>
|
||||||
+ EvaluatorObservers<Self, E::Observers>,
|
+ ExecutionProcessor<Self, <S::Corpus as Corpus>::Input, E::Observers, S>,
|
||||||
{
|
{
|
||||||
log::debug!("handle_in_main!");
|
log::debug!("handle_in_main!");
|
||||||
|
|
||||||
@ -640,7 +644,7 @@ where
|
|||||||
process::id(),
|
process::id(),
|
||||||
event_name
|
event_name
|
||||||
);
|
);
|
||||||
fuzzer.evaluate_input_with_observers::<E>(
|
fuzzer.evaluate_input_with_observers(
|
||||||
state,
|
state,
|
||||||
executor,
|
executor,
|
||||||
self,
|
self,
|
||||||
|
@ -30,6 +30,7 @@ use serde::{Deserialize, Serialize};
|
|||||||
#[cfg(feature = "llmp_compression")]
|
#[cfg(feature = "llmp_compression")]
|
||||||
use crate::events::llmp::COMPRESS_THRESHOLD;
|
use crate::events::llmp::COMPRESS_THRESHOLD;
|
||||||
use crate::{
|
use crate::{
|
||||||
|
corpus::Corpus,
|
||||||
events::{
|
events::{
|
||||||
llmp::{LLMP_TAG_EVENT_TO_BOTH, _LLMP_TAG_EVENT_TO_BROKER},
|
llmp::{LLMP_TAG_EVENT_TO_BOTH, _LLMP_TAG_EVENT_TO_BROKER},
|
||||||
AdaptiveSerializer, CustomBufEventResult, CustomBufHandlerFn, Event, EventConfig,
|
AdaptiveSerializer, CustomBufEventResult, CustomBufHandlerFn, Event, EventConfig,
|
||||||
@ -40,7 +41,7 @@ use crate::{
|
|||||||
fuzzer::{Evaluator, EvaluatorObservers, ExecutionProcessor},
|
fuzzer::{Evaluator, EvaluatorObservers, ExecutionProcessor},
|
||||||
inputs::{NopInput, UsesInput},
|
inputs::{NopInput, UsesInput},
|
||||||
observers::{ObserversTuple, TimeObserver},
|
observers::{ObserversTuple, TimeObserver},
|
||||||
state::{HasExecutions, HasImported, HasLastReportTime, NopState, State, UsesState},
|
state::{HasCorpus, HasExecutions, HasImported, HasLastReportTime, NopState, State, UsesState},
|
||||||
Error, HasMetadata,
|
Error, HasMetadata,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -387,7 +388,8 @@ where
|
|||||||
impl<EMH, S, SP> LlmpEventManager<EMH, S, SP>
|
impl<EMH, S, SP> LlmpEventManager<EMH, S, SP>
|
||||||
where
|
where
|
||||||
EMH: EventManagerHooksTuple<S>,
|
EMH: EventManagerHooksTuple<S>,
|
||||||
S: State + HasExecutions + HasMetadata + HasImported,
|
S: State + HasExecutions + HasMetadata + HasImported + HasCorpus,
|
||||||
|
S::Corpus: Corpus<Input = S::Input>,
|
||||||
SP: ShMemProvider,
|
SP: ShMemProvider,
|
||||||
{
|
{
|
||||||
// Handle arriving events in the client
|
// Handle arriving events in the client
|
||||||
@ -404,9 +406,9 @@ where
|
|||||||
E: Executor<Self, Z, State = S> + HasObservers,
|
E: Executor<Self, Z, State = S> + HasObservers,
|
||||||
E::Observers: ObserversTuple<S::Input, S> + Serialize,
|
E::Observers: ObserversTuple<S::Input, S> + Serialize,
|
||||||
for<'a> E::Observers: Deserialize<'a>,
|
for<'a> E::Observers: Deserialize<'a>,
|
||||||
Z: ExecutionProcessor<Self, E::Observers, State = S>
|
Z: ExecutionProcessor<Self, <S::Corpus as Corpus>::Input, E::Observers, S>
|
||||||
+ EvaluatorObservers<Self, E::Observers>
|
+ EvaluatorObservers<E, Self, <S::Corpus as Corpus>::Input, S>
|
||||||
+ Evaluator<E, Self>,
|
+ Evaluator<E, Self, <S::Corpus as Corpus>::Input, S>,
|
||||||
{
|
{
|
||||||
if !self.hooks.pre_exec_all(state, client_id, &event)? {
|
if !self.hooks.pre_exec_all(state, client_id, &event)? {
|
||||||
return Ok(());
|
return Ok(());
|
||||||
@ -449,9 +451,7 @@ where
|
|||||||
{
|
{
|
||||||
state.scalability_monitor_mut().testcase_without_observers += 1;
|
state.scalability_monitor_mut().testcase_without_observers += 1;
|
||||||
}
|
}
|
||||||
fuzzer.evaluate_input_with_observers::<E>(
|
fuzzer.evaluate_input_with_observers(state, executor, self, input, false)?
|
||||||
state, executor, self, input, false,
|
|
||||||
)?
|
|
||||||
};
|
};
|
||||||
if let Some(item) = res.1 {
|
if let Some(item) = res.1 {
|
||||||
*state.imported_mut() += 1;
|
*state.imported_mut() += 1;
|
||||||
@ -585,14 +585,15 @@ where
|
|||||||
impl<E, EMH, S, SP, Z> EventProcessor<E, Z> for LlmpEventManager<EMH, S, SP>
|
impl<E, EMH, S, SP, Z> EventProcessor<E, Z> for LlmpEventManager<EMH, S, SP>
|
||||||
where
|
where
|
||||||
EMH: EventManagerHooksTuple<S>,
|
EMH: EventManagerHooksTuple<S>,
|
||||||
S: State + HasExecutions + HasMetadata + HasImported,
|
S: State + HasExecutions + HasMetadata + HasImported + HasCorpus,
|
||||||
|
S::Corpus: Corpus<Input = S::Input>,
|
||||||
SP: ShMemProvider,
|
SP: ShMemProvider,
|
||||||
E: HasObservers + Executor<Self, Z, State = S>,
|
E: HasObservers + Executor<Self, Z, State = S>,
|
||||||
E::Observers: ObserversTuple<S::Input, S> + Serialize,
|
E::Observers: ObserversTuple<S::Input, S> + Serialize,
|
||||||
for<'a> E::Observers: Deserialize<'a>,
|
for<'a> E::Observers: Deserialize<'a>,
|
||||||
Z: ExecutionProcessor<Self, E::Observers, State = S>
|
Z: ExecutionProcessor<Self, <S::Corpus as Corpus>::Input, E::Observers, S>
|
||||||
+ EvaluatorObservers<Self, E::Observers>
|
+ EvaluatorObservers<E, Self, <S::Corpus as Corpus>::Input, S>
|
||||||
+ Evaluator<E, Self>,
|
+ Evaluator<E, Self, <S::Corpus as Corpus>::Input, S>,
|
||||||
{
|
{
|
||||||
fn process(
|
fn process(
|
||||||
&mut self,
|
&mut self,
|
||||||
@ -649,11 +650,12 @@ where
|
|||||||
E::Observers: ObserversTuple<S::Input, S> + Serialize,
|
E::Observers: ObserversTuple<S::Input, S> + Serialize,
|
||||||
for<'a> E::Observers: Deserialize<'a>,
|
for<'a> E::Observers: Deserialize<'a>,
|
||||||
EMH: EventManagerHooksTuple<S>,
|
EMH: EventManagerHooksTuple<S>,
|
||||||
S: State + HasExecutions + HasMetadata + HasLastReportTime + HasImported,
|
S: State + HasExecutions + HasMetadata + HasLastReportTime + HasImported + HasCorpus,
|
||||||
|
S::Corpus: Corpus<Input = S::Input>,
|
||||||
SP: ShMemProvider,
|
SP: ShMemProvider,
|
||||||
Z: ExecutionProcessor<Self, E::Observers, State = S>
|
Z: ExecutionProcessor<Self, <S::Corpus as Corpus>::Input, E::Observers, S>
|
||||||
+ EvaluatorObservers<Self, E::Observers>
|
+ EvaluatorObservers<E, Self, <S::Corpus as Corpus>::Input, S>
|
||||||
+ Evaluator<E, Self>,
|
+ Evaluator<E, Self, <S::Corpus as Corpus>::Input, S>,
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,11 +16,12 @@ use libafl_bolts::{
|
|||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
|
corpus::Corpus,
|
||||||
events::{CustomBufEventResult, CustomBufHandlerFn, Event, EventFirer},
|
events::{CustomBufEventResult, CustomBufHandlerFn, Event, EventFirer},
|
||||||
executors::{Executor, HasObservers},
|
executors::{Executor, HasObservers},
|
||||||
fuzzer::{EvaluatorObservers, ExecutionProcessor},
|
fuzzer::{EvaluatorObservers, ExecutionProcessor},
|
||||||
inputs::{Input, InputConverter, NopInput, NopInputConverter, UsesInput},
|
inputs::{Input, InputConverter, NopInput, NopInputConverter, UsesInput},
|
||||||
state::{HasExecutions, NopState, State, Stoppable, UsesState},
|
state::{HasCorpus, HasExecutions, NopState, State, Stoppable, UsesState},
|
||||||
Error, HasMetadata,
|
Error, HasMetadata,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -253,7 +254,7 @@ where
|
|||||||
|
|
||||||
impl<DI, IC, ICB, S, SP> LlmpEventConverter<DI, IC, ICB, S, SP>
|
impl<DI, IC, ICB, S, SP> LlmpEventConverter<DI, IC, ICB, S, SP>
|
||||||
where
|
where
|
||||||
S: UsesInput + HasExecutions + HasMetadata + Stoppable,
|
S: UsesInput + HasExecutions + HasMetadata + Stoppable + HasCorpus,
|
||||||
SP: ShMemProvider,
|
SP: ShMemProvider,
|
||||||
IC: InputConverter<From = S::Input, To = DI>,
|
IC: InputConverter<From = S::Input, To = DI>,
|
||||||
ICB: InputConverter<From = DI, To = S::Input>,
|
ICB: InputConverter<From = DI, To = S::Input>,
|
||||||
@ -295,8 +296,10 @@ where
|
|||||||
where
|
where
|
||||||
E: Executor<EM, Z, State = S> + HasObservers,
|
E: Executor<EM, Z, State = S> + HasObservers,
|
||||||
EM: UsesState<State = S> + EventFirer,
|
EM: UsesState<State = S> + EventFirer,
|
||||||
|
S::Corpus: Corpus<Input = S::Input>,
|
||||||
for<'a> E::Observers: Deserialize<'a>,
|
for<'a> E::Observers: Deserialize<'a>,
|
||||||
Z: ExecutionProcessor<EM, E::Observers, State = S> + EvaluatorObservers<EM, E::Observers>,
|
Z: ExecutionProcessor<EM, <S::Corpus as Corpus>::Input, E::Observers, S>
|
||||||
|
+ EvaluatorObservers<E, EM, <S::Corpus as Corpus>::Input, S>,
|
||||||
{
|
{
|
||||||
match event {
|
match event {
|
||||||
Event::NewTestcase {
|
Event::NewTestcase {
|
||||||
@ -308,7 +311,7 @@ where
|
|||||||
return Ok(());
|
return Ok(());
|
||||||
};
|
};
|
||||||
|
|
||||||
let res = fuzzer.evaluate_input_with_observers::<E>(
|
let res = fuzzer.evaluate_input_with_observers(
|
||||||
state,
|
state,
|
||||||
executor,
|
executor,
|
||||||
manager,
|
manager,
|
||||||
@ -349,8 +352,10 @@ where
|
|||||||
where
|
where
|
||||||
E: Executor<EM, Z, State = S> + HasObservers,
|
E: Executor<EM, Z, State = S> + HasObservers,
|
||||||
EM: UsesState<State = S> + EventFirer,
|
EM: UsesState<State = S> + EventFirer,
|
||||||
|
S::Corpus: Corpus<Input = S::Input>,
|
||||||
for<'a> E::Observers: Deserialize<'a>,
|
for<'a> E::Observers: Deserialize<'a>,
|
||||||
Z: ExecutionProcessor<EM, E::Observers, State = S> + EvaluatorObservers<EM, E::Observers>,
|
Z: ExecutionProcessor<EM, <S::Corpus as Corpus>::Input, E::Observers, S>
|
||||||
|
+ EvaluatorObservers<E, EM, <S::Corpus as Corpus>::Input, S>,
|
||||||
{
|
{
|
||||||
// TODO: Get around local event copy by moving handle_in_client
|
// TODO: Get around local event copy by moving handle_in_client
|
||||||
let self_id = self.llmp.sender().id();
|
let self_id = self.llmp.sender().id();
|
||||||
|
@ -4,56 +4,51 @@
|
|||||||
//! restart/refork it.
|
//! restart/refork it.
|
||||||
|
|
||||||
use alloc::{boxed::Box, vec::Vec};
|
use alloc::{boxed::Box, vec::Vec};
|
||||||
#[cfg(feature = "std")]
|
use core::{
|
||||||
use core::sync::atomic::{compiler_fence, Ordering};
|
marker::PhantomData,
|
||||||
#[cfg(feature = "std")]
|
num::NonZeroUsize,
|
||||||
use core::time::Duration;
|
sync::atomic::{compiler_fence, Ordering},
|
||||||
use core::{marker::PhantomData, num::NonZeroUsize};
|
time::Duration,
|
||||||
#[cfg(feature = "std")]
|
};
|
||||||
use std::net::SocketAddr;
|
use std::net::SocketAddr;
|
||||||
|
|
||||||
#[cfg(feature = "std")]
|
#[cfg(any(windows, not(feature = "fork")))]
|
||||||
use libafl_bolts::core_affinity::CoreId;
|
|
||||||
#[cfg(all(feature = "std", any(windows, not(feature = "fork"))))]
|
|
||||||
use libafl_bolts::os::startable_self;
|
use libafl_bolts::os::startable_self;
|
||||||
#[cfg(all(unix, feature = "std", not(miri)))]
|
#[cfg(all(unix, not(miri)))]
|
||||||
use libafl_bolts::os::unix_signals::setup_signal_handler;
|
use libafl_bolts::os::unix_signals::setup_signal_handler;
|
||||||
#[cfg(all(feature = "std", feature = "fork", unix))]
|
#[cfg(all(feature = "fork", unix))]
|
||||||
use libafl_bolts::os::{fork, ForkResult};
|
use libafl_bolts::os::{fork, ForkResult};
|
||||||
#[cfg(feature = "std")]
|
|
||||||
use libafl_bolts::{
|
use libafl_bolts::{
|
||||||
llmp::LlmpConnection, os::CTRL_C_EXIT, shmem::StdShMemProvider, staterestore::StateRestorer,
|
core_affinity::CoreId,
|
||||||
};
|
llmp::{Broker, LlmpBroker, LlmpConnection},
|
||||||
use libafl_bolts::{
|
os::CTRL_C_EXIT,
|
||||||
llmp::{Broker, LlmpBroker},
|
shmem::{ShMemProvider, StdShMemProvider},
|
||||||
shmem::ShMemProvider,
|
staterestore::StateRestorer,
|
||||||
tuples::{tuple_list, Handle},
|
tuples::{tuple_list, Handle},
|
||||||
};
|
};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
#[cfg(feature = "std")]
|
|
||||||
use typed_builder::TypedBuilder;
|
use typed_builder::TypedBuilder;
|
||||||
|
|
||||||
#[cfg(all(unix, feature = "std", not(miri)))]
|
#[cfg(all(unix, not(miri)))]
|
||||||
use crate::events::EVENTMGR_SIGHANDLER_STATE;
|
use crate::events::EVENTMGR_SIGHANDLER_STATE;
|
||||||
#[cfg(feature = "std")]
|
|
||||||
use crate::events::{AdaptiveSerializer, CustomBufEventResult, HasCustomBufHandlers};
|
|
||||||
use crate::{
|
use crate::{
|
||||||
|
corpus::Corpus,
|
||||||
events::{
|
events::{
|
||||||
launcher::ClientDescription, Event, EventConfig, EventFirer, EventManager,
|
launcher::ClientDescription, AdaptiveSerializer, CustomBufEventResult, Event, EventConfig,
|
||||||
EventManagerHooksTuple, EventManagerId, EventProcessor, EventRestarter, HasEventManagerId,
|
EventFirer, EventManager, EventManagerHooksTuple, EventManagerId, EventProcessor,
|
||||||
LlmpEventManager, LlmpShouldSaveState, ProgressReporter, StdLlmpEventHook,
|
EventRestarter, HasCustomBufHandlers, HasEventManagerId, LlmpEventManager,
|
||||||
|
LlmpShouldSaveState, ProgressReporter, StdLlmpEventHook,
|
||||||
},
|
},
|
||||||
executors::{Executor, HasObservers},
|
executors::{Executor, HasObservers},
|
||||||
fuzzer::{Evaluator, EvaluatorObservers, ExecutionProcessor},
|
fuzzer::{Evaluator, EvaluatorObservers, ExecutionProcessor},
|
||||||
inputs::UsesInput,
|
inputs::UsesInput,
|
||||||
monitors::Monitor,
|
monitors::Monitor,
|
||||||
observers::{ObserversTuple, TimeObserver},
|
observers::{ObserversTuple, TimeObserver},
|
||||||
state::{HasExecutions, HasImported, HasLastReportTime, State, UsesState},
|
state::{HasCorpus, HasExecutions, HasImported, HasLastReportTime, State, UsesState},
|
||||||
Error, HasMetadata,
|
Error, HasMetadata,
|
||||||
};
|
};
|
||||||
|
|
||||||
/// A manager that can restart on the fly, storing states in-between (in `on_restart`)
|
/// A manager that can restart on the fly, storing states in-between (in `on_restart`)
|
||||||
#[cfg(feature = "std")]
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct LlmpRestartingEventManager<EMH, S, SP>
|
pub struct LlmpRestartingEventManager<EMH, S, SP>
|
||||||
where
|
where
|
||||||
@ -69,7 +64,6 @@ where
|
|||||||
save_state: LlmpShouldSaveState,
|
save_state: LlmpShouldSaveState,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "std")]
|
|
||||||
impl<EMH, S, SP> AdaptiveSerializer for LlmpRestartingEventManager<EMH, S, SP>
|
impl<EMH, S, SP> AdaptiveSerializer for LlmpRestartingEventManager<EMH, S, SP>
|
||||||
where
|
where
|
||||||
SP: ShMemProvider,
|
SP: ShMemProvider,
|
||||||
@ -106,7 +100,6 @@ where
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "std")]
|
|
||||||
impl<EMH, S, SP> UsesState for LlmpRestartingEventManager<EMH, S, SP>
|
impl<EMH, S, SP> UsesState for LlmpRestartingEventManager<EMH, S, SP>
|
||||||
where
|
where
|
||||||
S: State,
|
S: State,
|
||||||
@ -115,7 +108,6 @@ where
|
|||||||
type State = S;
|
type State = S;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "std")]
|
|
||||||
impl<EMH, S, SP> ProgressReporter for LlmpRestartingEventManager<EMH, S, SP>
|
impl<EMH, S, SP> ProgressReporter for LlmpRestartingEventManager<EMH, S, SP>
|
||||||
where
|
where
|
||||||
S: State + HasExecutions + HasMetadata + HasLastReportTime,
|
S: State + HasExecutions + HasMetadata + HasLastReportTime,
|
||||||
@ -123,7 +115,6 @@ where
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "std")]
|
|
||||||
impl<EMH, S, SP> EventFirer for LlmpRestartingEventManager<EMH, S, SP>
|
impl<EMH, S, SP> EventFirer for LlmpRestartingEventManager<EMH, S, SP>
|
||||||
where
|
where
|
||||||
SP: ShMemProvider,
|
SP: ShMemProvider,
|
||||||
@ -157,7 +148,6 @@ where
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "std")]
|
|
||||||
impl<EMH, S, SP> EventRestarter for LlmpRestartingEventManager<EMH, S, SP>
|
impl<EMH, S, SP> EventRestarter for LlmpRestartingEventManager<EMH, S, SP>
|
||||||
where
|
where
|
||||||
S: State + HasExecutions,
|
S: State + HasExecutions,
|
||||||
@ -199,18 +189,22 @@ where
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "std")]
|
|
||||||
impl<E, EMH, S, SP, Z> EventProcessor<E, Z> for LlmpRestartingEventManager<EMH, S, SP>
|
impl<E, EMH, S, SP, Z> EventProcessor<E, Z> for LlmpRestartingEventManager<EMH, S, SP>
|
||||||
where
|
where
|
||||||
E: HasObservers + Executor<LlmpEventManager<EMH, S, SP>, Z, State = S>,
|
E: HasObservers + Executor<LlmpEventManager<EMH, S, SP>, Z, State = S>,
|
||||||
E::Observers: ObserversTuple<S::Input, S> + Serialize,
|
E::Observers: ObserversTuple<S::Input, S> + Serialize,
|
||||||
for<'a> E::Observers: Deserialize<'a>,
|
for<'a> E::Observers: Deserialize<'a>,
|
||||||
EMH: EventManagerHooksTuple<S>,
|
EMH: EventManagerHooksTuple<S>,
|
||||||
S: State + HasExecutions + HasMetadata + HasImported,
|
S: State + HasExecutions + HasMetadata + HasImported + HasCorpus,
|
||||||
|
S::Corpus: Corpus<Input = S::Input>,
|
||||||
SP: ShMemProvider,
|
SP: ShMemProvider,
|
||||||
Z: ExecutionProcessor<LlmpEventManager<EMH, S, SP>, E::Observers, State = S>
|
Z: ExecutionProcessor<
|
||||||
+ EvaluatorObservers<LlmpEventManager<EMH, S, SP>, E::Observers>
|
LlmpEventManager<EMH, S, SP>,
|
||||||
+ Evaluator<E, LlmpEventManager<EMH, S, SP>>,
|
<S::Corpus as Corpus>::Input,
|
||||||
|
E::Observers,
|
||||||
|
S,
|
||||||
|
> + EvaluatorObservers<E, LlmpEventManager<EMH, S, SP>, <S::Corpus as Corpus>::Input, S>
|
||||||
|
+ Evaluator<E, LlmpEventManager<EMH, S, SP>, <S::Corpus as Corpus>::Input, S>,
|
||||||
{
|
{
|
||||||
fn process(&mut self, fuzzer: &mut Z, state: &mut S, executor: &mut E) -> Result<usize, Error> {
|
fn process(&mut self, fuzzer: &mut Z, state: &mut S, executor: &mut E) -> Result<usize, Error> {
|
||||||
let res = self.llmp_mgr.process(fuzzer, state, executor)?;
|
let res = self.llmp_mgr.process(fuzzer, state, executor)?;
|
||||||
@ -223,22 +217,25 @@ where
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "std")]
|
|
||||||
impl<E, EMH, S, SP, Z> EventManager<E, Z> for LlmpRestartingEventManager<EMH, S, SP>
|
impl<E, EMH, S, SP, Z> EventManager<E, Z> for LlmpRestartingEventManager<EMH, S, SP>
|
||||||
where
|
where
|
||||||
E: HasObservers + Executor<LlmpEventManager<EMH, S, SP>, Z, State = S>,
|
E: HasObservers + Executor<LlmpEventManager<EMH, S, SP>, Z, State = S>,
|
||||||
E::Observers: ObserversTuple<S::Input, S> + Serialize,
|
E::Observers: ObserversTuple<S::Input, S> + Serialize,
|
||||||
for<'a> E::Observers: Deserialize<'a>,
|
for<'a> E::Observers: Deserialize<'a>,
|
||||||
EMH: EventManagerHooksTuple<S>,
|
EMH: EventManagerHooksTuple<S>,
|
||||||
S: State + HasExecutions + HasMetadata + HasLastReportTime + HasImported,
|
S: State + HasExecutions + HasMetadata + HasLastReportTime + HasImported + HasCorpus,
|
||||||
|
S::Corpus: Corpus<Input = S::Input>,
|
||||||
SP: ShMemProvider,
|
SP: ShMemProvider,
|
||||||
Z: ExecutionProcessor<LlmpEventManager<EMH, S, SP>, E::Observers, State = S>
|
Z: ExecutionProcessor<
|
||||||
+ EvaluatorObservers<LlmpEventManager<EMH, S, SP>, E::Observers>
|
LlmpEventManager<EMH, S, SP>,
|
||||||
+ Evaluator<E, LlmpEventManager<EMH, S, SP>>,
|
<S::Corpus as Corpus>::Input,
|
||||||
|
E::Observers,
|
||||||
|
S,
|
||||||
|
> + EvaluatorObservers<E, LlmpEventManager<EMH, S, SP>, <S::Corpus as Corpus>::Input, S>
|
||||||
|
+ Evaluator<E, LlmpEventManager<EMH, S, SP>, <S::Corpus as Corpus>::Input, S>,
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "std")]
|
|
||||||
impl<EMH, S, SP> HasEventManagerId for LlmpRestartingEventManager<EMH, S, SP>
|
impl<EMH, S, SP> HasEventManagerId for LlmpRestartingEventManager<EMH, S, SP>
|
||||||
where
|
where
|
||||||
S: State,
|
S: State,
|
||||||
@ -249,7 +246,6 @@ where
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "std")]
|
|
||||||
impl<EMH, S, SP> HasCustomBufHandlers for LlmpRestartingEventManager<EMH, S, SP>
|
impl<EMH, S, SP> HasCustomBufHandlers for LlmpRestartingEventManager<EMH, S, SP>
|
||||||
where
|
where
|
||||||
S: State,
|
S: State,
|
||||||
@ -269,7 +265,6 @@ const _ENV_FUZZER_RECEIVER: &str = "_AFL_ENV_FUZZER_RECEIVER";
|
|||||||
/// The llmp (2 way) connection from a fuzzer to the broker (broadcasting all other fuzzer messages)
|
/// The llmp (2 way) connection from a fuzzer to the broker (broadcasting all other fuzzer messages)
|
||||||
const _ENV_FUZZER_BROKER_CLIENT_INITIAL: &str = "_AFL_ENV_FUZZER_BROKER_CLIENT";
|
const _ENV_FUZZER_BROKER_CLIENT_INITIAL: &str = "_AFL_ENV_FUZZER_BROKER_CLIENT";
|
||||||
|
|
||||||
#[cfg(feature = "std")]
|
|
||||||
impl<EMH, S, SP> LlmpRestartingEventManager<EMH, S, SP>
|
impl<EMH, S, SP> LlmpRestartingEventManager<EMH, S, SP>
|
||||||
where
|
where
|
||||||
S: State,
|
S: State,
|
||||||
@ -321,7 +316,6 @@ where
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// The kind of manager we're creating right now
|
/// The kind of manager we're creating right now
|
||||||
#[cfg(feature = "std")]
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub enum ManagerKind {
|
pub enum ManagerKind {
|
||||||
/// Any kind will do
|
/// Any kind will do
|
||||||
@ -339,7 +333,6 @@ pub enum ManagerKind {
|
|||||||
///
|
///
|
||||||
/// The restarting mgr is a combination of restarter and runner, that can be used on systems with and without `fork` support.
|
/// The restarting mgr is a combination of restarter and runner, that can be used on systems with and without `fork` support.
|
||||||
/// The restarter will spawn a new process each time the child crashes or timeouts.
|
/// The restarter will spawn a new process each time the child crashes or timeouts.
|
||||||
#[cfg(feature = "std")]
|
|
||||||
#[allow(clippy::type_complexity)]
|
#[allow(clippy::type_complexity)]
|
||||||
pub fn setup_restarting_mgr_std<MT, S>(
|
pub fn setup_restarting_mgr_std<MT, S>(
|
||||||
monitor: MT,
|
monitor: MT,
|
||||||
@ -371,7 +364,6 @@ where
|
|||||||
/// The restarting mgr is a combination of restarter and runner, that can be used on systems with and without `fork` support.
|
/// The restarting mgr is a combination of restarter and runner, that can be used on systems with and without `fork` support.
|
||||||
/// The restarter will spawn a new process each time the child crashes or timeouts.
|
/// The restarter will spawn a new process each time the child crashes or timeouts.
|
||||||
/// This one, additionally uses the timeobserver for the adaptive serialization
|
/// This one, additionally uses the timeobserver for the adaptive serialization
|
||||||
#[cfg(feature = "std")]
|
|
||||||
#[allow(clippy::type_complexity)]
|
#[allow(clippy::type_complexity)]
|
||||||
pub fn setup_restarting_mgr_std_adaptive<MT, S>(
|
pub fn setup_restarting_mgr_std_adaptive<MT, S>(
|
||||||
monitor: MT,
|
monitor: MT,
|
||||||
@ -405,7 +397,6 @@ where
|
|||||||
/// The [`RestartingMgr`] is is a combination of a
|
/// The [`RestartingMgr`] is is a combination of a
|
||||||
/// `restarter` and `runner`, that can be used on systems both with and without `fork` support. The
|
/// `restarter` and `runner`, that can be used on systems both with and without `fork` support. The
|
||||||
/// `restarter` will start a new process each time the child crashes or times out.
|
/// `restarter` will start a new process each time the child crashes or times out.
|
||||||
#[cfg(feature = "std")]
|
|
||||||
#[allow(clippy::default_trait_access, clippy::ignored_unit_patterns)]
|
#[allow(clippy::default_trait_access, clippy::ignored_unit_patterns)]
|
||||||
#[derive(TypedBuilder, Debug)]
|
#[derive(TypedBuilder, Debug)]
|
||||||
pub struct RestartingMgr<EMH, MT, S, SP> {
|
pub struct RestartingMgr<EMH, MT, S, SP> {
|
||||||
@ -448,7 +439,6 @@ pub struct RestartingMgr<EMH, MT, S, SP> {
|
|||||||
phantom_data: PhantomData<(EMH, S)>,
|
phantom_data: PhantomData<(EMH, S)>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "std")]
|
|
||||||
#[allow(clippy::type_complexity, clippy::too_many_lines)]
|
#[allow(clippy::type_complexity, clippy::too_many_lines)]
|
||||||
impl<EMH, MT, S, SP> RestartingMgr<EMH, MT, S, SP>
|
impl<EMH, MT, S, SP> RestartingMgr<EMH, MT, S, SP>
|
||||||
where
|
where
|
||||||
@ -719,7 +709,6 @@ where
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
#[cfg(feature = "std")]
|
|
||||||
mod tests {
|
mod tests {
|
||||||
use core::sync::atomic::{compiler_fence, Ordering};
|
use core::sync::atomic::{compiler_fence, Ordering};
|
||||||
|
|
||||||
|
@ -16,32 +16,33 @@ use std::{
|
|||||||
|
|
||||||
#[cfg(feature = "tcp_compression")]
|
#[cfg(feature = "tcp_compression")]
|
||||||
use libafl_bolts::compress::GzipCompressor;
|
use libafl_bolts::compress::GzipCompressor;
|
||||||
#[cfg(feature = "std")]
|
#[cfg(any(windows, not(feature = "fork")))]
|
||||||
use libafl_bolts::core_affinity::CoreId;
|
|
||||||
#[cfg(all(feature = "std", any(windows, not(feature = "fork"))))]
|
|
||||||
use libafl_bolts::os::startable_self;
|
use libafl_bolts::os::startable_self;
|
||||||
#[cfg(all(unix, feature = "std", not(miri)))]
|
#[cfg(all(unix, not(miri)))]
|
||||||
use libafl_bolts::os::unix_signals::setup_signal_handler;
|
use libafl_bolts::os::unix_signals::setup_signal_handler;
|
||||||
#[cfg(feature = "std")]
|
#[cfg(all(feature = "fork", unix))]
|
||||||
use libafl_bolts::os::CTRL_C_EXIT;
|
|
||||||
#[cfg(all(feature = "std", feature = "fork", unix))]
|
|
||||||
use libafl_bolts::os::{fork, ForkResult};
|
use libafl_bolts::os::{fork, ForkResult};
|
||||||
use libafl_bolts::{shmem::ShMemProvider, tuples::tuple_list, ClientId};
|
use libafl_bolts::{
|
||||||
#[cfg(feature = "std")]
|
core_affinity::CoreId,
|
||||||
use libafl_bolts::{shmem::StdShMemProvider, staterestore::StateRestorer};
|
os::CTRL_C_EXIT,
|
||||||
|
shmem::{ShMemProvider, StdShMemProvider},
|
||||||
|
staterestore::StateRestorer,
|
||||||
|
tuples::tuple_list,
|
||||||
|
ClientId,
|
||||||
|
};
|
||||||
use serde::{de::DeserializeOwned, Deserialize, Serialize};
|
use serde::{de::DeserializeOwned, Deserialize, Serialize};
|
||||||
use tokio::{
|
use tokio::{
|
||||||
io::{AsyncReadExt, AsyncWriteExt},
|
io::{AsyncReadExt, AsyncWriteExt},
|
||||||
sync::{broadcast, broadcast::error::RecvError, mpsc},
|
sync::{broadcast, broadcast::error::RecvError, mpsc},
|
||||||
task::{spawn, JoinHandle},
|
task::{spawn, JoinHandle},
|
||||||
};
|
};
|
||||||
#[cfg(feature = "std")]
|
|
||||||
use typed_builder::TypedBuilder;
|
use typed_builder::TypedBuilder;
|
||||||
|
|
||||||
use super::{CustomBufEventResult, CustomBufHandlerFn};
|
use super::{CustomBufEventResult, CustomBufHandlerFn};
|
||||||
#[cfg(all(unix, feature = "std", not(miri)))]
|
#[cfg(all(unix, not(miri)))]
|
||||||
use crate::events::EVENTMGR_SIGHANDLER_STATE;
|
use crate::events::EVENTMGR_SIGHANDLER_STATE;
|
||||||
use crate::{
|
use crate::{
|
||||||
|
corpus::Corpus,
|
||||||
events::{
|
events::{
|
||||||
BrokerEventResult, Event, EventConfig, EventFirer, EventManager, EventManagerHooksTuple,
|
BrokerEventResult, Event, EventConfig, EventFirer, EventManager, EventManagerHooksTuple,
|
||||||
EventManagerId, EventProcessor, EventRestarter, HasCustomBufHandlers, HasEventManagerId,
|
EventManagerId, EventProcessor, EventRestarter, HasCustomBufHandlers, HasEventManagerId,
|
||||||
@ -52,7 +53,7 @@ use crate::{
|
|||||||
inputs::{Input, UsesInput},
|
inputs::{Input, UsesInput},
|
||||||
monitors::Monitor,
|
monitors::Monitor,
|
||||||
observers::ObserversTuple,
|
observers::ObserversTuple,
|
||||||
state::{HasExecutions, HasImported, HasLastReportTime, State, UsesState},
|
state::{HasCorpus, HasExecutions, HasImported, HasLastReportTime, State, UsesState},
|
||||||
Error, HasMetadata,
|
Error, HasMetadata,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -583,7 +584,8 @@ where
|
|||||||
impl<EMH, S> TcpEventManager<EMH, S>
|
impl<EMH, S> TcpEventManager<EMH, S>
|
||||||
where
|
where
|
||||||
EMH: EventManagerHooksTuple<S>,
|
EMH: EventManagerHooksTuple<S>,
|
||||||
S: State + HasExecutions + HasMetadata + HasImported,
|
S: State + HasExecutions + HasMetadata + HasImported + HasCorpus,
|
||||||
|
S::Corpus: Corpus<Input = S::Input>,
|
||||||
{
|
{
|
||||||
/// Write the client id for a client [`EventManager`] to env vars
|
/// Write the client id for a client [`EventManager`] to env vars
|
||||||
pub fn to_env(&self, env_name: &str) {
|
pub fn to_env(&self, env_name: &str) {
|
||||||
@ -604,8 +606,8 @@ where
|
|||||||
E: Executor<Self, Z, State = S> + HasObservers,
|
E: Executor<Self, Z, State = S> + HasObservers,
|
||||||
E::Observers: Serialize + ObserversTuple<S::Input, S>,
|
E::Observers: Serialize + ObserversTuple<S::Input, S>,
|
||||||
for<'a> E::Observers: Deserialize<'a>,
|
for<'a> E::Observers: Deserialize<'a>,
|
||||||
Z: ExecutionProcessor<Self, E::Observers, State = S>
|
Z: ExecutionProcessor<Self, <S::Corpus as Corpus>::Input, E::Observers, S>
|
||||||
+ EvaluatorObservers<Self, E::Observers>,
|
+ EvaluatorObservers<E, Self, <S::Corpus as Corpus>::Input, S>,
|
||||||
{
|
{
|
||||||
if !self.hooks.pre_exec_all(state, client_id, &event)? {
|
if !self.hooks.pre_exec_all(state, client_id, &event)? {
|
||||||
return Ok(());
|
return Ok(());
|
||||||
@ -636,8 +638,7 @@ where
|
|||||||
{
|
{
|
||||||
state.scalability_monitor_mut().testcase_without_observers += 1;
|
state.scalability_monitor_mut().testcase_without_observers += 1;
|
||||||
}
|
}
|
||||||
fuzzer
|
fuzzer.evaluate_input_with_observers(state, executor, self, input, false)?
|
||||||
.evaluate_input_with_observers::<E>(state, executor, self, input, false)?
|
|
||||||
};
|
};
|
||||||
if let Some(item) = _res.1 {
|
if let Some(item) = _res.1 {
|
||||||
*state.imported_mut() += 1;
|
*state.imported_mut() += 1;
|
||||||
@ -745,9 +746,10 @@ where
|
|||||||
E::Observers: Serialize + ObserversTuple<S::Input, S>,
|
E::Observers: Serialize + ObserversTuple<S::Input, S>,
|
||||||
for<'a> E::Observers: Deserialize<'a>,
|
for<'a> E::Observers: Deserialize<'a>,
|
||||||
EMH: EventManagerHooksTuple<S>,
|
EMH: EventManagerHooksTuple<S>,
|
||||||
S: State + HasExecutions + HasMetadata + HasImported,
|
S: State + HasExecutions + HasMetadata + HasImported + HasCorpus,
|
||||||
Z: EvaluatorObservers<Self, E::Observers, State = S>
|
S::Corpus: Corpus<Input = S::Input>,
|
||||||
+ ExecutionProcessor<Self, E::Observers, State = S>,
|
Z: ExecutionProcessor<Self, <S::Corpus as Corpus>::Input, E::Observers, S>
|
||||||
|
+ EvaluatorObservers<E, Self, <S::Corpus as Corpus>::Input, S>,
|
||||||
{
|
{
|
||||||
fn process(
|
fn process(
|
||||||
&mut self,
|
&mut self,
|
||||||
@ -820,9 +822,10 @@ where
|
|||||||
E::Observers: Serialize + ObserversTuple<S::Input, S>,
|
E::Observers: Serialize + ObserversTuple<S::Input, S>,
|
||||||
for<'a> E::Observers: Deserialize<'a>,
|
for<'a> E::Observers: Deserialize<'a>,
|
||||||
EMH: EventManagerHooksTuple<S>,
|
EMH: EventManagerHooksTuple<S>,
|
||||||
S: State + HasExecutions + HasMetadata + HasLastReportTime + HasImported,
|
S: State + HasExecutions + HasMetadata + HasLastReportTime + HasImported + HasCorpus,
|
||||||
Z: EvaluatorObservers<Self, E::Observers, State = S>
|
S::Corpus: Corpus<Input = S::Input>,
|
||||||
+ ExecutionProcessor<Self, E::Observers, State = S>,
|
Z: ExecutionProcessor<Self, <S::Corpus as Corpus>::Input, E::Observers, S>
|
||||||
|
+ EvaluatorObservers<E, Self, <S::Corpus as Corpus>::Input, S>,
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -858,7 +861,6 @@ where
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// A manager that can restart on the fly, storing states in-between (in `on_restart`)
|
/// A manager that can restart on the fly, storing states in-between (in `on_restart`)
|
||||||
#[cfg(feature = "std")]
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct TcpRestartingEventManager<EMH, S, SP>
|
pub struct TcpRestartingEventManager<EMH, S, SP>
|
||||||
where
|
where
|
||||||
@ -875,7 +877,6 @@ where
|
|||||||
save_state: bool,
|
save_state: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "std")]
|
|
||||||
impl<EMH, S, SP> UsesState for TcpRestartingEventManager<EMH, S, SP>
|
impl<EMH, S, SP> UsesState for TcpRestartingEventManager<EMH, S, SP>
|
||||||
where
|
where
|
||||||
EMH: EventManagerHooksTuple<S>,
|
EMH: EventManagerHooksTuple<S>,
|
||||||
@ -885,7 +886,6 @@ where
|
|||||||
type State = S;
|
type State = S;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "std")]
|
|
||||||
impl<EMH, S, SP> ProgressReporter for TcpRestartingEventManager<EMH, S, SP>
|
impl<EMH, S, SP> ProgressReporter for TcpRestartingEventManager<EMH, S, SP>
|
||||||
where
|
where
|
||||||
EMH: EventManagerHooksTuple<S>,
|
EMH: EventManagerHooksTuple<S>,
|
||||||
@ -894,7 +894,6 @@ where
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "std")]
|
|
||||||
impl<EMH, S, SP> EventFirer for TcpRestartingEventManager<EMH, S, SP>
|
impl<EMH, S, SP> EventFirer for TcpRestartingEventManager<EMH, S, SP>
|
||||||
where
|
where
|
||||||
EMH: EventManagerHooksTuple<S>,
|
EMH: EventManagerHooksTuple<S>,
|
||||||
@ -920,7 +919,6 @@ where
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "std")]
|
|
||||||
impl<EMH, S, SP> EventRestarter for TcpRestartingEventManager<EMH, S, SP>
|
impl<EMH, S, SP> EventRestarter for TcpRestartingEventManager<EMH, S, SP>
|
||||||
where
|
where
|
||||||
EMH: EventManagerHooksTuple<S>,
|
EMH: EventManagerHooksTuple<S>,
|
||||||
@ -959,17 +957,17 @@ where
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "std")]
|
|
||||||
impl<E, EMH, S, SP, Z> EventProcessor<E, Z> for TcpRestartingEventManager<EMH, S, SP>
|
impl<E, EMH, S, SP, Z> EventProcessor<E, Z> for TcpRestartingEventManager<EMH, S, SP>
|
||||||
where
|
where
|
||||||
E: HasObservers + Executor<TcpEventManager<EMH, S>, Z, State = S>,
|
E: HasObservers + Executor<TcpEventManager<EMH, S>, Z, State = S>,
|
||||||
for<'a> E::Observers: Deserialize<'a>,
|
for<'a> E::Observers: Deserialize<'a>,
|
||||||
E::Observers: ObserversTuple<S::Input, S> + Serialize,
|
E::Observers: ObserversTuple<S::Input, S> + Serialize,
|
||||||
EMH: EventManagerHooksTuple<S>,
|
EMH: EventManagerHooksTuple<S>,
|
||||||
S: State + HasExecutions + HasMetadata + HasImported,
|
S: State + HasExecutions + HasMetadata + HasImported + HasCorpus,
|
||||||
|
S::Corpus: Corpus<Input = S::Input>,
|
||||||
SP: ShMemProvider + 'static,
|
SP: ShMemProvider + 'static,
|
||||||
Z: EvaluatorObservers<TcpEventManager<EMH, S>, E::Observers, State = S>
|
Z: ExecutionProcessor<TcpEventManager<EMH, S>, <S::Corpus as Corpus>::Input, E::Observers, S>
|
||||||
+ ExecutionProcessor<TcpEventManager<EMH, S>, E::Observers>, //CE: CustomEvent<I>,
|
+ EvaluatorObservers<E, TcpEventManager<EMH, S>, <S::Corpus as Corpus>::Input, S>,
|
||||||
{
|
{
|
||||||
fn process(&mut self, fuzzer: &mut Z, state: &mut S, executor: &mut E) -> Result<usize, Error> {
|
fn process(&mut self, fuzzer: &mut Z, state: &mut S, executor: &mut E) -> Result<usize, Error> {
|
||||||
self.tcp_mgr.process(fuzzer, state, executor)
|
self.tcp_mgr.process(fuzzer, state, executor)
|
||||||
@ -980,21 +978,20 @@ where
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "std")]
|
|
||||||
impl<E, EMH, S, SP, Z> EventManager<E, Z> for TcpRestartingEventManager<EMH, S, SP>
|
impl<E, EMH, S, SP, Z> EventManager<E, Z> for TcpRestartingEventManager<EMH, S, SP>
|
||||||
where
|
where
|
||||||
E: HasObservers + Executor<TcpEventManager<EMH, S>, Z, State = S>,
|
E: HasObservers + Executor<TcpEventManager<EMH, S>, Z, State = S>,
|
||||||
E::Observers: ObserversTuple<S::Input, S> + Serialize,
|
E::Observers: ObserversTuple<S::Input, S> + Serialize,
|
||||||
for<'a> E::Observers: Deserialize<'a>,
|
for<'a> E::Observers: Deserialize<'a>,
|
||||||
EMH: EventManagerHooksTuple<S>,
|
EMH: EventManagerHooksTuple<S>,
|
||||||
S: State + HasExecutions + HasMetadata + HasLastReportTime + HasImported,
|
S: State + HasExecutions + HasMetadata + HasLastReportTime + HasImported + HasCorpus,
|
||||||
|
S::Corpus: Corpus<Input = S::Input>,
|
||||||
SP: ShMemProvider + 'static,
|
SP: ShMemProvider + 'static,
|
||||||
Z: EvaluatorObservers<TcpEventManager<EMH, S>, E::Observers, State = S>
|
Z: ExecutionProcessor<TcpEventManager<EMH, S>, <S::Corpus as Corpus>::Input, E::Observers, S>
|
||||||
+ ExecutionProcessor<TcpEventManager<EMH, S>, E::Observers>, //CE: CustomEvent<I>,
|
+ EvaluatorObservers<E, TcpEventManager<EMH, S>, <S::Corpus as Corpus>::Input, S>,
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "std")]
|
|
||||||
impl<EMH, S, SP> HasEventManagerId for TcpRestartingEventManager<EMH, S, SP>
|
impl<EMH, S, SP> HasEventManagerId for TcpRestartingEventManager<EMH, S, SP>
|
||||||
where
|
where
|
||||||
EMH: EventManagerHooksTuple<S>,
|
EMH: EventManagerHooksTuple<S>,
|
||||||
@ -1012,7 +1009,6 @@ const _ENV_FUZZER_RECEIVER: &str = "_AFL_ENV_FUZZER_RECEIVER";
|
|||||||
/// The tcp (2 way) connection from a fuzzer to the broker (broadcasting all other fuzzer messages)
|
/// The tcp (2 way) connection from a fuzzer to the broker (broadcasting all other fuzzer messages)
|
||||||
const _ENV_FUZZER_BROKER_CLIENT_INITIAL: &str = "_AFL_ENV_FUZZER_BROKER_CLIENT";
|
const _ENV_FUZZER_BROKER_CLIENT_INITIAL: &str = "_AFL_ENV_FUZZER_BROKER_CLIENT";
|
||||||
|
|
||||||
#[cfg(feature = "std")]
|
|
||||||
impl<EMH, S, SP> TcpRestartingEventManager<EMH, S, SP>
|
impl<EMH, S, SP> TcpRestartingEventManager<EMH, S, SP>
|
||||||
where
|
where
|
||||||
EMH: EventManagerHooksTuple<S>,
|
EMH: EventManagerHooksTuple<S>,
|
||||||
@ -1054,7 +1050,6 @@ where
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// The kind of manager we're creating right now
|
/// The kind of manager we're creating right now
|
||||||
#[cfg(feature = "std")]
|
|
||||||
#[derive(Debug, Clone, Copy)]
|
#[derive(Debug, Clone, Copy)]
|
||||||
pub enum TcpManagerKind {
|
pub enum TcpManagerKind {
|
||||||
/// Any kind will do
|
/// Any kind will do
|
||||||
@ -1072,7 +1067,6 @@ pub enum TcpManagerKind {
|
|||||||
///
|
///
|
||||||
/// The [`TcpRestartingEventManager`] is a combination of restarter and runner, that can be used on systems with and without `fork` support.
|
/// The [`TcpRestartingEventManager`] is a combination of restarter and runner, that can be used on systems with and without `fork` support.
|
||||||
/// The restarter will spawn a new process each time the child crashes or timeouts.
|
/// The restarter will spawn a new process each time the child crashes or timeouts.
|
||||||
#[cfg(feature = "std")]
|
|
||||||
#[allow(clippy::type_complexity)]
|
#[allow(clippy::type_complexity)]
|
||||||
pub fn setup_restarting_mgr_tcp<MT, S>(
|
pub fn setup_restarting_mgr_tcp<MT, S>(
|
||||||
monitor: MT,
|
monitor: MT,
|
||||||
@ -1087,7 +1081,8 @@ pub fn setup_restarting_mgr_tcp<MT, S>(
|
|||||||
>
|
>
|
||||||
where
|
where
|
||||||
MT: Monitor + Clone,
|
MT: Monitor + Clone,
|
||||||
S: State + HasExecutions + HasMetadata + HasImported,
|
S: State + HasExecutions + HasMetadata + HasImported + HasCorpus,
|
||||||
|
S::Corpus: Corpus<Input = S::Input>,
|
||||||
{
|
{
|
||||||
TcpRestartingMgr::builder()
|
TcpRestartingMgr::builder()
|
||||||
.shmem_provider(StdShMemProvider::new()?)
|
.shmem_provider(StdShMemProvider::new()?)
|
||||||
@ -1104,7 +1099,6 @@ where
|
|||||||
/// The [`TcpRestartingMgr`] is a combination of a
|
/// The [`TcpRestartingMgr`] is a combination of a
|
||||||
/// `restarter` and `runner`, that can be used on systems both with and without `fork` support. The
|
/// `restarter` and `runner`, that can be used on systems both with and without `fork` support. The
|
||||||
/// `restarter` will start a new process each time the child crashes or times out.
|
/// `restarter` will start a new process each time the child crashes or times out.
|
||||||
#[cfg(feature = "std")]
|
|
||||||
#[allow(clippy::default_trait_access, clippy::ignored_unit_patterns)]
|
#[allow(clippy::default_trait_access, clippy::ignored_unit_patterns)]
|
||||||
#[derive(TypedBuilder, Debug)]
|
#[derive(TypedBuilder, Debug)]
|
||||||
pub struct TcpRestartingMgr<EMH, MT, S, SP>
|
pub struct TcpRestartingMgr<EMH, MT, S, SP>
|
||||||
@ -1148,13 +1142,13 @@ where
|
|||||||
phantom_data: PhantomData<S>,
|
phantom_data: PhantomData<S>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "std")]
|
|
||||||
#[allow(clippy::type_complexity, clippy::too_many_lines)]
|
#[allow(clippy::type_complexity, clippy::too_many_lines)]
|
||||||
impl<EMH, MT, S, SP> TcpRestartingMgr<EMH, MT, S, SP>
|
impl<EMH, MT, S, SP> TcpRestartingMgr<EMH, MT, S, SP>
|
||||||
where
|
where
|
||||||
EMH: EventManagerHooksTuple<S> + Copy + Clone,
|
EMH: EventManagerHooksTuple<S> + Copy + Clone,
|
||||||
SP: ShMemProvider,
|
SP: ShMemProvider,
|
||||||
S: State + HasExecutions + HasMetadata + HasImported,
|
S: State + HasExecutions + HasMetadata + HasImported + HasCorpus,
|
||||||
|
S::Corpus: Corpus<Input = S::Input>,
|
||||||
MT: Monitor + Clone,
|
MT: Monitor + Clone,
|
||||||
{
|
{
|
||||||
/// Launch the restarting manager
|
/// Launch the restarting manager
|
||||||
|
@ -26,7 +26,6 @@ impl<A, B> CombinedExecutor<A, B> {
|
|||||||
A: Executor<EM, Z>,
|
A: Executor<EM, Z>,
|
||||||
B: Executor<EM, Z, State = <Self as UsesState>::State>,
|
B: Executor<EM, Z, State = <Self as UsesState>::State>,
|
||||||
EM: UsesState<State = <Self as UsesState>::State>,
|
EM: UsesState<State = <Self as UsesState>::State>,
|
||||||
Z: UsesState<State = <Self as UsesState>::State>,
|
|
||||||
{
|
{
|
||||||
Self { primary, secondary }
|
Self { primary, secondary }
|
||||||
}
|
}
|
||||||
@ -48,7 +47,6 @@ where
|
|||||||
B: Executor<EM, Z, State = <Self as UsesState>::State>,
|
B: Executor<EM, Z, State = <Self as UsesState>::State>,
|
||||||
Self::State: HasExecutions,
|
Self::State: HasExecutions,
|
||||||
EM: UsesState<State = <Self as UsesState>::State>,
|
EM: UsesState<State = <Self as UsesState>::State>,
|
||||||
Z: UsesState<State = <Self as UsesState>::State>,
|
|
||||||
{
|
{
|
||||||
fn run_target(
|
fn run_target(
|
||||||
&mut self,
|
&mut self,
|
||||||
|
@ -396,7 +396,6 @@ where
|
|||||||
S: State + HasExecutions + UsesInput,
|
S: State + HasExecutions + UsesInput,
|
||||||
T: CommandConfigurator<S::Input> + Debug,
|
T: CommandConfigurator<S::Input> + Debug,
|
||||||
OT: Debug + MatchName + ObserversTuple<S::Input, S>,
|
OT: Debug + MatchName + ObserversTuple<S::Input, S>,
|
||||||
Z: UsesState<State = S>,
|
|
||||||
{
|
{
|
||||||
fn run_target(
|
fn run_target(
|
||||||
&mut self,
|
&mut self,
|
||||||
@ -433,7 +432,6 @@ where
|
|||||||
S: State + HasExecutions + UsesInput,
|
S: State + HasExecutions + UsesInput,
|
||||||
T: CommandConfigurator<S::Input, Pid> + Debug,
|
T: CommandConfigurator<S::Input, Pid> + Debug,
|
||||||
OT: Debug + MatchName + ObserversTuple<S::Input, S>,
|
OT: Debug + MatchName + ObserversTuple<S::Input, S>,
|
||||||
Z: UsesState<State = S>,
|
|
||||||
HT: ExecutorHooksTuple<S>,
|
HT: ExecutorHooksTuple<S>,
|
||||||
{
|
{
|
||||||
/// Linux specific low level implementation, to directly handle `fork`, `exec` and use linux
|
/// Linux specific low level implementation, to directly handle `fork`, `exec` and use linux
|
||||||
@ -793,7 +791,6 @@ impl CommandExecutorBuilder {
|
|||||||
/// fn make_executor<EM, Z>() -> impl Executor<EM, Z>
|
/// fn make_executor<EM, Z>() -> impl Executor<EM, Z>
|
||||||
/// where
|
/// where
|
||||||
/// EM: UsesState,
|
/// EM: UsesState,
|
||||||
/// Z: UsesState<State = EM::State>,
|
|
||||||
/// EM::State: UsesInput<Input = BytesInput> + HasExecutions,
|
/// EM::State: UsesInput<Input = BytesInput> + HasExecutions,
|
||||||
/// {
|
/// {
|
||||||
/// MyExecutor.into_executor(())
|
/// MyExecutor.into_executor(())
|
||||||
|
@ -74,7 +74,6 @@ where
|
|||||||
<B as HasObservers>::Observers:
|
<B as HasObservers>::Observers:
|
||||||
ObserversTuple<<<A as UsesState>::State as UsesInput>::Input, <A as UsesState>::State>,
|
ObserversTuple<<<A as UsesState>::State as UsesInput>::Input, <A as UsesState>::State>,
|
||||||
DOT: DifferentialObserversTuple<A::Observers, B::Observers, A::Input, A::State> + MatchName,
|
DOT: DifferentialObserversTuple<A::Observers, B::Observers, A::Input, A::State> + MatchName,
|
||||||
Z: UsesState<State = <Self as UsesState>::State>,
|
|
||||||
{
|
{
|
||||||
fn run_target(
|
fn run_target(
|
||||||
&mut self,
|
&mut self,
|
||||||
|
@ -1588,7 +1588,6 @@ where
|
|||||||
S: State + HasExecutions,
|
S: State + HasExecutions,
|
||||||
TC: TargetBytesConverter<Input = S::Input>,
|
TC: TargetBytesConverter<Input = S::Input>,
|
||||||
EM: UsesState<State = S>,
|
EM: UsesState<State = S>,
|
||||||
Z: UsesState<State = S>,
|
|
||||||
{
|
{
|
||||||
#[inline]
|
#[inline]
|
||||||
fn run_target(
|
fn run_target(
|
||||||
|
@ -236,7 +236,7 @@ where
|
|||||||
EM: EventFirer<State = E::State> + EventRestarter<State = E::State>,
|
EM: EventFirer<State = E::State> + EventRestarter<State = E::State>,
|
||||||
OF: Feedback<EM, E::Input, E::Observers, E::State>,
|
OF: Feedback<EM, E::Input, E::Observers, E::State>,
|
||||||
E::State: HasExecutions + HasSolutions + HasCorpus,
|
E::State: HasExecutions + HasSolutions + HasCorpus,
|
||||||
Z: HasObjective<Objective = OF, State = E::State>,
|
Z: HasObjective<Objective = OF>,
|
||||||
<<E as UsesState>::State as HasSolutions>::Solutions: Corpus<Input = E::Input>, //delete me
|
<<E as UsesState>::State as HasSolutions>::Solutions: Corpus<Input = E::Input>, //delete me
|
||||||
<<<E as UsesState>::State as HasCorpus>::Corpus as Corpus>::Input: Clone, //delete me
|
<<<E as UsesState>::State as HasCorpus>::Corpus as Corpus>::Input: Clone, //delete me
|
||||||
{
|
{
|
||||||
@ -279,7 +279,7 @@ where
|
|||||||
EM: EventFirer<State = E::State> + EventRestarter<State = E::State>,
|
EM: EventFirer<State = E::State> + EventRestarter<State = E::State>,
|
||||||
OF: Feedback<EM, E::Input, E::Observers, E::State>,
|
OF: Feedback<EM, E::Input, E::Observers, E::State>,
|
||||||
E::State: State + HasExecutions + HasSolutions + HasCorpus,
|
E::State: State + HasExecutions + HasSolutions + HasCorpus,
|
||||||
Z: HasObjective<Objective = OF, State = E::State>,
|
Z: HasObjective<Objective = OF>,
|
||||||
<<E as UsesState>::State as HasSolutions>::Solutions: Corpus<Input = E::Input>, //delete me
|
<<E as UsesState>::State as HasSolutions>::Solutions: Corpus<Input = E::Input>, //delete me
|
||||||
<<<E as UsesState>::State as HasCorpus>::Corpus as Corpus>::Input: Clone, //delete me
|
<<<E as UsesState>::State as HasCorpus>::Corpus as Corpus>::Input: Clone, //delete me
|
||||||
{
|
{
|
||||||
@ -336,7 +336,7 @@ where
|
|||||||
EM: EventFirer<State = E::State> + EventRestarter<State = E::State>,
|
EM: EventFirer<State = E::State> + EventRestarter<State = E::State>,
|
||||||
OF: Feedback<EM, E::Input, E::Observers, E::State>,
|
OF: Feedback<EM, E::Input, E::Observers, E::State>,
|
||||||
E::State: HasExecutions + HasSolutions + HasCorpus,
|
E::State: HasExecutions + HasSolutions + HasCorpus,
|
||||||
Z: HasObjective<Objective = OF, State = E::State>,
|
Z: HasObjective<Objective = OF>,
|
||||||
{
|
{
|
||||||
#[cfg_attr(miri, allow(unused_variables))]
|
#[cfg_attr(miri, allow(unused_variables))]
|
||||||
let ret = Self {
|
let ret = Self {
|
||||||
|
@ -84,7 +84,7 @@ pub mod unix_signal_handler {
|
|||||||
EM: EventFirer<State = E::State> + EventRestarter<State = E::State>,
|
EM: EventFirer<State = E::State> + EventRestarter<State = E::State>,
|
||||||
OF: Feedback<EM, E::Input, E::Observers, E::State>,
|
OF: Feedback<EM, E::Input, E::Observers, E::State>,
|
||||||
E::State: HasExecutions + HasSolutions + HasCorpus,
|
E::State: HasExecutions + HasSolutions + HasCorpus,
|
||||||
Z: HasObjective<Objective = OF, State = E::State>,
|
Z: HasObjective<Objective = OF>,
|
||||||
<<E as UsesState>::State as HasSolutions>::Solutions: Corpus<Input = E::Input>, //delete me
|
<<E as UsesState>::State as HasSolutions>::Solutions: Corpus<Input = E::Input>, //delete me
|
||||||
<<<E as UsesState>::State as HasCorpus>::Corpus as Corpus>::Input: Clone, //delete me
|
<<<E as UsesState>::State as HasCorpus>::Corpus as Corpus>::Input: Clone, //delete me
|
||||||
{
|
{
|
||||||
@ -134,7 +134,7 @@ pub mod unix_signal_handler {
|
|||||||
EM: EventFirer<State = E::State> + EventRestarter<State = E::State>,
|
EM: EventFirer<State = E::State> + EventRestarter<State = E::State>,
|
||||||
OF: Feedback<EM, E::Input, E::Observers, E::State>,
|
OF: Feedback<EM, E::Input, E::Observers, E::State>,
|
||||||
E::State: HasExecutions + HasSolutions + HasCorpus,
|
E::State: HasExecutions + HasSolutions + HasCorpus,
|
||||||
Z: HasObjective<Objective = OF, State = E::State>,
|
Z: HasObjective<Objective = OF>,
|
||||||
<<E as UsesState>::State as HasSolutions>::Solutions: Corpus<Input = E::Input>, //delete me
|
<<E as UsesState>::State as HasSolutions>::Solutions: Corpus<Input = E::Input>, //delete me
|
||||||
<<<E as UsesState>::State as HasCorpus>::Corpus as Corpus>::Input: Clone, //delete me
|
<<<E as UsesState>::State as HasCorpus>::Corpus as Corpus>::Input: Clone, //delete me
|
||||||
{
|
{
|
||||||
@ -192,7 +192,7 @@ pub mod unix_signal_handler {
|
|||||||
EM: EventFirer<State = E::State> + EventRestarter<State = E::State>,
|
EM: EventFirer<State = E::State> + EventRestarter<State = E::State>,
|
||||||
OF: Feedback<EM, E::Input, E::Observers, E::State>,
|
OF: Feedback<EM, E::Input, E::Observers, E::State>,
|
||||||
E::State: HasExecutions + HasSolutions + HasCorpus,
|
E::State: HasExecutions + HasSolutions + HasCorpus,
|
||||||
Z: HasObjective<Objective = OF, State = E::State>,
|
Z: HasObjective<Objective = OF>,
|
||||||
<<E as UsesState>::State as HasSolutions>::Solutions: Corpus<Input = E::Input>, //delete me
|
<<E as UsesState>::State as HasSolutions>::Solutions: Corpus<Input = E::Input>, //delete me
|
||||||
<<<E as UsesState>::State as HasCorpus>::Corpus as Corpus>::Input: Clone, //delete me
|
<<<E as UsesState>::State as HasCorpus>::Corpus as Corpus>::Input: Clone, //delete me
|
||||||
{
|
{
|
||||||
|
@ -31,7 +31,7 @@ pub mod windows_asan_handler {
|
|||||||
OF: Feedback<EM, E::Input, E::Observers, E::State>,
|
OF: Feedback<EM, E::Input, E::Observers, E::State>,
|
||||||
E::State: HasExecutions + HasSolutions + HasCorpus,
|
E::State: HasExecutions + HasSolutions + HasCorpus,
|
||||||
E::Observers: ObserversTuple<<E::State as UsesInput>::Input, E::State>,
|
E::Observers: ObserversTuple<<E::State as UsesInput>::Input, E::State>,
|
||||||
Z: HasObjective<Objective = OF, State = E::State>,
|
Z: HasObjective<Objective = OF>,
|
||||||
<<E as UsesState>::State as HasSolutions>::Solutions: Corpus<Input = E::Input>, //delete me
|
<<E as UsesState>::State as HasSolutions>::Solutions: Corpus<Input = E::Input>, //delete me
|
||||||
<<<E as UsesState>::State as HasCorpus>::Corpus as Corpus>::Input: Clone, //delete me
|
<<<E as UsesState>::State as HasCorpus>::Corpus as Corpus>::Input: Clone, //delete me
|
||||||
{
|
{
|
||||||
@ -190,7 +190,7 @@ pub mod windows_exception_handler {
|
|||||||
OF: Feedback<EM, E::Input, E::Observers, E::State>,
|
OF: Feedback<EM, E::Input, E::Observers, E::State>,
|
||||||
E::State: HasExecutions + HasSolutions + HasCorpus,
|
E::State: HasExecutions + HasSolutions + HasCorpus,
|
||||||
E::Observers: ObserversTuple<<E::State as UsesInput>::Input, E::State>,
|
E::Observers: ObserversTuple<<E::State as UsesInput>::Input, E::State>,
|
||||||
Z: HasObjective<Objective = OF, State = E::State>,
|
Z: HasObjective<Objective = OF>,
|
||||||
<<E as UsesState>::State as HasSolutions>::Solutions: Corpus<Input = E::Input>, //delete me
|
<<E as UsesState>::State as HasSolutions>::Solutions: Corpus<Input = E::Input>, //delete me
|
||||||
<<<E as UsesState>::State as HasCorpus>::Corpus as Corpus>::Input: Clone, //delete me
|
<<<E as UsesState>::State as HasCorpus>::Corpus as Corpus>::Input: Clone, //delete me
|
||||||
{
|
{
|
||||||
@ -253,7 +253,7 @@ pub mod windows_exception_handler {
|
|||||||
EM: EventFirer<State = E::State> + EventRestarter<State = E::State>,
|
EM: EventFirer<State = E::State> + EventRestarter<State = E::State>,
|
||||||
OF: Feedback<EM, E::Input, E::Observers, E::State>,
|
OF: Feedback<EM, E::Input, E::Observers, E::State>,
|
||||||
E::State: State + HasExecutions + HasSolutions + HasCorpus,
|
E::State: State + HasExecutions + HasSolutions + HasCorpus,
|
||||||
Z: HasObjective<Objective = OF, State = E::State>,
|
Z: HasObjective<Objective = OF>,
|
||||||
<<E as UsesState>::State as HasSolutions>::Solutions: Corpus<Input = E::Input>, //delete me
|
<<E as UsesState>::State as HasSolutions>::Solutions: Corpus<Input = E::Input>, //delete me
|
||||||
<<<E as UsesState>::State as HasCorpus>::Corpus as Corpus>::Input: Clone, //delete me
|
<<<E as UsesState>::State as HasCorpus>::Corpus as Corpus>::Input: Clone, //delete me
|
||||||
{
|
{
|
||||||
@ -326,7 +326,7 @@ pub mod windows_exception_handler {
|
|||||||
EM: EventFirer<State = E::State> + EventRestarter<State = E::State>,
|
EM: EventFirer<State = E::State> + EventRestarter<State = E::State>,
|
||||||
OF: Feedback<EM, E::Input, E::Observers, E::State>,
|
OF: Feedback<EM, E::Input, E::Observers, E::State>,
|
||||||
E::State: HasExecutions + HasSolutions + HasCorpus,
|
E::State: HasExecutions + HasSolutions + HasCorpus,
|
||||||
Z: HasObjective<Objective = OF, State = E::State>,
|
Z: HasObjective<Objective = OF>,
|
||||||
<<E as UsesState>::State as HasSolutions>::Solutions: Corpus<Input = E::Input>, //delete me
|
<<E as UsesState>::State as HasSolutions>::Solutions: Corpus<Input = E::Input>, //delete me
|
||||||
<<<E as UsesState>::State as HasCorpus>::Corpus as Corpus>::Input: Clone, //delete me
|
<<<E as UsesState>::State as HasCorpus>::Corpus as Corpus>::Input: Clone, //delete me
|
||||||
{
|
{
|
||||||
|
@ -161,7 +161,7 @@ where
|
|||||||
EM: EventFirer<State = S> + EventRestarter,
|
EM: EventFirer<State = S> + EventRestarter,
|
||||||
OF: Feedback<EM, E::Input, E::Observers, S>,
|
OF: Feedback<EM, E::Input, E::Observers, S>,
|
||||||
S: State,
|
S: State,
|
||||||
Z: HasObjective<Objective = OF, State = S>,
|
Z: HasObjective<Objective = OF>,
|
||||||
<<E as UsesState>::State as HasSolutions>::Solutions: Corpus<Input = E::Input>, //delete me
|
<<E as UsesState>::State as HasSolutions>::Solutions: Corpus<Input = E::Input>, //delete me
|
||||||
<<<E as UsesState>::State as HasCorpus>::Corpus as Corpus>::Input: Clone, //delete me
|
<<<E as UsesState>::State as HasCorpus>::Corpus as Corpus>::Input: Clone, //delete me
|
||||||
{
|
{
|
||||||
@ -191,7 +191,7 @@ where
|
|||||||
EM: EventFirer<State = S> + EventRestarter,
|
EM: EventFirer<State = S> + EventRestarter,
|
||||||
OF: Feedback<EM, E::Input, E::Observers, S>,
|
OF: Feedback<EM, E::Input, E::Observers, S>,
|
||||||
S: State,
|
S: State,
|
||||||
Z: HasObjective<Objective = OF, State = S>,
|
Z: HasObjective<Objective = OF>,
|
||||||
<<E as UsesState>::State as HasSolutions>::Solutions: Corpus<Input = E::Input>, //delete me
|
<<E as UsesState>::State as HasSolutions>::Solutions: Corpus<Input = E::Input>, //delete me
|
||||||
<<<E as UsesState>::State as HasCorpus>::Corpus as Corpus>::Input: Clone, //delete me
|
<<<E as UsesState>::State as HasCorpus>::Corpus as Corpus>::Input: Clone, //delete me
|
||||||
{
|
{
|
||||||
@ -224,7 +224,7 @@ where
|
|||||||
EM: EventFirer<State = S> + EventRestarter,
|
EM: EventFirer<State = S> + EventRestarter,
|
||||||
OF: Feedback<EM, E::Input, E::Observers, S>,
|
OF: Feedback<EM, E::Input, E::Observers, S>,
|
||||||
S: State,
|
S: State,
|
||||||
Z: HasObjective<Objective = OF, State = S>,
|
Z: HasObjective<Objective = OF>,
|
||||||
<<E as UsesState>::State as HasSolutions>::Solutions: Corpus<Input = E::Input>, //delete me
|
<<E as UsesState>::State as HasSolutions>::Solutions: Corpus<Input = E::Input>, //delete me
|
||||||
<<<E as UsesState>::State as HasCorpus>::Corpus as Corpus>::Input: Clone, //delete me
|
<<<E as UsesState>::State as HasCorpus>::Corpus as Corpus>::Input: Clone, //delete me
|
||||||
{
|
{
|
||||||
|
@ -106,7 +106,6 @@ where
|
|||||||
HT: ExecutorHooksTuple<S>,
|
HT: ExecutorHooksTuple<S>,
|
||||||
OT: ObserversTuple<S::Input, S>,
|
OT: ObserversTuple<S::Input, S>,
|
||||||
S: State + HasExecutions,
|
S: State + HasExecutions,
|
||||||
Z: UsesState<State = S>,
|
|
||||||
{
|
{
|
||||||
fn run_target(
|
fn run_target(
|
||||||
&mut self,
|
&mut self,
|
||||||
@ -173,7 +172,7 @@ where
|
|||||||
EM: EventFirer<State = S> + EventRestarter,
|
EM: EventFirer<State = S> + EventRestarter,
|
||||||
OF: Feedback<EM, S::Input, OT, S>,
|
OF: Feedback<EM, S::Input, OT, S>,
|
||||||
S: State,
|
S: State,
|
||||||
Z: HasObjective<Objective = OF, State = S>,
|
Z: HasObjective<Objective = OF>,
|
||||||
{
|
{
|
||||||
Self::with_timeout_generic(
|
Self::with_timeout_generic(
|
||||||
tuple_list!(),
|
tuple_list!(),
|
||||||
@ -201,7 +200,7 @@ where
|
|||||||
EM: EventFirer<State = S> + EventRestarter,
|
EM: EventFirer<State = S> + EventRestarter,
|
||||||
OF: Feedback<EM, S::Input, OT, S>,
|
OF: Feedback<EM, S::Input, OT, S>,
|
||||||
S: State,
|
S: State,
|
||||||
Z: HasObjective<Objective = OF, State = S>,
|
Z: HasObjective<Objective = OF>,
|
||||||
<S as HasSolutions>::Solutions: Corpus<Input = S::Input>, //delete me
|
<S as HasSolutions>::Solutions: Corpus<Input = S::Input>, //delete me
|
||||||
<<S as HasCorpus>::Corpus as Corpus>::Input: Clone, //delete me
|
<<S as HasCorpus>::Corpus as Corpus>::Input: Clone, //delete me
|
||||||
{
|
{
|
||||||
@ -242,7 +241,7 @@ where
|
|||||||
EM: EventFirer<State = S> + EventRestarter,
|
EM: EventFirer<State = S> + EventRestarter,
|
||||||
OF: Feedback<EM, S::Input, OT, S>,
|
OF: Feedback<EM, S::Input, OT, S>,
|
||||||
S: State,
|
S: State,
|
||||||
Z: HasObjective<Objective = OF, State = S>,
|
Z: HasObjective<Objective = OF>,
|
||||||
<S as HasSolutions>::Solutions: Corpus<Input = S::Input>, //delete me
|
<S as HasSolutions>::Solutions: Corpus<Input = S::Input>, //delete me
|
||||||
<<S as HasCorpus>::Corpus as Corpus>::Input: Clone, //delete me
|
<<S as HasCorpus>::Corpus as Corpus>::Input: Clone, //delete me
|
||||||
{
|
{
|
||||||
@ -287,7 +286,7 @@ where
|
|||||||
EM: EventFirer<State = S> + EventRestarter,
|
EM: EventFirer<State = S> + EventRestarter,
|
||||||
OF: Feedback<EM, S::Input, OT, S>,
|
OF: Feedback<EM, S::Input, OT, S>,
|
||||||
S: State,
|
S: State,
|
||||||
Z: HasObjective<Objective = OF, State = S>,
|
Z: HasObjective<Objective = OF>,
|
||||||
{
|
{
|
||||||
Self::with_timeout_generic(
|
Self::with_timeout_generic(
|
||||||
user_hooks,
|
user_hooks,
|
||||||
@ -316,7 +315,7 @@ where
|
|||||||
EM: EventFirer<State = S> + EventRestarter,
|
EM: EventFirer<State = S> + EventRestarter,
|
||||||
OF: Feedback<EM, S::Input, OT, S>,
|
OF: Feedback<EM, S::Input, OT, S>,
|
||||||
S: State,
|
S: State,
|
||||||
Z: HasObjective<Objective = OF, State = S>,
|
Z: HasObjective<Objective = OF>,
|
||||||
<S as HasSolutions>::Solutions: Corpus<Input = S::Input>, //delete me
|
<S as HasSolutions>::Solutions: Corpus<Input = S::Input>, //delete me
|
||||||
<<S as HasCorpus>::Corpus as Corpus>::Input: Clone, //delete me
|
<<S as HasCorpus>::Corpus as Corpus>::Input: Clone, //delete me
|
||||||
{
|
{
|
||||||
@ -353,7 +352,7 @@ where
|
|||||||
EM: EventFirer<State = S> + EventRestarter,
|
EM: EventFirer<State = S> + EventRestarter,
|
||||||
OF: Feedback<EM, S::Input, OT, S>,
|
OF: Feedback<EM, S::Input, OT, S>,
|
||||||
S: State,
|
S: State,
|
||||||
Z: HasObjective<Objective = OF, State = S>,
|
Z: HasObjective<Objective = OF>,
|
||||||
<S as HasSolutions>::Solutions: Corpus<Input = S::Input>, //delete me
|
<S as HasSolutions>::Solutions: Corpus<Input = S::Input>, //delete me
|
||||||
<<S as HasCorpus>::Corpus as Corpus>::Input: Clone, //delete me
|
<<S as HasCorpus>::Corpus as Corpus>::Input: Clone, //delete me
|
||||||
{
|
{
|
||||||
@ -442,7 +441,7 @@ pub fn run_observers_and_save_state<E, EM, OF, Z>(
|
|||||||
EM: EventFirer<State = E::State> + EventRestarter<State = E::State>,
|
EM: EventFirer<State = E::State> + EventRestarter<State = E::State>,
|
||||||
OF: Feedback<EM, E::Input, E::Observers, E::State>,
|
OF: Feedback<EM, E::Input, E::Observers, E::State>,
|
||||||
E::State: HasExecutions + HasSolutions + HasCorpus + HasCurrentTestcase,
|
E::State: HasExecutions + HasSolutions + HasCorpus + HasCurrentTestcase,
|
||||||
Z: HasObjective<Objective = OF, State = E::State>,
|
Z: HasObjective<Objective = OF>,
|
||||||
<<E as UsesState>::State as HasSolutions>::Solutions: Corpus<Input = E::Input>, //delete me
|
<<E as UsesState>::State as HasSolutions>::Solutions: Corpus<Input = E::Input>, //delete me
|
||||||
{
|
{
|
||||||
let mut observers = executor.observers_mut();
|
let mut observers = executor.observers_mut();
|
||||||
@ -503,9 +502,9 @@ where
|
|||||||
EM: EventFirer<State = E::State> + EventRestarter<State = E::State>,
|
EM: EventFirer<State = E::State> + EventRestarter<State = E::State>,
|
||||||
OF: Feedback<EM, E::Input, E::Observers, E::State>,
|
OF: Feedback<EM, E::Input, E::Observers, E::State>,
|
||||||
E::State: HasExecutions + HasSolutions + HasCorpus + HasCurrentTestcase,
|
E::State: HasExecutions + HasSolutions + HasCorpus + HasCurrentTestcase,
|
||||||
Z: HasObjective<Objective = OF, State = E::State>
|
Z: HasObjective<Objective = OF>
|
||||||
+ HasScheduler<State = E::State>
|
+ HasScheduler<E::Input, E::State>
|
||||||
+ ExecutionProcessor<EM, E::Observers>,
|
+ ExecutionProcessor<EM, E::Input, E::Observers, E::State>,
|
||||||
<<E as UsesState>::State as HasSolutions>::Solutions: Corpus<Input = E::Input>, //delete me
|
<<E as UsesState>::State as HasSolutions>::Solutions: Corpus<Input = E::Input>, //delete me
|
||||||
{
|
{
|
||||||
let data = &raw mut GLOBAL_STATE;
|
let data = &raw mut GLOBAL_STATE;
|
||||||
@ -533,7 +532,7 @@ where
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use libafl_bolts::tuples::tuple_list;
|
use libafl_bolts::{rands::XkcdRand, tuples::tuple_list};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
corpus::InMemoryCorpus,
|
corpus::InMemoryCorpus,
|
||||||
@ -542,7 +541,7 @@ mod tests {
|
|||||||
feedbacks::CrashFeedback,
|
feedbacks::CrashFeedback,
|
||||||
inputs::{NopInput, UsesInput},
|
inputs::{NopInput, UsesInput},
|
||||||
schedulers::RandScheduler,
|
schedulers::RandScheduler,
|
||||||
state::StdState,
|
state::{NopState, StdState},
|
||||||
StdFuzzer,
|
StdFuzzer,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -554,16 +553,16 @@ mod tests {
|
|||||||
#[allow(clippy::let_unit_value)]
|
#[allow(clippy::let_unit_value)]
|
||||||
fn test_inmem_exec() {
|
fn test_inmem_exec() {
|
||||||
let mut harness = |_buf: &NopInput| ExitKind::Ok;
|
let mut harness = |_buf: &NopInput| ExitKind::Ok;
|
||||||
let rand = libafl_bolts::rands::XkcdRand::new();
|
let rand = XkcdRand::new();
|
||||||
let corpus = InMemoryCorpus::<NopInput>::new();
|
let corpus = InMemoryCorpus::<NopInput>::new();
|
||||||
let solutions = InMemoryCorpus::new();
|
let solutions = InMemoryCorpus::new();
|
||||||
let mut objective = CrashFeedback::new();
|
let mut objective = CrashFeedback::new();
|
||||||
let mut feedback = tuple_list!();
|
let mut feedback = tuple_list!();
|
||||||
let sche = RandScheduler::new();
|
let sche: RandScheduler<NopState<NopInput>> = RandScheduler::new();
|
||||||
let mut mgr = NopEventManager::new();
|
let mut mgr = NopEventManager::new();
|
||||||
let mut state =
|
let mut state =
|
||||||
StdState::new(rand, corpus, solutions, &mut feedback, &mut objective).unwrap();
|
StdState::new(rand, corpus, solutions, &mut feedback, &mut objective).unwrap();
|
||||||
let mut fuzzer = StdFuzzer::<_, _, _, _>::new(sche, feedback, objective);
|
let mut fuzzer = StdFuzzer::<_, _, _>::new(sche, feedback, objective);
|
||||||
|
|
||||||
let mut in_process_executor = InProcessExecutor::new(
|
let mut in_process_executor = InProcessExecutor::new(
|
||||||
&mut harness,
|
&mut harness,
|
||||||
|
@ -98,7 +98,6 @@ where
|
|||||||
HT: ExecutorHooksTuple<S>,
|
HT: ExecutorHooksTuple<S>,
|
||||||
OT: ObserversTuple<S::Input, S>,
|
OT: ObserversTuple<S::Input, S>,
|
||||||
S: State + HasExecutions,
|
S: State + HasExecutions,
|
||||||
Z: UsesState<State = S>,
|
|
||||||
{
|
{
|
||||||
fn run_target(
|
fn run_target(
|
||||||
&mut self,
|
&mut self,
|
||||||
@ -165,7 +164,7 @@ where
|
|||||||
EM: EventFirer<State = S> + EventRestarter,
|
EM: EventFirer<State = S> + EventRestarter,
|
||||||
OF: Feedback<EM, S::Input, OT, S>,
|
OF: Feedback<EM, S::Input, OT, S>,
|
||||||
S: State,
|
S: State,
|
||||||
Z: HasObjective<Objective = OF, State = S>,
|
Z: HasObjective<Objective = OF>,
|
||||||
{
|
{
|
||||||
Self::with_timeout_generic(
|
Self::with_timeout_generic(
|
||||||
tuple_list!(),
|
tuple_list!(),
|
||||||
@ -195,7 +194,7 @@ where
|
|||||||
EM: EventFirer<State = S> + EventRestarter,
|
EM: EventFirer<State = S> + EventRestarter,
|
||||||
OF: Feedback<EM, S::Input, OT, S>,
|
OF: Feedback<EM, S::Input, OT, S>,
|
||||||
S: State,
|
S: State,
|
||||||
Z: HasObjective<Objective = OF, State = S>,
|
Z: HasObjective<Objective = OF>,
|
||||||
<S as HasSolutions>::Solutions: Corpus<Input = S::Input>, //delete me
|
<S as HasSolutions>::Solutions: Corpus<Input = S::Input>, //delete me
|
||||||
<<S as HasCorpus>::Corpus as Corpus>::Input: Clone, //delete me
|
<<S as HasCorpus>::Corpus as Corpus>::Input: Clone, //delete me
|
||||||
{
|
{
|
||||||
@ -238,7 +237,7 @@ where
|
|||||||
EM: EventFirer<State = S> + EventRestarter,
|
EM: EventFirer<State = S> + EventRestarter,
|
||||||
OF: Feedback<EM, S::Input, OT, S>,
|
OF: Feedback<EM, S::Input, OT, S>,
|
||||||
S: State,
|
S: State,
|
||||||
Z: HasObjective<Objective = OF, State = S>,
|
Z: HasObjective<Objective = OF>,
|
||||||
<S as HasSolutions>::Solutions: Corpus<Input = S::Input>, //delete me
|
<S as HasSolutions>::Solutions: Corpus<Input = S::Input>, //delete me
|
||||||
<<S as HasCorpus>::Corpus as Corpus>::Input: Clone, //delete me
|
<<S as HasCorpus>::Corpus as Corpus>::Input: Clone, //delete me
|
||||||
{
|
{
|
||||||
@ -303,7 +302,7 @@ where
|
|||||||
EM: EventFirer<State = S> + EventRestarter,
|
EM: EventFirer<State = S> + EventRestarter,
|
||||||
OF: Feedback<EM, S::Input, OT, S>,
|
OF: Feedback<EM, S::Input, OT, S>,
|
||||||
S: State,
|
S: State,
|
||||||
Z: HasObjective<Objective = OF, State = S>,
|
Z: HasObjective<Objective = OF>,
|
||||||
{
|
{
|
||||||
Self::with_timeout_generic(
|
Self::with_timeout_generic(
|
||||||
user_hooks,
|
user_hooks,
|
||||||
@ -334,7 +333,7 @@ where
|
|||||||
EM: EventFirer<State = S> + EventRestarter,
|
EM: EventFirer<State = S> + EventRestarter,
|
||||||
OF: Feedback<EM, S::Input, OT, S>,
|
OF: Feedback<EM, S::Input, OT, S>,
|
||||||
S: State,
|
S: State,
|
||||||
Z: HasObjective<Objective = OF, State = S>,
|
Z: HasObjective<Objective = OF>,
|
||||||
<S as HasSolutions>::Solutions: Corpus<Input = S::Input>, //delete me
|
<S as HasSolutions>::Solutions: Corpus<Input = S::Input>, //delete me
|
||||||
<<S as HasCorpus>::Corpus as Corpus>::Input: Clone, //delete me
|
<<S as HasCorpus>::Corpus as Corpus>::Input: Clone, //delete me
|
||||||
{
|
{
|
||||||
@ -373,7 +372,7 @@ where
|
|||||||
EM: EventFirer<State = S> + EventRestarter,
|
EM: EventFirer<State = S> + EventRestarter,
|
||||||
OF: Feedback<EM, S::Input, OT, S>,
|
OF: Feedback<EM, S::Input, OT, S>,
|
||||||
S: State,
|
S: State,
|
||||||
Z: HasObjective<Objective = OF, State = S>,
|
Z: HasObjective<Objective = OF>,
|
||||||
<S as HasSolutions>::Solutions: Corpus<Input = S::Input>, //delete me
|
<S as HasSolutions>::Solutions: Corpus<Input = S::Input>, //delete me
|
||||||
<<S as HasCorpus>::Corpus as Corpus>::Input: Clone, //delete me
|
<<S as HasCorpus>::Corpus as Corpus>::Input: Clone, //delete me
|
||||||
{
|
{
|
||||||
|
@ -121,7 +121,6 @@ where
|
|||||||
SP: ShMemProvider,
|
SP: ShMemProvider,
|
||||||
HT: ExecutorHooksTuple<S>,
|
HT: ExecutorHooksTuple<S>,
|
||||||
EM: EventFirer<State = S> + EventRestarter<State = S>,
|
EM: EventFirer<State = S> + EventRestarter<State = S>,
|
||||||
Z: UsesState<State = S>,
|
|
||||||
{
|
{
|
||||||
pub(super) unsafe fn pre_run_target_child(
|
pub(super) unsafe fn pre_run_target_child(
|
||||||
&mut self,
|
&mut self,
|
||||||
|
@ -55,7 +55,7 @@ where
|
|||||||
EM: EventFirer<State = S> + EventRestarter<State = S>,
|
EM: EventFirer<State = S> + EventRestarter<State = S>,
|
||||||
OF: Feedback<EM, S::Input, OT, S>,
|
OF: Feedback<EM, S::Input, OT, S>,
|
||||||
S: HasSolutions,
|
S: HasSolutions,
|
||||||
Z: HasObjective<Objective = OF, State = S>,
|
Z: HasObjective<Objective = OF>,
|
||||||
{
|
{
|
||||||
#[allow(clippy::too_many_arguments)]
|
#[allow(clippy::too_many_arguments)]
|
||||||
/// The constructor for `InProcessForkExecutor`
|
/// The constructor for `InProcessForkExecutor`
|
||||||
@ -93,7 +93,6 @@ where
|
|||||||
SP: ShMemProvider,
|
SP: ShMemProvider,
|
||||||
HT: ExecutorHooksTuple<S>,
|
HT: ExecutorHooksTuple<S>,
|
||||||
EM: UsesState<State = S>,
|
EM: UsesState<State = S>,
|
||||||
Z: UsesState<State = S>,
|
|
||||||
{
|
{
|
||||||
harness_fn: &'a mut H,
|
harness_fn: &'a mut H,
|
||||||
inner: GenericInProcessForkExecutorInner<HT, OT, S, SP, EM, Z>,
|
inner: GenericInProcessForkExecutorInner<HT, OT, S, SP, EM, Z>,
|
||||||
@ -107,7 +106,6 @@ where
|
|||||||
SP: ShMemProvider,
|
SP: ShMemProvider,
|
||||||
HT: ExecutorHooksTuple<S> + Debug,
|
HT: ExecutorHooksTuple<S> + Debug,
|
||||||
EM: UsesState<State = S>,
|
EM: UsesState<State = S>,
|
||||||
Z: UsesState<State = S>,
|
|
||||||
{
|
{
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
|
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
|
||||||
@ -135,7 +133,6 @@ where
|
|||||||
SP: ShMemProvider,
|
SP: ShMemProvider,
|
||||||
HT: ExecutorHooksTuple<S>,
|
HT: ExecutorHooksTuple<S>,
|
||||||
EM: UsesState<State = S>,
|
EM: UsesState<State = S>,
|
||||||
Z: UsesState<State = S>,
|
|
||||||
{
|
{
|
||||||
type State = S;
|
type State = S;
|
||||||
}
|
}
|
||||||
@ -149,7 +146,6 @@ where
|
|||||||
SP: ShMemProvider,
|
SP: ShMemProvider,
|
||||||
HT: ExecutorHooksTuple<S>,
|
HT: ExecutorHooksTuple<S>,
|
||||||
EM: EventFirer<State = S> + EventRestarter<State = S>,
|
EM: EventFirer<State = S> + EventRestarter<State = S>,
|
||||||
Z: UsesState<State = S>,
|
|
||||||
{
|
{
|
||||||
#[allow(unreachable_code)]
|
#[allow(unreachable_code)]
|
||||||
#[inline]
|
#[inline]
|
||||||
@ -191,7 +187,7 @@ where
|
|||||||
EM: EventFirer<State = S> + EventRestarter<State = S>,
|
EM: EventFirer<State = S> + EventRestarter<State = S>,
|
||||||
OF: Feedback<EM, S::Input, OT, S>,
|
OF: Feedback<EM, S::Input, OT, S>,
|
||||||
S: State + HasSolutions,
|
S: State + HasSolutions,
|
||||||
Z: HasObjective<Objective = OF, State = S>,
|
Z: HasObjective<Objective = OF>,
|
||||||
{
|
{
|
||||||
/// Creates a new [`GenericInProcessForkExecutor`] with custom hooks
|
/// Creates a new [`GenericInProcessForkExecutor`] with custom hooks
|
||||||
#[allow(clippy::too_many_arguments)]
|
#[allow(clippy::too_many_arguments)]
|
||||||
@ -242,7 +238,6 @@ where
|
|||||||
OT: ObserversTuple<S::Input, S>,
|
OT: ObserversTuple<S::Input, S>,
|
||||||
SP: ShMemProvider,
|
SP: ShMemProvider,
|
||||||
EM: UsesState<State = S>,
|
EM: UsesState<State = S>,
|
||||||
Z: UsesState<State = S>,
|
|
||||||
{
|
{
|
||||||
type Observers = OT;
|
type Observers = OT;
|
||||||
#[inline]
|
#[inline]
|
||||||
|
@ -124,7 +124,7 @@ where
|
|||||||
OT: ObserversTuple<S::Input, S> + Debug,
|
OT: ObserversTuple<S::Input, S> + Debug,
|
||||||
S: State + HasExecutions,
|
S: State + HasExecutions,
|
||||||
SP: ShMemProvider,
|
SP: ShMemProvider,
|
||||||
Z: HasObjective<Objective = OF, State = S>,
|
Z: HasObjective<Objective = OF>,
|
||||||
{
|
{
|
||||||
#[allow(unreachable_code)]
|
#[allow(unreachable_code)]
|
||||||
#[inline]
|
#[inline]
|
||||||
|
@ -120,7 +120,6 @@ pub trait HasObservers {
|
|||||||
pub trait Executor<EM, Z>: UsesState
|
pub trait Executor<EM, Z>: UsesState
|
||||||
where
|
where
|
||||||
EM: UsesState<State = Self::State>,
|
EM: UsesState<State = Self::State>,
|
||||||
Z: UsesState<State = Self::State>,
|
|
||||||
{
|
{
|
||||||
/// Instruct the target about the input and run
|
/// Instruct the target about the input and run
|
||||||
fn run_target(
|
fn run_target(
|
||||||
@ -209,7 +208,6 @@ mod test {
|
|||||||
EM: UsesState<State = S>,
|
EM: UsesState<State = S>,
|
||||||
S: State + HasExecutions,
|
S: State + HasExecutions,
|
||||||
S::Input: HasTargetBytes,
|
S::Input: HasTargetBytes,
|
||||||
Z: UsesState<State = S>,
|
|
||||||
{
|
{
|
||||||
fn run_target(
|
fn run_target(
|
||||||
&mut self,
|
&mut self,
|
||||||
|
@ -68,7 +68,6 @@ where
|
|||||||
E: Executor<EM, Z> + HasObservers,
|
E: Executor<EM, Z> + HasObservers,
|
||||||
SOT: ObserversTuple<Self::Input, Self::State>,
|
SOT: ObserversTuple<Self::Input, Self::State>,
|
||||||
EM: UsesState<State = Self::State>,
|
EM: UsesState<State = Self::State>,
|
||||||
Z: UsesState<State = Self::State>,
|
|
||||||
{
|
{
|
||||||
fn run_target(
|
fn run_target(
|
||||||
&mut self,
|
&mut self,
|
||||||
|
@ -23,7 +23,6 @@ impl<E, EM, OT, Z> Executor<EM, Z> for WithObservers<E, OT>
|
|||||||
where
|
where
|
||||||
E: Executor<EM, Z>,
|
E: Executor<EM, Z>,
|
||||||
EM: UsesState<State = Self::State>,
|
EM: UsesState<State = Self::State>,
|
||||||
Z: UsesState<State = Self::State>,
|
|
||||||
{
|
{
|
||||||
fn run_target(
|
fn run_target(
|
||||||
&mut self,
|
&mut self,
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
//! The `Fuzzer` is the main struct for a fuzz campaign.
|
//! The `Fuzzer` is the main struct for a fuzz campaign.
|
||||||
|
|
||||||
use alloc::{string::ToString, vec::Vec};
|
use alloc::{string::ToString, vec::Vec};
|
||||||
use core::{fmt::Debug, marker::PhantomData, time::Duration};
|
use core::{fmt::Debug, time::Duration};
|
||||||
|
|
||||||
use libafl_bolts::current_time;
|
use libafl_bolts::{current_time, tuples::MatchName};
|
||||||
use serde::{de::DeserializeOwned, Serialize};
|
use serde::Serialize;
|
||||||
|
|
||||||
#[cfg(feature = "introspection")]
|
#[cfg(feature = "introspection")]
|
||||||
use crate::monitors::PerfFeature;
|
use crate::monitors::PerfFeature;
|
||||||
@ -13,7 +13,7 @@ use crate::{
|
|||||||
events::{Event, EventConfig, EventFirer, EventProcessor, ProgressReporter},
|
events::{Event, EventConfig, EventFirer, EventProcessor, ProgressReporter},
|
||||||
executors::{Executor, ExitKind, HasObservers},
|
executors::{Executor, ExitKind, HasObservers},
|
||||||
feedbacks::Feedback,
|
feedbacks::Feedback,
|
||||||
inputs::UsesInput,
|
inputs::{Input, UsesInput},
|
||||||
mark_feature_time,
|
mark_feature_time,
|
||||||
observers::ObserversTuple,
|
observers::ObserversTuple,
|
||||||
schedulers::Scheduler,
|
schedulers::Scheduler,
|
||||||
@ -21,7 +21,7 @@ use crate::{
|
|||||||
start_timer,
|
start_timer,
|
||||||
state::{
|
state::{
|
||||||
HasCorpus, HasCurrentTestcase, HasExecutions, HasLastFoundTime, HasLastReportTime,
|
HasCorpus, HasCurrentTestcase, HasExecutions, HasLastFoundTime, HasLastReportTime,
|
||||||
HasSolutions, State, Stoppable, UsesState,
|
HasSolutions, MaybeHasClientPerfMonitor, State, UsesState,
|
||||||
},
|
},
|
||||||
Error, HasMetadata,
|
Error, HasMetadata,
|
||||||
};
|
};
|
||||||
@ -30,12 +30,9 @@ use crate::{
|
|||||||
pub(crate) const STATS_TIMEOUT_DEFAULT: Duration = Duration::from_secs(15);
|
pub(crate) const STATS_TIMEOUT_DEFAULT: Duration = Duration::from_secs(15);
|
||||||
|
|
||||||
/// Holds a scheduler
|
/// Holds a scheduler
|
||||||
pub trait HasScheduler: UsesState
|
pub trait HasScheduler<I, S> {
|
||||||
where
|
|
||||||
Self::State: HasCorpus,
|
|
||||||
{
|
|
||||||
/// The [`Scheduler`] for this fuzzer
|
/// The [`Scheduler`] for this fuzzer
|
||||||
type Scheduler: Scheduler<Self::Input, Self::State>;
|
type Scheduler: Scheduler<I, S>;
|
||||||
|
|
||||||
/// The scheduler
|
/// The scheduler
|
||||||
fn scheduler(&self) -> &Self::Scheduler;
|
fn scheduler(&self) -> &Self::Scheduler;
|
||||||
@ -45,7 +42,7 @@ where
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Holds an feedback
|
/// Holds an feedback
|
||||||
pub trait HasFeedback: UsesState {
|
pub trait HasFeedback {
|
||||||
/// The feedback type
|
/// The feedback type
|
||||||
type Feedback;
|
type Feedback;
|
||||||
|
|
||||||
@ -57,7 +54,7 @@ pub trait HasFeedback: UsesState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Holds an objective feedback
|
/// Holds an objective feedback
|
||||||
pub trait HasObjective: UsesState {
|
pub trait HasObjective {
|
||||||
/// The type of the [`Feedback`] used to find objectives for this fuzzer
|
/// The type of the [`Feedback`] used to find objectives for this fuzzer
|
||||||
type Objective;
|
type Objective;
|
||||||
|
|
||||||
@ -69,104 +66,87 @@ pub trait HasObjective: UsesState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Evaluates if an input is interesting using the feedback
|
/// Evaluates if an input is interesting using the feedback
|
||||||
pub trait ExecutionProcessor<EM, OT>: UsesState {
|
pub trait ExecutionProcessor<EM, I, OT, S> {
|
||||||
/// Check the outcome of the execution, find if it is worth for corpus or objectives
|
/// Check the outcome of the execution, find if it is worth for corpus or objectives
|
||||||
fn check_results(
|
fn check_results(
|
||||||
&mut self,
|
&mut self,
|
||||||
state: &mut Self::State,
|
state: &mut S,
|
||||||
manager: &mut EM,
|
manager: &mut EM,
|
||||||
input: &<Self::State as UsesInput>::Input,
|
input: &I,
|
||||||
observers: &OT,
|
observers: &OT,
|
||||||
exit_kind: &ExitKind,
|
exit_kind: &ExitKind,
|
||||||
) -> Result<ExecuteInputResult, Error>
|
) -> Result<ExecuteInputResult, Error>;
|
||||||
where
|
|
||||||
EM: EventFirer<State = Self::State>,
|
|
||||||
OT: ObserversTuple<<Self as UsesInput>::Input, Self::State>;
|
|
||||||
|
|
||||||
/// Process `ExecuteInputResult`. Add to corpus, solution or ignore
|
/// Process `ExecuteInputResult`. Add to corpus, solution or ignore
|
||||||
#[allow(clippy::too_many_arguments)]
|
#[allow(clippy::too_many_arguments)]
|
||||||
fn process_execution(
|
fn process_execution(
|
||||||
&mut self,
|
&mut self,
|
||||||
state: &mut Self::State,
|
state: &mut S,
|
||||||
manager: &mut EM,
|
manager: &mut EM,
|
||||||
input: &<Self::State as UsesInput>::Input,
|
input: &I,
|
||||||
exec_res: &ExecuteInputResult,
|
exec_res: &ExecuteInputResult,
|
||||||
observers: &OT,
|
observers: &OT,
|
||||||
) -> Result<Option<CorpusId>, Error>
|
) -> Result<Option<CorpusId>, Error>;
|
||||||
where
|
|
||||||
EM: EventFirer<State = Self::State>,
|
|
||||||
OT: ObserversTuple<<Self as UsesInput>::Input, Self::State>;
|
|
||||||
|
|
||||||
/// serialize and send event via manager
|
/// serialize and send event via manager
|
||||||
fn serialize_and_dispatch(
|
fn serialize_and_dispatch(
|
||||||
&mut self,
|
&mut self,
|
||||||
state: &mut Self::State,
|
state: &mut S,
|
||||||
manager: &mut EM,
|
manager: &mut EM,
|
||||||
input: <Self::State as UsesInput>::Input,
|
input: I,
|
||||||
exec_res: &ExecuteInputResult,
|
exec_res: &ExecuteInputResult,
|
||||||
observers: &OT,
|
observers: &OT,
|
||||||
exit_kind: &ExitKind,
|
exit_kind: &ExitKind,
|
||||||
) -> Result<(), Error>
|
) -> Result<(), Error>;
|
||||||
where
|
|
||||||
EM: EventFirer<State = Self::State>,
|
|
||||||
OT: ObserversTuple<<Self as UsesInput>::Input, Self::State> + Serialize;
|
|
||||||
|
|
||||||
/// send event via manager
|
/// send event via manager
|
||||||
fn dispatch_event(
|
fn dispatch_event(
|
||||||
&mut self,
|
&mut self,
|
||||||
state: &mut Self::State,
|
state: &mut S,
|
||||||
manager: &mut EM,
|
manager: &mut EM,
|
||||||
input: <Self::State as UsesInput>::Input,
|
input: I,
|
||||||
exec_res: &ExecuteInputResult,
|
exec_res: &ExecuteInputResult,
|
||||||
obs_buf: Option<Vec<u8>>,
|
obs_buf: Option<Vec<u8>>,
|
||||||
exit_kind: &ExitKind,
|
exit_kind: &ExitKind,
|
||||||
) -> Result<(), Error>
|
) -> Result<(), Error>;
|
||||||
where
|
|
||||||
EM: EventFirer<State = Self::State>;
|
|
||||||
|
|
||||||
/// Evaluate if a set of observation channels has an interesting state
|
/// Evaluate if a set of observation channels has an interesting state
|
||||||
fn evaluate_execution(
|
fn evaluate_execution(
|
||||||
&mut self,
|
&mut self,
|
||||||
state: &mut Self::State,
|
state: &mut S,
|
||||||
manager: &mut EM,
|
manager: &mut EM,
|
||||||
input: <Self::State as UsesInput>::Input,
|
input: I,
|
||||||
observers: &OT,
|
observers: &OT,
|
||||||
exit_kind: &ExitKind,
|
exit_kind: &ExitKind,
|
||||||
send_events: bool,
|
send_events: bool,
|
||||||
) -> Result<(ExecuteInputResult, Option<CorpusId>), Error>
|
) -> Result<(ExecuteInputResult, Option<CorpusId>), Error>;
|
||||||
where
|
|
||||||
EM: EventFirer<State = Self::State>,
|
|
||||||
OT: ObserversTuple<<Self as UsesInput>::Input, Self::State> + Serialize;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Evaluates an input modifying the state of the fuzzer
|
/// Evaluates an input modifying the state of the fuzzer
|
||||||
pub trait EvaluatorObservers<EM, OT>: UsesState + Sized {
|
pub trait EvaluatorObservers<E, EM, I, S> {
|
||||||
/// Runs the input and triggers observers and feedback,
|
/// Runs the input and triggers observers and feedback,
|
||||||
/// returns if is interesting an (option) the index of the new
|
/// returns if is interesting an (option) the index of the new
|
||||||
/// [`crate::corpus::Testcase`] in the [`crate::corpus::Corpus`]
|
/// [`crate::corpus::Testcase`] in the [`crate::corpus::Corpus`]
|
||||||
fn evaluate_input_with_observers<E>(
|
fn evaluate_input_with_observers(
|
||||||
&mut self,
|
&mut self,
|
||||||
state: &mut Self::State,
|
state: &mut S,
|
||||||
executor: &mut E,
|
executor: &mut E,
|
||||||
manager: &mut EM,
|
manager: &mut EM,
|
||||||
input: <Self::State as UsesInput>::Input,
|
input: I,
|
||||||
send_events: bool,
|
send_events: bool,
|
||||||
) -> Result<(ExecuteInputResult, Option<CorpusId>), Error>
|
) -> Result<(ExecuteInputResult, Option<CorpusId>), Error>;
|
||||||
where
|
|
||||||
E: Executor<EM, Self, State = Self::State> + HasObservers<Observers = OT>,
|
|
||||||
EM: EventFirer<State = Self::State>;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Evaluate an input modifying the state of the fuzzer
|
/// Evaluate an input modifying the state of the fuzzer
|
||||||
pub trait Evaluator<E, EM>: UsesState {
|
pub trait Evaluator<E, EM, I, S> {
|
||||||
/// Runs the input and triggers observers and feedback,
|
/// Runs the input and triggers observers and feedback,
|
||||||
/// returns if is interesting an (option) the index of the new [`crate::corpus::Testcase`] in the corpus
|
/// returns if is interesting an (option) the index of the new [`crate::corpus::Testcase`] in the corpus
|
||||||
fn evaluate_input(
|
fn evaluate_input(
|
||||||
&mut self,
|
&mut self,
|
||||||
state: &mut Self::State,
|
state: &mut S,
|
||||||
executor: &mut E,
|
executor: &mut E,
|
||||||
manager: &mut EM,
|
manager: &mut EM,
|
||||||
input: <Self::State as UsesInput>::Input,
|
input: I,
|
||||||
) -> Result<(ExecuteInputResult, Option<CorpusId>), Error> {
|
) -> Result<(ExecuteInputResult, Option<CorpusId>), Error> {
|
||||||
self.evaluate_input_events(state, executor, manager, input, true)
|
self.evaluate_input_events(state, executor, manager, input, true)
|
||||||
}
|
}
|
||||||
@ -176,10 +156,10 @@ pub trait Evaluator<E, EM>: UsesState {
|
|||||||
/// This version has a boolean to decide if send events to the manager.
|
/// This version has a boolean to decide if send events to the manager.
|
||||||
fn evaluate_input_events(
|
fn evaluate_input_events(
|
||||||
&mut self,
|
&mut self,
|
||||||
state: &mut Self::State,
|
state: &mut S,
|
||||||
executor: &mut E,
|
executor: &mut E,
|
||||||
manager: &mut EM,
|
manager: &mut EM,
|
||||||
input: <Self::State as UsesInput>::Input,
|
input: I,
|
||||||
send_events: bool,
|
send_events: bool,
|
||||||
) -> Result<(ExecuteInputResult, Option<CorpusId>), Error>;
|
) -> Result<(ExecuteInputResult, Option<CorpusId>), Error>;
|
||||||
|
|
||||||
@ -189,10 +169,10 @@ pub trait Evaluator<E, EM>: UsesState {
|
|||||||
/// Usually, you want to use [`Evaluator::evaluate_input`], unless you know what you are doing.
|
/// Usually, you want to use [`Evaluator::evaluate_input`], unless you know what you are doing.
|
||||||
fn add_input(
|
fn add_input(
|
||||||
&mut self,
|
&mut self,
|
||||||
state: &mut Self::State,
|
state: &mut S,
|
||||||
executor: &mut E,
|
executor: &mut E,
|
||||||
manager: &mut EM,
|
manager: &mut EM,
|
||||||
input: <Self::State as UsesInput>::Input,
|
input: I,
|
||||||
) -> Result<CorpusId, Error>;
|
) -> Result<CorpusId, Error>;
|
||||||
|
|
||||||
/// Adds the input to the corpus as disabled a input.
|
/// Adds the input to the corpus as disabled a input.
|
||||||
@ -200,21 +180,11 @@ pub trait Evaluator<E, EM>: UsesState {
|
|||||||
/// Disabled testcases are only used for splicing
|
/// Disabled testcases are only used for splicing
|
||||||
/// Returns the `index` of the new testcase in the corpus.
|
/// Returns the `index` of the new testcase in the corpus.
|
||||||
/// Usually, you want to use [`Evaluator::evaluate_input`], unless you know what you are doing.
|
/// Usually, you want to use [`Evaluator::evaluate_input`], unless you know what you are doing.
|
||||||
fn add_disabled_input(
|
fn add_disabled_input(&mut self, state: &mut S, input: I) -> Result<CorpusId, Error>;
|
||||||
&mut self,
|
|
||||||
state: &mut Self::State,
|
|
||||||
input: <Self::State as UsesInput>::Input,
|
|
||||||
) -> Result<CorpusId, Error>;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The main fuzzer trait.
|
/// The main fuzzer trait.
|
||||||
pub trait Fuzzer<E, EM, ST>: Sized + UsesState
|
pub trait Fuzzer<E, EM, S, ST> {
|
||||||
where
|
|
||||||
Self::State: HasMetadata + HasExecutions + HasLastReportTime + Stoppable,
|
|
||||||
E: UsesState<State = Self::State>,
|
|
||||||
EM: ProgressReporter<State = Self::State>,
|
|
||||||
ST: StagesTuple<E, EM, Self::State, Self>,
|
|
||||||
{
|
|
||||||
/// Fuzz for a single iteration.
|
/// Fuzz for a single iteration.
|
||||||
/// Returns the index of the last fuzzed corpus item.
|
/// Returns the index of the last fuzzed corpus item.
|
||||||
/// (Note: An iteration represents a complete run of every stage.
|
/// (Note: An iteration represents a complete run of every stage.
|
||||||
@ -228,7 +198,7 @@ where
|
|||||||
&mut self,
|
&mut self,
|
||||||
stages: &mut ST,
|
stages: &mut ST,
|
||||||
executor: &mut E,
|
executor: &mut E,
|
||||||
state: &mut Self::State,
|
state: &mut S,
|
||||||
manager: &mut EM,
|
manager: &mut EM,
|
||||||
) -> Result<CorpusId, Error>;
|
) -> Result<CorpusId, Error>;
|
||||||
|
|
||||||
@ -237,16 +207,9 @@ where
|
|||||||
&mut self,
|
&mut self,
|
||||||
stages: &mut ST,
|
stages: &mut ST,
|
||||||
executor: &mut E,
|
executor: &mut E,
|
||||||
state: &mut Self::State,
|
state: &mut S,
|
||||||
manager: &mut EM,
|
manager: &mut EM,
|
||||||
) -> Result<(), Error> {
|
) -> Result<(), Error>;
|
||||||
let monitor_timeout = STATS_TIMEOUT_DEFAULT;
|
|
||||||
loop {
|
|
||||||
manager.maybe_report_progress(state, monitor_timeout)?;
|
|
||||||
|
|
||||||
self.fuzz_one(stages, executor, state, manager)?;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Fuzz for n iterations.
|
/// Fuzz for n iterations.
|
||||||
/// Returns the index of the last fuzzed corpus item.
|
/// Returns the index of the last fuzzed corpus item.
|
||||||
@ -261,33 +224,10 @@ where
|
|||||||
&mut self,
|
&mut self,
|
||||||
stages: &mut ST,
|
stages: &mut ST,
|
||||||
executor: &mut E,
|
executor: &mut E,
|
||||||
state: &mut Self::State,
|
state: &mut S,
|
||||||
manager: &mut EM,
|
manager: &mut EM,
|
||||||
iters: u64,
|
iters: u64,
|
||||||
) -> Result<CorpusId, Error> {
|
) -> Result<CorpusId, Error>;
|
||||||
if iters == 0 {
|
|
||||||
return Err(Error::illegal_argument(
|
|
||||||
"Cannot fuzz for 0 iterations!".to_string(),
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
let mut ret = None;
|
|
||||||
let monitor_timeout = STATS_TIMEOUT_DEFAULT;
|
|
||||||
|
|
||||||
for _ in 0..iters {
|
|
||||||
manager.maybe_report_progress(state, monitor_timeout)?;
|
|
||||||
ret = Some(self.fuzz_one(stages, executor, state, manager)?);
|
|
||||||
}
|
|
||||||
|
|
||||||
manager.report_progress(state)?;
|
|
||||||
|
|
||||||
// If we would assume the fuzzer loop will always exit after this, we could do this here:
|
|
||||||
// manager.on_restart(state)?;
|
|
||||||
// But as the state may grow to a few megabytes,
|
|
||||||
// for now we won't, and the user has to do it (unless we find a way to do this on `Drop`).
|
|
||||||
|
|
||||||
Ok(ret.unwrap())
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The corpus this input should be added to
|
/// The corpus this input should be added to
|
||||||
@ -303,24 +243,16 @@ pub enum ExecuteInputResult {
|
|||||||
|
|
||||||
/// Your default fuzzer instance, for everyday use.
|
/// Your default fuzzer instance, for everyday use.
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct StdFuzzer<CS, F, OF, S> {
|
pub struct StdFuzzer<CS, F, OF> {
|
||||||
scheduler: CS,
|
scheduler: CS,
|
||||||
feedback: F,
|
feedback: F,
|
||||||
objective: OF,
|
objective: OF,
|
||||||
phantom: PhantomData<S>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<CS, F, OF, S> UsesState for StdFuzzer<CS, F, OF, S>
|
impl<CS, F, OF, S> HasScheduler<<S::Corpus as Corpus>::Input, S> for StdFuzzer<CS, F, OF>
|
||||||
where
|
where
|
||||||
S: State,
|
S: HasCorpus,
|
||||||
{
|
CS: Scheduler<<S::Corpus as Corpus>::Input, S>,
|
||||||
type State = S;
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<CS, F, OF, S> HasScheduler for StdFuzzer<CS, F, OF, S>
|
|
||||||
where
|
|
||||||
S: State + HasCorpus,
|
|
||||||
CS: Scheduler<S::Input, S>,
|
|
||||||
{
|
{
|
||||||
type Scheduler = CS;
|
type Scheduler = CS;
|
||||||
|
|
||||||
@ -333,10 +265,7 @@ where
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<CS, F, OF, S> HasFeedback for StdFuzzer<CS, F, OF, S>
|
impl<CS, F, OF> HasFeedback for StdFuzzer<CS, F, OF> {
|
||||||
where
|
|
||||||
S: State,
|
|
||||||
{
|
|
||||||
type Feedback = F;
|
type Feedback = F;
|
||||||
|
|
||||||
fn feedback(&self) -> &Self::Feedback {
|
fn feedback(&self) -> &Self::Feedback {
|
||||||
@ -348,10 +277,7 @@ where
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<CS, F, OF, S> HasObjective for StdFuzzer<CS, F, OF, S>
|
impl<CS, F, OF> HasObjective for StdFuzzer<CS, F, OF> {
|
||||||
where
|
|
||||||
S: State,
|
|
||||||
{
|
|
||||||
type Objective = OF;
|
type Objective = OF;
|
||||||
|
|
||||||
fn objective(&self) -> &OF {
|
fn objective(&self) -> &OF {
|
||||||
@ -363,27 +289,30 @@ where
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<CS, EM, F, OF, OT, S> ExecutionProcessor<EM, OT> for StdFuzzer<CS, F, OF, S>
|
impl<CS, EM, F, OF, OT, S> ExecutionProcessor<EM, <S::Corpus as Corpus>::Input, OT, S>
|
||||||
|
for StdFuzzer<CS, F, OF>
|
||||||
where
|
where
|
||||||
CS: Scheduler<S::Input, S>,
|
CS: Scheduler<<S::Corpus as Corpus>::Input, S>,
|
||||||
F: Feedback<EM, S::Input, OT, S>,
|
EM: EventFirer<State = S>,
|
||||||
OF: Feedback<EM, S::Input, OT, S>,
|
S: HasCorpus
|
||||||
S: HasCorpus + HasSolutions + HasExecutions + HasCorpus + HasCurrentCorpusId + State,
|
+ MaybeHasClientPerfMonitor
|
||||||
S::Corpus: Corpus<Input = S::Input>, //delete me
|
+ UsesInput<Input = <S::Corpus as Corpus>::Input>
|
||||||
S::Solutions: Corpus<Input = S::Input>, //delete me
|
+ HasCurrentTestcase
|
||||||
|
+ HasSolutions,
|
||||||
|
F: Feedback<EM, <S::Corpus as Corpus>::Input, OT, S>,
|
||||||
|
OF: Feedback<EM, <S::Corpus as Corpus>::Input, OT, S>,
|
||||||
|
OT: ObserversTuple<<S::Corpus as Corpus>::Input, S> + Serialize,
|
||||||
|
<S::Corpus as Corpus>::Input: Input,
|
||||||
|
S::Solutions: Corpus<Input = <S::Corpus as Corpus>::Input>,
|
||||||
{
|
{
|
||||||
fn check_results(
|
fn check_results(
|
||||||
&mut self,
|
&mut self,
|
||||||
state: &mut S,
|
state: &mut S,
|
||||||
manager: &mut EM,
|
manager: &mut EM,
|
||||||
input: &S::Input,
|
input: &<S::Corpus as Corpus>::Input,
|
||||||
observers: &OT,
|
observers: &OT,
|
||||||
exit_kind: &ExitKind,
|
exit_kind: &ExitKind,
|
||||||
) -> Result<ExecuteInputResult, Error>
|
) -> Result<ExecuteInputResult, Error> {
|
||||||
where
|
|
||||||
EM: EventFirer<State = Self::State>,
|
|
||||||
OT: ObserversTuple<Self::Input, Self::State>,
|
|
||||||
{
|
|
||||||
let mut res = ExecuteInputResult::None;
|
let mut res = ExecuteInputResult::None;
|
||||||
|
|
||||||
#[cfg(not(feature = "introspection"))]
|
#[cfg(not(feature = "introspection"))]
|
||||||
@ -418,17 +347,13 @@ where
|
|||||||
|
|
||||||
fn evaluate_execution(
|
fn evaluate_execution(
|
||||||
&mut self,
|
&mut self,
|
||||||
state: &mut Self::State,
|
state: &mut S,
|
||||||
manager: &mut EM,
|
manager: &mut EM,
|
||||||
input: <Self::State as UsesInput>::Input,
|
input: <S::Corpus as Corpus>::Input,
|
||||||
observers: &OT,
|
observers: &OT,
|
||||||
exit_kind: &ExitKind,
|
exit_kind: &ExitKind,
|
||||||
send_events: bool,
|
send_events: bool,
|
||||||
) -> Result<(ExecuteInputResult, Option<CorpusId>), Error>
|
) -> Result<(ExecuteInputResult, Option<CorpusId>), Error> {
|
||||||
where
|
|
||||||
EM: EventFirer<State = Self::State>,
|
|
||||||
OT: ObserversTuple<Self::Input, Self::State> + Serialize,
|
|
||||||
{
|
|
||||||
let exec_res = self.check_results(state, manager, &input, observers, exit_kind)?;
|
let exec_res = self.check_results(state, manager, &input, observers, exit_kind)?;
|
||||||
let corpus_id = self.process_execution(state, manager, &input, &exec_res, observers)?;
|
let corpus_id = self.process_execution(state, manager, &input, &exec_res, observers)?;
|
||||||
if send_events {
|
if send_events {
|
||||||
@ -439,17 +364,13 @@ where
|
|||||||
|
|
||||||
fn serialize_and_dispatch(
|
fn serialize_and_dispatch(
|
||||||
&mut self,
|
&mut self,
|
||||||
state: &mut Self::State,
|
state: &mut S,
|
||||||
manager: &mut EM,
|
manager: &mut EM,
|
||||||
input: <Self::State as UsesInput>::Input,
|
input: <S::Corpus as Corpus>::Input,
|
||||||
exec_res: &ExecuteInputResult,
|
exec_res: &ExecuteInputResult,
|
||||||
observers: &OT,
|
observers: &OT,
|
||||||
exit_kind: &ExitKind,
|
exit_kind: &ExitKind,
|
||||||
) -> Result<(), Error>
|
) -> Result<(), Error> {
|
||||||
where
|
|
||||||
EM: EventFirer<State = Self::State>,
|
|
||||||
OT: ObserversTuple<Self::Input, Self::State> + Serialize,
|
|
||||||
{
|
|
||||||
// Now send off the event
|
// Now send off the event
|
||||||
let observers_buf = match exec_res {
|
let observers_buf = match exec_res {
|
||||||
ExecuteInputResult::Corpus => {
|
ExecuteInputResult::Corpus => {
|
||||||
@ -473,16 +394,13 @@ where
|
|||||||
|
|
||||||
fn dispatch_event(
|
fn dispatch_event(
|
||||||
&mut self,
|
&mut self,
|
||||||
state: &mut Self::State,
|
state: &mut S,
|
||||||
manager: &mut EM,
|
manager: &mut EM,
|
||||||
input: <Self::State as UsesInput>::Input,
|
input: <S::Corpus as Corpus>::Input,
|
||||||
exec_res: &ExecuteInputResult,
|
exec_res: &ExecuteInputResult,
|
||||||
observers_buf: Option<Vec<u8>>,
|
observers_buf: Option<Vec<u8>>,
|
||||||
exit_kind: &ExitKind,
|
exit_kind: &ExitKind,
|
||||||
) -> Result<(), Error>
|
) -> Result<(), Error> {
|
||||||
where
|
|
||||||
EM: EventFirer<State = Self::State>,
|
|
||||||
{
|
|
||||||
// Now send off the event
|
// Now send off the event
|
||||||
match exec_res {
|
match exec_res {
|
||||||
ExecuteInputResult::Corpus => {
|
ExecuteInputResult::Corpus => {
|
||||||
@ -522,16 +440,12 @@ where
|
|||||||
/// Evaluate if a set of observation channels has an interesting state
|
/// Evaluate if a set of observation channels has an interesting state
|
||||||
fn process_execution(
|
fn process_execution(
|
||||||
&mut self,
|
&mut self,
|
||||||
state: &mut Self::State,
|
state: &mut S,
|
||||||
manager: &mut EM,
|
manager: &mut EM,
|
||||||
input: &S::Input,
|
input: &<S::Corpus as Corpus>::Input,
|
||||||
exec_res: &ExecuteInputResult,
|
exec_res: &ExecuteInputResult,
|
||||||
observers: &OT,
|
observers: &OT,
|
||||||
) -> Result<Option<CorpusId>, Error>
|
) -> Result<Option<CorpusId>, Error> {
|
||||||
where
|
|
||||||
EM: EventFirer<State = Self::State>,
|
|
||||||
OT: ObserversTuple<Self::Input, Self::State>,
|
|
||||||
{
|
|
||||||
match exec_res {
|
match exec_res {
|
||||||
ExecuteInputResult::None => {
|
ExecuteInputResult::None => {
|
||||||
self.feedback_mut().discard_metadata(state, input)?;
|
self.feedback_mut().discard_metadata(state, input)?;
|
||||||
@ -577,30 +491,34 @@ where
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<CS, EM, F, OF, OT, S> EvaluatorObservers<EM, OT> for StdFuzzer<CS, F, OF, S>
|
impl<CS, E, EM, F, OF, S> EvaluatorObservers<E, EM, <S::Corpus as Corpus>::Input, S>
|
||||||
|
for StdFuzzer<CS, F, OF>
|
||||||
where
|
where
|
||||||
CS: Scheduler<S::Input, S>,
|
CS: Scheduler<<S::Corpus as Corpus>::Input, S>,
|
||||||
OT: ObserversTuple<S::Input, S> + Serialize + DeserializeOwned,
|
E: HasObservers + Executor<EM, Self, State = S>,
|
||||||
F: Feedback<EM, S::Input, OT, S>,
|
E::Observers: MatchName + ObserversTuple<<S::Corpus as Corpus>::Input, S> + Serialize,
|
||||||
OF: Feedback<EM, S::Input, OT, S>,
|
EM: EventFirer<State = S>,
|
||||||
S: HasCorpus + HasSolutions + HasExecutions + State,
|
F: Feedback<EM, <S::Corpus as Corpus>::Input, E::Observers, S>,
|
||||||
S::Corpus: Corpus<Input = S::Input>, //delete me
|
OF: Feedback<EM, <S::Corpus as Corpus>::Input, E::Observers, S>,
|
||||||
S::Solutions: Corpus<Input = S::Input>, //delete me
|
S: HasCorpus
|
||||||
|
+ HasSolutions
|
||||||
|
+ MaybeHasClientPerfMonitor
|
||||||
|
+ HasCurrentTestcase
|
||||||
|
+ UsesInput<Input = <S::Corpus as Corpus>::Input>
|
||||||
|
+ HasExecutions,
|
||||||
|
<S::Corpus as Corpus>::Input: Input,
|
||||||
|
S::Solutions: Corpus<Input = <S::Corpus as Corpus>::Input>,
|
||||||
{
|
{
|
||||||
/// Process one input, adding to the respective corpora if needed and firing the right events
|
/// Process one input, adding to the respective corpora if needed and firing the right events
|
||||||
#[inline]
|
#[inline]
|
||||||
fn evaluate_input_with_observers<E>(
|
fn evaluate_input_with_observers(
|
||||||
&mut self,
|
&mut self,
|
||||||
state: &mut S,
|
state: &mut S,
|
||||||
executor: &mut E,
|
executor: &mut E,
|
||||||
manager: &mut EM,
|
manager: &mut EM,
|
||||||
input: S::Input,
|
input: <S::Corpus as Corpus>::Input,
|
||||||
send_events: bool,
|
send_events: bool,
|
||||||
) -> Result<(ExecuteInputResult, Option<CorpusId>), Error>
|
) -> Result<(ExecuteInputResult, Option<CorpusId>), Error> {
|
||||||
where
|
|
||||||
E: Executor<EM, Self, State = S> + HasObservers<Observers = OT>,
|
|
||||||
EM: EventFirer<State = S>,
|
|
||||||
{
|
|
||||||
let exit_kind = self.execute_input(state, executor, manager, &input)?;
|
let exit_kind = self.execute_input(state, executor, manager, &input)?;
|
||||||
let observers = executor.observers();
|
let observers = executor.observers();
|
||||||
|
|
||||||
@ -610,34 +528,40 @@ where
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<CS, E, EM, F, OF, S> Evaluator<E, EM> for StdFuzzer<CS, F, OF, S>
|
impl<CS, E, EM, F, OF, S> Evaluator<E, EM, <S::Corpus as Corpus>::Input, S> for StdFuzzer<CS, F, OF>
|
||||||
where
|
where
|
||||||
CS: Scheduler<S::Input, S>,
|
CS: Scheduler<<S::Corpus as Corpus>::Input, S>,
|
||||||
E: HasObservers + Executor<EM, Self, State = S>,
|
E: HasObservers + Executor<EM, Self, State = S>,
|
||||||
E::Observers: ObserversTuple<S::Input, S> + Serialize + DeserializeOwned,
|
E::Observers: MatchName + ObserversTuple<<S::Corpus as Corpus>::Input, S> + Serialize,
|
||||||
EM: EventFirer<State = S>,
|
EM: EventFirer<State = S>,
|
||||||
F: Feedback<EM, S::Input, E::Observers, S>,
|
F: Feedback<EM, <S::Corpus as Corpus>::Input, E::Observers, S>,
|
||||||
OF: Feedback<EM, S::Input, E::Observers, S>,
|
OF: Feedback<EM, <S::Corpus as Corpus>::Input, E::Observers, S>,
|
||||||
S: HasCorpus + HasSolutions + HasExecutions + HasLastFoundTime + State,
|
S: HasCorpus
|
||||||
S::Corpus: Corpus<Input = S::Input>, //delete me
|
+ HasSolutions
|
||||||
S::Solutions: Corpus<Input = S::Input>, //delete me
|
+ MaybeHasClientPerfMonitor
|
||||||
|
+ HasCurrentTestcase
|
||||||
|
+ HasLastFoundTime
|
||||||
|
+ HasExecutions
|
||||||
|
+ UsesInput<Input = <S::Corpus as Corpus>::Input>,
|
||||||
|
<S::Corpus as Corpus>::Input: Input,
|
||||||
|
S::Solutions: Corpus<Input = <S::Corpus as Corpus>::Input>,
|
||||||
{
|
{
|
||||||
/// Process one input, adding to the respective corpora if needed and firing the right events
|
/// Process one input, adding to the respective corpora if needed and firing the right events
|
||||||
#[inline]
|
#[inline]
|
||||||
fn evaluate_input_events(
|
fn evaluate_input_events(
|
||||||
&mut self,
|
&mut self,
|
||||||
state: &mut Self::State,
|
state: &mut S,
|
||||||
executor: &mut E,
|
executor: &mut E,
|
||||||
manager: &mut EM,
|
manager: &mut EM,
|
||||||
input: <Self::State as UsesInput>::Input,
|
input: <S::Corpus as Corpus>::Input,
|
||||||
send_events: bool,
|
send_events: bool,
|
||||||
) -> Result<(ExecuteInputResult, Option<CorpusId>), Error> {
|
) -> Result<(ExecuteInputResult, Option<CorpusId>), Error> {
|
||||||
self.evaluate_input_with_observers(state, executor, manager, input, send_events)
|
self.evaluate_input_with_observers(state, executor, manager, input, send_events)
|
||||||
}
|
}
|
||||||
fn add_disabled_input(
|
fn add_disabled_input(
|
||||||
&mut self,
|
&mut self,
|
||||||
state: &mut Self::State,
|
state: &mut S,
|
||||||
input: <Self::State as UsesInput>::Input,
|
input: <S::Corpus as Corpus>::Input,
|
||||||
) -> Result<CorpusId, Error> {
|
) -> Result<CorpusId, Error> {
|
||||||
let mut testcase = Testcase::from(input.clone());
|
let mut testcase = Testcase::from(input.clone());
|
||||||
testcase.set_disabled(true);
|
testcase.set_disabled(true);
|
||||||
@ -648,10 +572,10 @@ where
|
|||||||
/// Adds an input, even if it's not considered `interesting` by any of the executors
|
/// Adds an input, even if it's not considered `interesting` by any of the executors
|
||||||
fn add_input(
|
fn add_input(
|
||||||
&mut self,
|
&mut self,
|
||||||
state: &mut Self::State,
|
state: &mut S,
|
||||||
executor: &mut E,
|
executor: &mut E,
|
||||||
manager: &mut EM,
|
manager: &mut EM,
|
||||||
input: <Self::State as UsesInput>::Input,
|
input: <S::Corpus as Corpus>::Input,
|
||||||
) -> Result<CorpusId, Error> {
|
) -> Result<CorpusId, Error> {
|
||||||
*state.last_found_time_mut() = current_time();
|
*state.last_found_time_mut() = current_time();
|
||||||
|
|
||||||
@ -744,7 +668,7 @@ where
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<CS, E, EM, F, OF, S, ST> Fuzzer<E, EM, ST> for StdFuzzer<CS, F, OF, S>
|
impl<CS, E, EM, F, OF, S, ST> Fuzzer<E, EM, S, ST> for StdFuzzer<CS, F, OF>
|
||||||
where
|
where
|
||||||
CS: Scheduler<S::Input, S>,
|
CS: Scheduler<S::Input, S>,
|
||||||
E: UsesState<State = S>,
|
E: UsesState<State = S>,
|
||||||
@ -763,7 +687,7 @@ where
|
|||||||
&mut self,
|
&mut self,
|
||||||
stages: &mut ST,
|
stages: &mut ST,
|
||||||
executor: &mut E,
|
executor: &mut E,
|
||||||
state: &mut Self::State,
|
state: &mut S,
|
||||||
manager: &mut EM,
|
manager: &mut EM,
|
||||||
) -> Result<CorpusId, Error> {
|
) -> Result<CorpusId, Error> {
|
||||||
// Init timer for scheduler
|
// Init timer for scheduler
|
||||||
@ -819,77 +743,89 @@ where
|
|||||||
|
|
||||||
Ok(id)
|
Ok(id)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn fuzz_loop(
|
||||||
|
&mut self,
|
||||||
|
stages: &mut ST,
|
||||||
|
executor: &mut E,
|
||||||
|
state: &mut S,
|
||||||
|
manager: &mut EM,
|
||||||
|
) -> Result<(), Error> {
|
||||||
|
let monitor_timeout = STATS_TIMEOUT_DEFAULT;
|
||||||
|
loop {
|
||||||
|
manager.maybe_report_progress(state, monitor_timeout)?;
|
||||||
|
|
||||||
|
self.fuzz_one(stages, executor, state, manager)?;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<CS, F, OF, S> StdFuzzer<CS, F, OF, S>
|
fn fuzz_loop_for(
|
||||||
where
|
&mut self,
|
||||||
CS: Scheduler<S::Input, S>,
|
stages: &mut ST,
|
||||||
S: UsesInput + HasExecutions + HasCorpus + State,
|
executor: &mut E,
|
||||||
{
|
state: &mut S,
|
||||||
|
manager: &mut EM,
|
||||||
|
iters: u64,
|
||||||
|
) -> Result<CorpusId, Error> {
|
||||||
|
if iters == 0 {
|
||||||
|
return Err(Error::illegal_argument(
|
||||||
|
"Cannot fuzz for 0 iterations!".to_string(),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
let mut ret = None;
|
||||||
|
let monitor_timeout = STATS_TIMEOUT_DEFAULT;
|
||||||
|
|
||||||
|
for _ in 0..iters {
|
||||||
|
manager.maybe_report_progress(state, monitor_timeout)?;
|
||||||
|
ret = Some(self.fuzz_one(stages, executor, state, manager)?);
|
||||||
|
}
|
||||||
|
|
||||||
|
manager.report_progress(state)?;
|
||||||
|
|
||||||
|
// If we would assume the fuzzer loop will always exit after this, we could do this here:
|
||||||
|
// manager.on_restart(state)?;
|
||||||
|
// But as the state may grow to a few megabytes,
|
||||||
|
// for now we won't, and the user has to do it (unless we find a way to do this on `Drop`).
|
||||||
|
|
||||||
|
Ok(ret.unwrap())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<CS, F, OF> StdFuzzer<CS, F, OF> {
|
||||||
/// Create a new `StdFuzzer` with standard behavior.
|
/// Create a new `StdFuzzer` with standard behavior.
|
||||||
pub fn new(scheduler: CS, feedback: F, objective: OF) -> Self {
|
pub fn new(scheduler: CS, feedback: F, objective: OF) -> Self {
|
||||||
Self {
|
Self {
|
||||||
scheduler,
|
scheduler,
|
||||||
feedback,
|
feedback,
|
||||||
objective,
|
objective,
|
||||||
phantom: PhantomData,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Runs the input and triggers observers
|
|
||||||
pub fn execute_input<E, EM>(
|
|
||||||
&mut self,
|
|
||||||
state: &mut <Self as UsesState>::State,
|
|
||||||
executor: &mut E,
|
|
||||||
event_mgr: &mut EM,
|
|
||||||
input: &<<Self as UsesState>::State as UsesInput>::Input,
|
|
||||||
) -> Result<ExitKind, Error>
|
|
||||||
where
|
|
||||||
E: Executor<EM, Self, State = <Self as UsesState>::State> + HasObservers,
|
|
||||||
E::Observers: ObserversTuple<<Self as UsesInput>::Input, <Self as UsesState>::State>,
|
|
||||||
EM: UsesState<State = <Self as UsesState>::State>,
|
|
||||||
{
|
|
||||||
start_timer!(state);
|
|
||||||
executor.observers_mut().pre_exec_all(state, input)?;
|
|
||||||
mark_feature_time!(state, PerfFeature::PreExecObservers);
|
|
||||||
|
|
||||||
start_timer!(state);
|
|
||||||
let exit_kind = executor.run_target(self, state, event_mgr, input)?;
|
|
||||||
mark_feature_time!(state, PerfFeature::TargetExecution);
|
|
||||||
|
|
||||||
start_timer!(state);
|
|
||||||
executor
|
|
||||||
.observers_mut()
|
|
||||||
.post_exec_all(state, input, &exit_kind)?;
|
|
||||||
mark_feature_time!(state, PerfFeature::PostExecObservers);
|
|
||||||
|
|
||||||
Ok(exit_kind)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Structs with this trait will execute an input
|
/// Structs with this trait will execute an input
|
||||||
pub trait ExecutesInput<E, EM>: UsesState
|
pub trait ExecutesInput<E, EM, I, S> {
|
||||||
where
|
|
||||||
E: UsesState<State = Self::State>,
|
|
||||||
EM: UsesState<State = Self::State>,
|
|
||||||
{
|
|
||||||
/// Runs the input and triggers observers and feedback
|
/// Runs the input and triggers observers and feedback
|
||||||
fn execute_input(
|
fn execute_input(
|
||||||
&mut self,
|
&mut self,
|
||||||
state: &mut Self::State,
|
state: &mut S,
|
||||||
executor: &mut E,
|
executor: &mut E,
|
||||||
event_mgr: &mut EM,
|
event_mgr: &mut EM,
|
||||||
input: &<Self::State as UsesInput>::Input,
|
input: &I,
|
||||||
) -> Result<ExitKind, Error>;
|
) -> Result<ExitKind, Error>;
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<CS, E, EM, F, OF, S> ExecutesInput<E, EM> for StdFuzzer<CS, F, OF, S>
|
impl<CS, E, EM, F, OF, S> ExecutesInput<E, EM, <S::Corpus as Corpus>::Input, S>
|
||||||
|
for StdFuzzer<CS, F, OF>
|
||||||
where
|
where
|
||||||
CS: Scheduler<S::Input, S>,
|
CS: Scheduler<<S::Corpus as Corpus>::Input, S>,
|
||||||
E: Executor<EM, Self, State = S> + HasObservers,
|
E: Executor<EM, Self, State = S> + HasObservers,
|
||||||
E::Observers: ObserversTuple<<Self as UsesInput>::Input, <Self as UsesState>::State>,
|
E::Observers: ObserversTuple<<S::Corpus as Corpus>::Input, S>,
|
||||||
EM: UsesState<State = Self::State>,
|
EM: UsesState<State = S>,
|
||||||
S: UsesInput + HasExecutions + HasCorpus + State,
|
S: UsesInput<Input = <S::Corpus as Corpus>::Input>
|
||||||
|
+ HasExecutions
|
||||||
|
+ HasCorpus
|
||||||
|
+ MaybeHasClientPerfMonitor,
|
||||||
{
|
{
|
||||||
/// Runs the input and triggers observers and feedback
|
/// Runs the input and triggers observers and feedback
|
||||||
fn execute_input(
|
fn execute_input(
|
||||||
@ -897,7 +833,7 @@ where
|
|||||||
state: &mut S,
|
state: &mut S,
|
||||||
executor: &mut E,
|
executor: &mut E,
|
||||||
event_mgr: &mut EM,
|
event_mgr: &mut EM,
|
||||||
input: &S::Input,
|
input: &<S::Corpus as Corpus>::Input,
|
||||||
) -> Result<ExitKind, Error> {
|
) -> Result<ExitKind, Error> {
|
||||||
start_timer!(state);
|
start_timer!(state);
|
||||||
executor.observers_mut().pre_exec_all(state, input)?;
|
executor.observers_mut().pre_exec_all(state, input)?;
|
||||||
@ -919,39 +855,28 @@ where
|
|||||||
|
|
||||||
/// A [`NopFuzzer`] that does nothing
|
/// A [`NopFuzzer`] that does nothing
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
pub struct NopFuzzer<S> {
|
pub struct NopFuzzer {}
|
||||||
phantom: PhantomData<S>,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<S> NopFuzzer<S> {
|
impl NopFuzzer {
|
||||||
/// Creates a new [`NopFuzzer`]
|
/// Creates a new [`NopFuzzer`]
|
||||||
#[must_use]
|
#[must_use]
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
Self {
|
Self {}
|
||||||
phantom: PhantomData,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<S> Default for NopFuzzer<S> {
|
impl Default for NopFuzzer {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
Self::new()
|
Self::new()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<S> UsesState for NopFuzzer<S>
|
impl<E, EM, S, ST> Fuzzer<E, EM, S, ST> for NopFuzzer
|
||||||
where
|
|
||||||
S: State,
|
|
||||||
{
|
|
||||||
type State = S;
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<ST, E, EM> Fuzzer<E, EM, ST> for NopFuzzer<E::State>
|
|
||||||
where
|
where
|
||||||
E: UsesState,
|
E: UsesState,
|
||||||
EM: ProgressReporter<State = Self::State> + EventProcessor<E, Self>,
|
EM: ProgressReporter<State = S> + EventProcessor<E, Self>,
|
||||||
ST: StagesTuple<E, EM, Self::State, Self>,
|
ST: StagesTuple<E, EM, S, Self>,
|
||||||
Self::State: HasMetadata + HasExecutions + HasLastReportTime + HasCurrentStageId,
|
S: HasMetadata + HasExecutions + HasLastReportTime + HasCurrentStageId + UsesInput,
|
||||||
{
|
{
|
||||||
fn fuzz_one(
|
fn fuzz_one(
|
||||||
&mut self,
|
&mut self,
|
||||||
@ -962,4 +887,25 @@ where
|
|||||||
) -> Result<CorpusId, Error> {
|
) -> Result<CorpusId, Error> {
|
||||||
unimplemented!("NopFuzzer cannot fuzz");
|
unimplemented!("NopFuzzer cannot fuzz");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn fuzz_loop(
|
||||||
|
&mut self,
|
||||||
|
_stages: &mut ST,
|
||||||
|
_executor: &mut E,
|
||||||
|
_state: &mut S,
|
||||||
|
_manager: &mut EM,
|
||||||
|
) -> Result<(), Error> {
|
||||||
|
unimplemented!("NopFuzzer cannot fuzz");
|
||||||
|
}
|
||||||
|
|
||||||
|
fn fuzz_loop_for(
|
||||||
|
&mut self,
|
||||||
|
_stages: &mut ST,
|
||||||
|
_executor: &mut E,
|
||||||
|
_state: &mut S,
|
||||||
|
_manager: &mut EM,
|
||||||
|
_iters: u64,
|
||||||
|
) -> Result<CorpusId, Error> {
|
||||||
|
unimplemented!("NopFuzzer cannot fuzz");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -239,7 +239,7 @@ impl<C, E, EM, O, S, Z> Stage<E, EM, S, Z> for AflStatsStage<C, E, EM, O, S, Z>
|
|||||||
where
|
where
|
||||||
E: HasObservers,
|
E: HasObservers,
|
||||||
EM: EventFirer,
|
EM: EventFirer,
|
||||||
Z: HasScheduler<State = S>,
|
Z: HasScheduler<<S::Corpus as Corpus>::Input, S>,
|
||||||
S: HasImported
|
S: HasImported
|
||||||
+ HasCorpus
|
+ HasCorpus
|
||||||
+ HasMetadata
|
+ HasMetadata
|
||||||
@ -252,7 +252,7 @@ where
|
|||||||
E::Observers: MatchNameRef,
|
E::Observers: MatchNameRef,
|
||||||
O: MapObserver,
|
O: MapObserver,
|
||||||
C: AsRef<O> + Named,
|
C: AsRef<O> + Named,
|
||||||
<Z as HasScheduler>::Scheduler: HasQueueCycles,
|
Z::Scheduler: HasQueueCycles,
|
||||||
{
|
{
|
||||||
#[allow(clippy::too_many_lines)]
|
#[allow(clippy::too_many_lines)]
|
||||||
fn perform(
|
fn perform(
|
||||||
|
@ -102,7 +102,7 @@ where
|
|||||||
+ HasCurrentTestcase
|
+ HasCurrentTestcase
|
||||||
+ HasCurrentCorpusId
|
+ HasCurrentCorpusId
|
||||||
+ UsesInput<Input = <S::Corpus as Corpus>::Input>,
|
+ UsesInput<Input = <S::Corpus as Corpus>::Input>,
|
||||||
Z: Evaluator<E, EM, State = S>,
|
Z: Evaluator<E, EM, <S::Corpus as Corpus>::Input, S>,
|
||||||
<S::Corpus as Corpus>::Input: Input,
|
<S::Corpus as Corpus>::Input: Input,
|
||||||
{
|
{
|
||||||
#[inline]
|
#[inline]
|
||||||
|
@ -92,7 +92,6 @@ where
|
|||||||
<S::Corpus as Corpus>::Input: HasMutatorBytes + Clone,
|
<S::Corpus as Corpus>::Input: HasMutatorBytes + Clone,
|
||||||
O: MapObserver,
|
O: MapObserver,
|
||||||
C: AsRef<O> + Named,
|
C: AsRef<O> + Named,
|
||||||
Z: UsesState<State = S>,
|
|
||||||
{
|
{
|
||||||
#[inline]
|
#[inline]
|
||||||
#[allow(clippy::let_and_return)]
|
#[allow(clippy::let_and_return)]
|
||||||
@ -174,7 +173,6 @@ where
|
|||||||
+ HasCurrentTestcase
|
+ HasCurrentTestcase
|
||||||
+ UsesInput<Input = <S::Corpus as Corpus>::Input>,
|
+ UsesInput<Input = <S::Corpus as Corpus>::Input>,
|
||||||
<S::Corpus as Corpus>::Input: HasMutatorBytes + Clone,
|
<S::Corpus as Corpus>::Input: HasMutatorBytes + Clone,
|
||||||
Z: UsesState<State = S>,
|
|
||||||
{
|
{
|
||||||
#[inline]
|
#[inline]
|
||||||
#[allow(clippy::let_and_return)]
|
#[allow(clippy::let_and_return)]
|
||||||
|
@ -60,7 +60,6 @@ where
|
|||||||
+ MaybeHasClientPerfMonitor
|
+ MaybeHasClientPerfMonitor
|
||||||
+ UsesInput<Input = <S::Corpus as Corpus>::Input>,
|
+ UsesInput<Input = <S::Corpus as Corpus>::Input>,
|
||||||
EM: UsesState<State = S>,
|
EM: UsesState<State = S>,
|
||||||
Z: UsesState<State = S>,
|
|
||||||
{
|
{
|
||||||
#[inline]
|
#[inline]
|
||||||
fn perform(
|
fn perform(
|
||||||
@ -362,14 +361,6 @@ pub struct SimpleConcolicMutationalStage<Z> {
|
|||||||
phantom: PhantomData<Z>,
|
phantom: PhantomData<Z>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "concolic_mutation")]
|
|
||||||
impl<Z> UsesState for SimpleConcolicMutationalStage<Z>
|
|
||||||
where
|
|
||||||
Z: UsesState,
|
|
||||||
{
|
|
||||||
type State = Z::State;
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(feature = "concolic_mutation")]
|
#[cfg(feature = "concolic_mutation")]
|
||||||
/// The unique id for this stage
|
/// The unique id for this stage
|
||||||
static mut SIMPLE_CONCOLIC_MUTATIONAL_ID: usize = 0;
|
static mut SIMPLE_CONCOLIC_MUTATIONAL_ID: usize = 0;
|
||||||
@ -388,7 +379,7 @@ impl<Z> Named for SimpleConcolicMutationalStage<Z> {
|
|||||||
#[cfg(feature = "concolic_mutation")]
|
#[cfg(feature = "concolic_mutation")]
|
||||||
impl<E, EM, S, Z> Stage<E, EM, S, Z> for SimpleConcolicMutationalStage<Z>
|
impl<E, EM, S, Z> Stage<E, EM, S, Z> for SimpleConcolicMutationalStage<Z>
|
||||||
where
|
where
|
||||||
Z: Evaluator<E, EM, State = S>,
|
Z: Evaluator<E, EM, <S::Corpus as Corpus>::Input, S>,
|
||||||
<S::Corpus as Corpus>::Input: HasMutatorBytes + Clone,
|
<S::Corpus as Corpus>::Input: HasMutatorBytes + Clone,
|
||||||
S: HasExecutions
|
S: HasExecutions
|
||||||
+ HasCorpus
|
+ HasCorpus
|
||||||
|
@ -76,7 +76,6 @@ where
|
|||||||
+ UsesInput<Input = BytesInput>,
|
+ UsesInput<Input = BytesInput>,
|
||||||
S::Corpus: Corpus<Input = BytesInput>,
|
S::Corpus: Corpus<Input = BytesInput>,
|
||||||
EM: UsesState<State = S>,
|
EM: UsesState<State = S>,
|
||||||
Z: UsesState<State = S>,
|
|
||||||
{
|
{
|
||||||
#[inline]
|
#[inline]
|
||||||
#[allow(clippy::too_many_lines)]
|
#[allow(clippy::too_many_lines)]
|
||||||
@ -352,7 +351,6 @@ where
|
|||||||
+ UsesInput<Input = BytesInput>,
|
+ UsesInput<Input = BytesInput>,
|
||||||
OT: ObserversTuple<BytesInput, S>,
|
OT: ObserversTuple<BytesInput, S>,
|
||||||
EM: UsesState<State = S>,
|
EM: UsesState<State = S>,
|
||||||
Z: UsesState<State = S>,
|
|
||||||
{
|
{
|
||||||
/// Create a new [`GeneralizationStage`].
|
/// Create a new [`GeneralizationStage`].
|
||||||
#[must_use]
|
#[must_use]
|
||||||
|
@ -31,7 +31,7 @@ impl<G, S, Z> GenStage<G, S, Z> {
|
|||||||
|
|
||||||
impl<E, EM, G, S, Z> Stage<E, EM, S, Z> for GenStage<G, S, Z>
|
impl<E, EM, G, S, Z> Stage<E, EM, S, Z> for GenStage<G, S, Z>
|
||||||
where
|
where
|
||||||
Z: Evaluator<E, EM, State = S>,
|
Z: Evaluator<E, EM, <S::Corpus as Corpus>::Input, S>,
|
||||||
S: HasCorpus + HasRand + UsesInput<Input = <S::Corpus as Corpus>::Input>,
|
S: HasCorpus + HasRand + UsesInput<Input = <S::Corpus as Corpus>::Input>,
|
||||||
G: Generator<<S::Corpus as Corpus>::Input, S>,
|
G: Generator<<S::Corpus as Corpus>::Input, S>,
|
||||||
{
|
{
|
||||||
|
@ -150,7 +150,7 @@ impl<E, EM, I, M, S, Z> Named for StdMutationalStage<E, EM, I, M, S, Z> {
|
|||||||
impl<E, EM, I, M, S, Z> Stage<E, EM, S, Z> for StdMutationalStage<E, EM, I, M, S, Z>
|
impl<E, EM, I, M, S, Z> Stage<E, EM, S, Z> for StdMutationalStage<E, EM, I, M, S, Z>
|
||||||
where
|
where
|
||||||
M: Mutator<I, S>,
|
M: Mutator<I, S>,
|
||||||
Z: Evaluator<E, EM, State = S>,
|
Z: Evaluator<E, EM, <S::Corpus as Corpus>::Input, S>,
|
||||||
S: HasCorpus
|
S: HasCorpus
|
||||||
+ HasRand
|
+ HasRand
|
||||||
+ HasMetadata
|
+ HasMetadata
|
||||||
@ -192,7 +192,7 @@ where
|
|||||||
impl<E, EM, M, S, Z> StdMutationalStage<E, EM, <S::Corpus as Corpus>::Input, M, S, Z>
|
impl<E, EM, M, S, Z> StdMutationalStage<E, EM, <S::Corpus as Corpus>::Input, M, S, Z>
|
||||||
where
|
where
|
||||||
M: Mutator<<S::Corpus as Corpus>::Input, S>,
|
M: Mutator<<S::Corpus as Corpus>::Input, S>,
|
||||||
Z: Evaluator<E, EM, State = S>,
|
Z: Evaluator<E, EM, <S::Corpus as Corpus>::Input, S>,
|
||||||
S: HasCorpus + HasRand + HasCurrentCorpusId + UsesInput + MaybeHasClientPerfMonitor,
|
S: HasCorpus + HasRand + HasCurrentCorpusId + UsesInput + MaybeHasClientPerfMonitor,
|
||||||
<S::Corpus as Corpus>::Input: Input + Clone,
|
<S::Corpus as Corpus>::Input: Input + Clone,
|
||||||
S::Corpus: Corpus<Input = S::Input>,
|
S::Corpus: Corpus<Input = S::Input>,
|
||||||
@ -213,7 +213,7 @@ where
|
|||||||
impl<E, EM, I, M, S, Z> StdMutationalStage<E, EM, I, M, S, Z>
|
impl<E, EM, I, M, S, Z> StdMutationalStage<E, EM, I, M, S, Z>
|
||||||
where
|
where
|
||||||
M: Mutator<I, S>,
|
M: Mutator<I, S>,
|
||||||
Z: Evaluator<E, EM, State = S>,
|
Z: Evaluator<E, EM, <S::Corpus as Corpus>::Input, S>,
|
||||||
S: HasCorpus + HasRand + HasCurrentTestcase + MaybeHasClientPerfMonitor + UsesInput,
|
S: HasCorpus + HasRand + HasCurrentTestcase + MaybeHasClientPerfMonitor + UsesInput,
|
||||||
I: MutatedTransform<<S::Corpus as Corpus>::Input, S> + Clone,
|
I: MutatedTransform<<S::Corpus as Corpus>::Input, S> + Clone,
|
||||||
<S::Corpus as Corpus>::Input: Input,
|
<S::Corpus as Corpus>::Input: Input,
|
||||||
@ -319,7 +319,7 @@ impl<E, EM, I, M, S, Z> Named for MultiMutationalStage<E, EM, I, M, S, Z> {
|
|||||||
impl<E, EM, I, M, S, Z> Stage<E, EM, S, Z> for MultiMutationalStage<E, EM, I, M, S, Z>
|
impl<E, EM, I, M, S, Z> Stage<E, EM, S, Z> for MultiMutationalStage<E, EM, I, M, S, Z>
|
||||||
where
|
where
|
||||||
M: MultiMutator<I, S>,
|
M: MultiMutator<I, S>,
|
||||||
Z: Evaluator<E, EM, State = S>,
|
Z: Evaluator<E, EM, <S::Corpus as Corpus>::Input, S>,
|
||||||
S: HasCorpus + HasRand + HasNamedMetadata + HasCurrentTestcase + HasCurrentCorpusId + UsesInput,
|
S: HasCorpus + HasRand + HasNamedMetadata + HasCurrentTestcase + HasCurrentCorpusId + UsesInput,
|
||||||
I: MutatedTransform<<S::Corpus as Corpus>::Input, S> + Clone,
|
I: MutatedTransform<<S::Corpus as Corpus>::Input, S> + Clone,
|
||||||
<S::Corpus as Corpus>::Input: Input,
|
<S::Corpus as Corpus>::Input: Input,
|
||||||
|
@ -93,7 +93,7 @@ where
|
|||||||
+ HasCurrentCorpusId
|
+ HasCurrentCorpusId
|
||||||
+ MaybeHasClientPerfMonitor
|
+ MaybeHasClientPerfMonitor
|
||||||
+ UsesInput<Input = <S::Corpus as Corpus>::Input>,
|
+ UsesInput<Input = <S::Corpus as Corpus>::Input>,
|
||||||
Z: Evaluator<E, EM, State = S>,
|
Z: Evaluator<E, EM, <S::Corpus as Corpus>::Input, S>,
|
||||||
I: MutatedTransform<<S::Corpus as Corpus>::Input, S> + Clone + Input,
|
I: MutatedTransform<<S::Corpus as Corpus>::Input, S> + Clone + Input,
|
||||||
<S::Corpus as Corpus>::Input: Input,
|
<S::Corpus as Corpus>::Input: Input,
|
||||||
{
|
{
|
||||||
@ -134,7 +134,7 @@ where
|
|||||||
+ MaybeHasClientPerfMonitor
|
+ MaybeHasClientPerfMonitor
|
||||||
+ UsesInput<Input = <S::Corpus as Corpus>::Input>,
|
+ UsesInput<Input = <S::Corpus as Corpus>::Input>,
|
||||||
I: MutatedTransform<<S::Corpus as Corpus>::Input, S> + Clone + Input,
|
I: MutatedTransform<<S::Corpus as Corpus>::Input, S> + Clone + Input,
|
||||||
Z: Evaluator<E, EM, State = S>,
|
Z: Evaluator<E, EM, <S::Corpus as Corpus>::Input, S>,
|
||||||
<S::Corpus as Corpus>::Input: Input,
|
<S::Corpus as Corpus>::Input: Input,
|
||||||
{
|
{
|
||||||
/// Creates a new [`PowerMutationalStage`]
|
/// Creates a new [`PowerMutationalStage`]
|
||||||
|
@ -262,10 +262,10 @@ where
|
|||||||
EM: EventFirer<State = S> + EventRestarter + HasEventManagerId + ProgressReporter<State = S>,
|
EM: EventFirer<State = S> + EventRestarter + HasEventManagerId + ProgressReporter<State = S>,
|
||||||
OT: ObserversTuple<<S::Corpus as Corpus>::Input, S>,
|
OT: ObserversTuple<<S::Corpus as Corpus>::Input, S>,
|
||||||
PS: PushStage<EM, <S::Corpus as Corpus>::Input, OT, S, Z>,
|
PS: PushStage<EM, <S::Corpus as Corpus>::Input, OT, S, Z>,
|
||||||
Z: ExecutesInput<E, EM, State = S>
|
Z: ExecutesInput<E, EM, <S::Corpus as Corpus>::Input, S>
|
||||||
+ ExecutionProcessor<EM, OT>
|
+ ExecutionProcessor<EM, <S::Corpus as Corpus>::Input, OT, S>
|
||||||
+ EvaluatorObservers<EM, OT>
|
+ EvaluatorObservers<E, EM, <S::Corpus as Corpus>::Input, OT>
|
||||||
+ HasScheduler<Scheduler = CS>,
|
+ HasScheduler<<S::Corpus as Corpus>::Input, S>,
|
||||||
{
|
{
|
||||||
fn perform(
|
fn perform(
|
||||||
&mut self,
|
&mut self,
|
||||||
|
@ -80,7 +80,8 @@ impl<EM, M, OT, S, Z> PushStage<EM, <S::Corpus as Corpus>::Input, OT, S, Z>
|
|||||||
for StdMutationalPushStage<EM, M, OT, S, Z>
|
for StdMutationalPushStage<EM, M, OT, S, Z>
|
||||||
where
|
where
|
||||||
EM: EventFirer<State = S>,
|
EM: EventFirer<State = S>,
|
||||||
Z: HasScheduler<State = S> + ExecutionProcessor<EM, OT>,
|
Z: HasScheduler<<S::Corpus as Corpus>::Input, S>
|
||||||
|
+ ExecutionProcessor<EM, <S::Corpus as Corpus>::Input, OT, S>,
|
||||||
S: HasCorpus
|
S: HasCorpus
|
||||||
+ UsesInput<Input = <S::Corpus as Corpus>::Input>
|
+ UsesInput<Input = <S::Corpus as Corpus>::Input>
|
||||||
+ HasRand
|
+ HasRand
|
||||||
@ -203,7 +204,8 @@ where
|
|||||||
OT: ObserversTuple<<S::Corpus as Corpus>::Input, S> + Serialize,
|
OT: ObserversTuple<<S::Corpus as Corpus>::Input, S> + Serialize,
|
||||||
M: Mutator<<S::Corpus as Corpus>::Input, S>,
|
M: Mutator<<S::Corpus as Corpus>::Input, S>,
|
||||||
<S::Corpus as Corpus>::Input: Clone + Debug + Input,
|
<S::Corpus as Corpus>::Input: Clone + Debug + Input,
|
||||||
Z: HasScheduler<State = S> + ExecutionProcessor<EM, OT>,
|
Z: HasScheduler<<S::Corpus as Corpus>::Input, S>
|
||||||
|
+ ExecutionProcessor<EM, <S::Corpus as Corpus>::Input, OT, S>,
|
||||||
{
|
{
|
||||||
type Item = Result<<S::Corpus as Corpus>::Input, Error>;
|
type Item = Result<<S::Corpus as Corpus>::Input, Error>;
|
||||||
|
|
||||||
@ -225,7 +227,8 @@ where
|
|||||||
OT: ObserversTuple<<S::Corpus as Corpus>::Input, S> + Serialize,
|
OT: ObserversTuple<<S::Corpus as Corpus>::Input, S> + Serialize,
|
||||||
M: Mutator<<S::Corpus as Corpus>::Input, S>,
|
M: Mutator<<S::Corpus as Corpus>::Input, S>,
|
||||||
<S::Corpus as Corpus>::Input: Clone + Debug + Input,
|
<S::Corpus as Corpus>::Input: Clone + Debug + Input,
|
||||||
Z: HasScheduler<State = S> + ExecutionProcessor<EM, OT>,
|
Z: HasScheduler<<S::Corpus as Corpus>::Input, S>
|
||||||
|
+ ExecutionProcessor<EM, <S::Corpus as Corpus>::Input, OT, S>,
|
||||||
{
|
{
|
||||||
/// Creates a new default mutational stage
|
/// Creates a new default mutational stage
|
||||||
#[must_use]
|
#[must_use]
|
||||||
|
@ -69,7 +69,7 @@ impl<CB, E, EM, S, Z> Named for SyncFromDiskStage<CB, E, EM, S, Z> {
|
|||||||
impl<CB, E, EM, S, Z> Stage<E, EM, S, Z> for SyncFromDiskStage<CB, E, EM, S, Z>
|
impl<CB, E, EM, S, Z> Stage<E, EM, S, Z> for SyncFromDiskStage<CB, E, EM, S, Z>
|
||||||
where
|
where
|
||||||
CB: FnMut(&mut Z, &mut S, &Path) -> Result<<S::Corpus as Corpus>::Input, Error>,
|
CB: FnMut(&mut Z, &mut S, &Path) -> Result<<S::Corpus as Corpus>::Input, Error>,
|
||||||
Z: Evaluator<E, EM, State = S>,
|
Z: Evaluator<E, EM, <S::Corpus as Corpus>::Input, S>,
|
||||||
S: HasCorpus
|
S: HasCorpus
|
||||||
+ HasRand
|
+ HasRand
|
||||||
+ HasMetadata
|
+ HasMetadata
|
||||||
@ -167,20 +167,25 @@ impl<CB, E, EM, S, Z> SyncFromDiskStage<CB, E, EM, S, Z> {
|
|||||||
|
|
||||||
/// Function type when the callback in `SyncFromDiskStage` is not a lambda
|
/// Function type when the callback in `SyncFromDiskStage` is not a lambda
|
||||||
pub type SyncFromDiskFunction<S, Z> =
|
pub type SyncFromDiskFunction<S, Z> =
|
||||||
fn(&mut Z, &mut S, &Path) -> Result<<S as UsesInput>::Input, Error>;
|
fn(&mut Z, &mut S, &Path) -> Result<<<S as HasCorpus>::Corpus as Corpus>::Input, Error>;
|
||||||
|
|
||||||
impl<E, EM, S, Z> SyncFromDiskStage<SyncFromDiskFunction<Z::State, Z>, E, EM, S, Z>
|
impl<E, EM, S, Z> SyncFromDiskStage<SyncFromDiskFunction<S, Z>, E, EM, S, Z>
|
||||||
where
|
where
|
||||||
Z: Evaluator<E, EM>,
|
S: HasCorpus,
|
||||||
|
<S::Corpus as Corpus>::Input: Input,
|
||||||
|
Z: Evaluator<E, EM, <S::Corpus as Corpus>::Input, S>,
|
||||||
{
|
{
|
||||||
/// Creates a new [`SyncFromDiskStage`] invoking `Input::from_file` to load inputs
|
/// Creates a new [`SyncFromDiskStage`] invoking `Input::from_file` to load inputs
|
||||||
#[must_use]
|
#[must_use]
|
||||||
pub fn with_from_file(sync_dirs: Vec<PathBuf>, interval: Duration) -> Self {
|
pub fn with_from_file(sync_dirs: Vec<PathBuf>, interval: Duration) -> Self {
|
||||||
fn load_callback<S: UsesInput, Z>(
|
fn load_callback<S: HasCorpus, Z>(
|
||||||
_: &mut Z,
|
_: &mut Z,
|
||||||
_: &mut S,
|
_: &mut S,
|
||||||
p: &Path,
|
p: &Path,
|
||||||
) -> Result<S::Input, Error> {
|
) -> Result<<S::Corpus as Corpus>::Input, Error>
|
||||||
|
where
|
||||||
|
<S::Corpus as Corpus>::Input: Input,
|
||||||
|
{
|
||||||
Input::from_file(p)
|
Input::from_file(p)
|
||||||
}
|
}
|
||||||
Self {
|
Self {
|
||||||
@ -240,7 +245,8 @@ where
|
|||||||
SP: ShMemProvider,
|
SP: ShMemProvider,
|
||||||
E: HasObservers + Executor<EM, Z, State = S>,
|
E: HasObservers + Executor<EM, Z, State = S>,
|
||||||
for<'a> E::Observers: Deserialize<'a>,
|
for<'a> E::Observers: Deserialize<'a>,
|
||||||
Z: EvaluatorObservers<EM, E::Observers> + ExecutionProcessor<EM, E::Observers, State = S>,
|
Z: EvaluatorObservers<E, EM, <S::Corpus as Corpus>::Input, S>
|
||||||
|
+ ExecutionProcessor<EM, <S::Corpus as Corpus>::Input, E::Observers, S>,
|
||||||
IC: InputConverter<From = <S::Corpus as Corpus>::Input, To = DI>,
|
IC: InputConverter<From = <S::Corpus as Corpus>::Input, To = DI>,
|
||||||
ICB: InputConverter<From = DI, To = <S::Corpus as Corpus>::Input>,
|
ICB: InputConverter<From = DI, To = <S::Corpus as Corpus>::Input>,
|
||||||
DI: Input,
|
DI: Input,
|
||||||
|
@ -59,9 +59,9 @@ pub struct StdTMinMutationalStage<E, EM, F, FF, M, S, Z> {
|
|||||||
|
|
||||||
impl<E, EM, F, FF, M, S, Z> Stage<E, EM, S, Z> for StdTMinMutationalStage<E, EM, F, FF, M, S, Z>
|
impl<E, EM, F, FF, M, S, Z> Stage<E, EM, S, Z> for StdTMinMutationalStage<E, EM, F, FF, M, S, Z>
|
||||||
where
|
where
|
||||||
Z: HasScheduler<State = S>
|
Z: HasScheduler<<S::Corpus as Corpus>::Input, S>
|
||||||
+ ExecutionProcessor<EM, E::Observers>
|
+ ExecutionProcessor<EM, <S::Corpus as Corpus>::Input, E::Observers, S>
|
||||||
+ ExecutesInput<E, EM>
|
+ ExecutesInput<E, EM, <S::Corpus as Corpus>::Input, S>
|
||||||
+ HasFeedback,
|
+ HasFeedback,
|
||||||
Z::Scheduler: RemovableScheduler<<S::Corpus as Corpus>::Input, S>,
|
Z::Scheduler: RemovableScheduler<<S::Corpus as Corpus>::Input, S>,
|
||||||
E: HasObservers + UsesState<State = S>,
|
E: HasObservers + UsesState<State = S>,
|
||||||
@ -94,7 +94,7 @@ where
|
|||||||
&mut self,
|
&mut self,
|
||||||
fuzzer: &mut Z,
|
fuzzer: &mut Z,
|
||||||
executor: &mut E,
|
executor: &mut E,
|
||||||
state: &mut Z::State,
|
state: &mut S,
|
||||||
manager: &mut EM,
|
manager: &mut EM,
|
||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
self.perform_minification(fuzzer, executor, state, manager)?;
|
self.perform_minification(fuzzer, executor, state, manager)?;
|
||||||
@ -130,14 +130,14 @@ pub static TMIN_STAGE_NAME: &str = "tmin";
|
|||||||
|
|
||||||
impl<E, EM, F, FF, M, S, Z> StdTMinMutationalStage<E, EM, F, FF, M, S, Z>
|
impl<E, EM, F, FF, M, S, Z> StdTMinMutationalStage<E, EM, F, FF, M, S, Z>
|
||||||
where
|
where
|
||||||
Z: HasScheduler<State = S>
|
Z: HasScheduler<<S::Corpus as Corpus>::Input, S>
|
||||||
+ ExecutionProcessor<EM, E::Observers>
|
+ ExecutionProcessor<EM, <S::Corpus as Corpus>::Input, E::Observers, S>
|
||||||
+ ExecutesInput<E, EM>
|
+ ExecutesInput<E, EM, <S::Corpus as Corpus>::Input, S>
|
||||||
+ HasFeedback,
|
+ HasFeedback,
|
||||||
Z::Scheduler: RemovableScheduler<<S::Corpus as Corpus>::Input, S>,
|
Z::Scheduler: RemovableScheduler<<S::Corpus as Corpus>::Input, S>,
|
||||||
E: HasObservers + UsesState<State = Z::State>,
|
E: HasObservers + UsesState<State = S>,
|
||||||
E::Observers: ObserversTuple<<S::Corpus as Corpus>::Input, S> + Serialize,
|
E::Observers: ObserversTuple<<S::Corpus as Corpus>::Input, S> + Serialize,
|
||||||
EM: EventFirer<State = Z::State>,
|
EM: EventFirer<State = S>,
|
||||||
FF: FeedbackFactory<F, E::Observers>,
|
FF: FeedbackFactory<F, E::Observers>,
|
||||||
F: Feedback<EM, <S::Corpus as Corpus>::Input, E::Observers, S>,
|
F: Feedback<EM, <S::Corpus as Corpus>::Input, E::Observers, S>,
|
||||||
S: HasMetadata
|
S: HasMetadata
|
||||||
|
@ -42,7 +42,6 @@ where
|
|||||||
+ MaybeHasClientPerfMonitor
|
+ MaybeHasClientPerfMonitor
|
||||||
+ UsesInput<Input = <S::Corpus as Corpus>::Input>,
|
+ UsesInput<Input = <S::Corpus as Corpus>::Input>,
|
||||||
EM: UsesState<State = S>, //delete me
|
EM: UsesState<State = S>, //delete me
|
||||||
Z: UsesState<State = S>, //delete me
|
|
||||||
{
|
{
|
||||||
#[allow(rustdoc::broken_intra_doc_links)]
|
#[allow(rustdoc::broken_intra_doc_links)]
|
||||||
/// Perform tracing on the given `CorpusId`. Useful for if wrapping [`TracingStage`] with your
|
/// Perform tracing on the given `CorpusId`. Useful for if wrapping [`TracingStage`] with your
|
||||||
@ -87,7 +86,6 @@ where
|
|||||||
+ MaybeHasClientPerfMonitor
|
+ MaybeHasClientPerfMonitor
|
||||||
+ UsesInput<Input = <S::Corpus as Corpus>::Input>,
|
+ UsesInput<Input = <S::Corpus as Corpus>::Input>,
|
||||||
EM: UsesState<State = S>,
|
EM: UsesState<State = S>,
|
||||||
Z: UsesState<State = S>,
|
|
||||||
<S::Corpus as Corpus>::Input: Input,
|
<S::Corpus as Corpus>::Input: Input,
|
||||||
{
|
{
|
||||||
#[inline]
|
#[inline]
|
||||||
@ -183,7 +181,6 @@ where
|
|||||||
+ MaybeHasClientPerfMonitor
|
+ MaybeHasClientPerfMonitor
|
||||||
+ UsesInput<Input = <S::Corpus as Corpus>::Input>,
|
+ UsesInput<Input = <S::Corpus as Corpus>::Input>,
|
||||||
EM: UsesState<State = S>,
|
EM: UsesState<State = S>,
|
||||||
Z: UsesState<State = S>,
|
|
||||||
{
|
{
|
||||||
#[inline]
|
#[inline]
|
||||||
fn perform(
|
fn perform(
|
||||||
@ -232,11 +229,10 @@ where
|
|||||||
|
|
||||||
impl<E, EM, SOT, S, Z> ShadowTracingStage<E, EM, SOT, S, Z>
|
impl<E, EM, SOT, S, Z> ShadowTracingStage<E, EM, SOT, S, Z>
|
||||||
where
|
where
|
||||||
E: Executor<EM, Z, State = Z::State> + HasObservers,
|
E: Executor<EM, Z, State = S> + HasObservers,
|
||||||
S: HasExecutions + HasCorpus,
|
S: HasExecutions + HasCorpus + UsesInput,
|
||||||
SOT: ObserversTuple<<S::Corpus as Corpus>::Input, S>,
|
SOT: ObserversTuple<<S::Corpus as Corpus>::Input, S>,
|
||||||
EM: UsesState<State = Z::State>,
|
EM: UsesState<State = S>,
|
||||||
Z: UsesState,
|
|
||||||
{
|
{
|
||||||
/// Creates a new default stage
|
/// Creates a new default stage
|
||||||
pub fn new(_executor: &mut ShadowExecutor<E, SOT>) -> Self {
|
pub fn new(_executor: &mut ShadowExecutor<E, SOT>) -> Self {
|
||||||
|
@ -164,7 +164,7 @@ pub struct TuneableMutationalStage<E, EM, I, M, S, Z> {
|
|||||||
impl<E, EM, I, M, S, Z> MutationalStage<S> for TuneableMutationalStage<E, EM, I, M, S, Z>
|
impl<E, EM, I, M, S, Z> MutationalStage<S> for TuneableMutationalStage<E, EM, I, M, S, Z>
|
||||||
where
|
where
|
||||||
M: Mutator<I, S>,
|
M: Mutator<I, S>,
|
||||||
Z: Evaluator<E, EM>,
|
Z: Evaluator<E, EM, <S::Corpus as Corpus>::Input, S>,
|
||||||
S: HasCorpus + HasRand + HasNamedMetadata + HasMetadata + HasExecutions + HasCurrentTestcase,
|
S: HasCorpus + HasRand + HasNamedMetadata + HasMetadata + HasExecutions + HasCurrentTestcase,
|
||||||
I: MutatedTransform<<S::Corpus as Corpus>::Input, S> + Clone,
|
I: MutatedTransform<<S::Corpus as Corpus>::Input, S> + Clone,
|
||||||
<S::Corpus as Corpus>::Input: Input,
|
<S::Corpus as Corpus>::Input: Input,
|
||||||
@ -196,7 +196,7 @@ where
|
|||||||
impl<E, EM, I, M, S, Z> Stage<E, EM, S, Z> for TuneableMutationalStage<E, EM, I, M, S, Z>
|
impl<E, EM, I, M, S, Z> Stage<E, EM, S, Z> for TuneableMutationalStage<E, EM, I, M, S, Z>
|
||||||
where
|
where
|
||||||
M: Mutator<I, S>,
|
M: Mutator<I, S>,
|
||||||
Z: Evaluator<E, EM, State = S>,
|
Z: Evaluator<E, EM, <S::Corpus as Corpus>::Input, S>,
|
||||||
S: HasCorpus
|
S: HasCorpus
|
||||||
+ HasRand
|
+ HasRand
|
||||||
+ HasNamedMetadata
|
+ HasNamedMetadata
|
||||||
@ -237,7 +237,7 @@ where
|
|||||||
impl<E, EM, I, M, S, Z> TuneableMutationalStage<E, EM, I, M, S, Z>
|
impl<E, EM, I, M, S, Z> TuneableMutationalStage<E, EM, I, M, S, Z>
|
||||||
where
|
where
|
||||||
M: Mutator<I, S>,
|
M: Mutator<I, S>,
|
||||||
Z: Evaluator<E, EM, State = S>,
|
Z: Evaluator<E, EM, <S::Corpus as Corpus>::Input, S>,
|
||||||
S: HasCorpus
|
S: HasCorpus
|
||||||
+ HasRand
|
+ HasRand
|
||||||
+ HasNamedMetadata
|
+ HasNamedMetadata
|
||||||
@ -469,8 +469,8 @@ where
|
|||||||
|
|
||||||
impl<E, EM, I, M, S, Z> TuneableMutationalStage<E, EM, I, M, S, Z>
|
impl<E, EM, I, M, S, Z> TuneableMutationalStage<E, EM, I, M, S, Z>
|
||||||
where
|
where
|
||||||
M: Mutator<I, Z::State>,
|
M: Mutator<I, S>,
|
||||||
Z: Evaluator<E, EM>,
|
Z: Evaluator<E, EM, <S::Corpus as Corpus>::Input, S>,
|
||||||
S: HasCorpus + HasRand + HasNamedMetadata,
|
S: HasCorpus + HasRand + HasNamedMetadata,
|
||||||
{
|
{
|
||||||
/// Creates a new transforming mutational stage
|
/// Creates a new transforming mutational stage
|
||||||
|
@ -86,7 +86,7 @@ where
|
|||||||
E::Observers: ObserversTuple<<S::Corpus as Corpus>::Input, S>,
|
E::Observers: ObserversTuple<<S::Corpus as Corpus>::Input, S>,
|
||||||
E: Executor<EM, Z, State = S> + HasObservers + HasTimeout,
|
E: Executor<EM, Z, State = S> + HasObservers + HasTimeout,
|
||||||
EM: UsesState<State = S>,
|
EM: UsesState<State = S>,
|
||||||
Z: Evaluator<E, EM, State = S>,
|
Z: Evaluator<E, EM, <S::Corpus as Corpus>::Input, S>,
|
||||||
S: HasCorpus + HasMetadata + UsesInput<Input = <S::Corpus as Corpus>::Input>,
|
S: HasCorpus + HasMetadata + UsesInput<Input = <S::Corpus as Corpus>::Input>,
|
||||||
<S::Corpus as Corpus>::Input: Debug + Serialize + DeserializeOwned + Default + 'static + Clone,
|
<S::Corpus as Corpus>::Input: Debug + Serialize + DeserializeOwned + Default + 'static + Clone,
|
||||||
{
|
{
|
||||||
|
@ -725,7 +725,7 @@ where
|
|||||||
where
|
where
|
||||||
E: UsesState<State = Self>,
|
E: UsesState<State = Self>,
|
||||||
EM: EventFirer<State = Self>,
|
EM: EventFirer<State = Self>,
|
||||||
Z: Evaluator<E, EM, State = Self>,
|
Z: Evaluator<E, EM, I, Self>,
|
||||||
{
|
{
|
||||||
if let Some(remaining) = self.remaining_initial_files.as_ref() {
|
if let Some(remaining) = self.remaining_initial_files.as_ref() {
|
||||||
// everything was loaded
|
// everything was loaded
|
||||||
@ -750,7 +750,7 @@ where
|
|||||||
where
|
where
|
||||||
E: UsesState<State = Self>,
|
E: UsesState<State = Self>,
|
||||||
EM: EventFirer<State = Self>,
|
EM: EventFirer<State = Self>,
|
||||||
Z: Evaluator<E, EM, State = Self>,
|
Z: Evaluator<E, EM, I, Self>,
|
||||||
{
|
{
|
||||||
log::info!("Loading file {:?} ...", &path);
|
log::info!("Loading file {:?} ...", &path);
|
||||||
let input = (config.loader)(fuzzer, self, path)?;
|
let input = (config.loader)(fuzzer, self, path)?;
|
||||||
@ -779,7 +779,7 @@ where
|
|||||||
where
|
where
|
||||||
E: UsesState<State = Self>,
|
E: UsesState<State = Self>,
|
||||||
EM: EventFirer<State = Self>,
|
EM: EventFirer<State = Self>,
|
||||||
Z: Evaluator<E, EM, State = Self>,
|
Z: Evaluator<E, EM, I, Self>,
|
||||||
{
|
{
|
||||||
loop {
|
loop {
|
||||||
match self.next_file() {
|
match self.next_file() {
|
||||||
@ -844,7 +844,7 @@ where
|
|||||||
where
|
where
|
||||||
E: UsesState<State = Self>,
|
E: UsesState<State = Self>,
|
||||||
EM: EventFirer<State = Self>,
|
EM: EventFirer<State = Self>,
|
||||||
Z: Evaluator<E, EM, State = Self>,
|
Z: Evaluator<E, EM, I, Self>,
|
||||||
{
|
{
|
||||||
self.load_initial_inputs_custom_by_filenames(
|
self.load_initial_inputs_custom_by_filenames(
|
||||||
fuzzer,
|
fuzzer,
|
||||||
@ -872,7 +872,7 @@ where
|
|||||||
where
|
where
|
||||||
E: UsesState<State = Self>,
|
E: UsesState<State = Self>,
|
||||||
EM: EventFirer<State = Self>,
|
EM: EventFirer<State = Self>,
|
||||||
Z: Evaluator<E, EM, State = Self>,
|
Z: Evaluator<E, EM, I, Self>,
|
||||||
{
|
{
|
||||||
self.canonicalize_input_dirs(in_dirs)?;
|
self.canonicalize_input_dirs(in_dirs)?;
|
||||||
self.continue_loading_initial_inputs_custom(
|
self.continue_loading_initial_inputs_custom(
|
||||||
@ -899,7 +899,7 @@ where
|
|||||||
where
|
where
|
||||||
E: UsesState<State = Self>,
|
E: UsesState<State = Self>,
|
||||||
EM: EventFirer<State = Self>,
|
EM: EventFirer<State = Self>,
|
||||||
Z: Evaluator<E, EM, State = Self>,
|
Z: Evaluator<E, EM, I, Self>,
|
||||||
{
|
{
|
||||||
self.load_initial_inputs_custom_by_filenames(
|
self.load_initial_inputs_custom_by_filenames(
|
||||||
fuzzer,
|
fuzzer,
|
||||||
@ -925,7 +925,7 @@ where
|
|||||||
where
|
where
|
||||||
E: UsesState<State = Self>,
|
E: UsesState<State = Self>,
|
||||||
EM: EventFirer<State = Self>,
|
EM: EventFirer<State = Self>,
|
||||||
Z: Evaluator<E, EM, State = Self>,
|
Z: Evaluator<E, EM, I, Self>,
|
||||||
{
|
{
|
||||||
self.canonicalize_input_dirs(in_dirs)?;
|
self.canonicalize_input_dirs(in_dirs)?;
|
||||||
self.continue_loading_initial_inputs_custom(
|
self.continue_loading_initial_inputs_custom(
|
||||||
@ -952,7 +952,7 @@ where
|
|||||||
where
|
where
|
||||||
E: UsesState<State = Self>,
|
E: UsesState<State = Self>,
|
||||||
EM: EventFirer<State = Self>,
|
EM: EventFirer<State = Self>,
|
||||||
Z: Evaluator<E, EM, State = Self>,
|
Z: Evaluator<E, EM, I, Self>,
|
||||||
{
|
{
|
||||||
self.canonicalize_input_dirs(in_dirs)?;
|
self.canonicalize_input_dirs(in_dirs)?;
|
||||||
self.continue_loading_initial_inputs_custom(
|
self.continue_loading_initial_inputs_custom(
|
||||||
@ -994,7 +994,7 @@ where
|
|||||||
where
|
where
|
||||||
E: UsesState<State = Self>,
|
E: UsesState<State = Self>,
|
||||||
EM: EventFirer<State = Self>,
|
EM: EventFirer<State = Self>,
|
||||||
Z: Evaluator<E, EM, State = Self>,
|
Z: Evaluator<E, EM, I, Self>,
|
||||||
{
|
{
|
||||||
if self.multicore_inputs_processed.unwrap_or(false) {
|
if self.multicore_inputs_processed.unwrap_or(false) {
|
||||||
self.continue_loading_initial_inputs_custom(
|
self.continue_loading_initial_inputs_custom(
|
||||||
@ -1090,7 +1090,7 @@ where
|
|||||||
E: UsesState<State = Self>,
|
E: UsesState<State = Self>,
|
||||||
EM: EventFirer<State = Self>,
|
EM: EventFirer<State = Self>,
|
||||||
G: Generator<<Self as UsesInput>::Input, Self>,
|
G: Generator<<Self as UsesInput>::Input, Self>,
|
||||||
Z: Evaluator<E, EM, State = Self>,
|
Z: Evaluator<E, EM, I, Self>,
|
||||||
{
|
{
|
||||||
let mut added = 0;
|
let mut added = 0;
|
||||||
for _ in 0..num {
|
for _ in 0..num {
|
||||||
@ -1129,7 +1129,7 @@ where
|
|||||||
E: UsesState<State = Self>,
|
E: UsesState<State = Self>,
|
||||||
EM: EventFirer<State = Self>,
|
EM: EventFirer<State = Self>,
|
||||||
G: Generator<<Self as UsesInput>::Input, Self>,
|
G: Generator<<Self as UsesInput>::Input, Self>,
|
||||||
Z: Evaluator<E, EM, State = Self>,
|
Z: Evaluator<E, EM, I, Self>,
|
||||||
{
|
{
|
||||||
self.generate_initial_internal(fuzzer, executor, generator, manager, num, true)
|
self.generate_initial_internal(fuzzer, executor, generator, manager, num, true)
|
||||||
}
|
}
|
||||||
@ -1147,7 +1147,7 @@ where
|
|||||||
E: UsesState<State = Self>,
|
E: UsesState<State = Self>,
|
||||||
EM: EventFirer<State = Self>,
|
EM: EventFirer<State = Self>,
|
||||||
G: Generator<<Self as UsesInput>::Input, Self>,
|
G: Generator<<Self as UsesInput>::Input, Self>,
|
||||||
Z: Evaluator<E, EM, State = Self>,
|
Z: Evaluator<E, EM, I, Self>,
|
||||||
{
|
{
|
||||||
self.generate_initial_internal(fuzzer, executor, generator, manager, num, false)
|
self.generate_initial_internal(fuzzer, executor, generator, manager, num, false)
|
||||||
}
|
}
|
||||||
|
@ -74,7 +74,6 @@ where
|
|||||||
TC: TargetBytesConverter<Input = S::Input>,
|
TC: TargetBytesConverter<Input = S::Input>,
|
||||||
OT: ObserversTuple<S::Input, S>,
|
OT: ObserversTuple<S::Input, S>,
|
||||||
RT: FridaRuntimeTuple,
|
RT: FridaRuntimeTuple,
|
||||||
Z: UsesState<State = S>,
|
|
||||||
{
|
{
|
||||||
/// Instruct the target about the input and run
|
/// Instruct the target about the input and run
|
||||||
#[inline]
|
#[inline]
|
||||||
|
@ -62,7 +62,7 @@ fn do_fuzz<F, ST, E, S, EM>(
|
|||||||
mgr: &mut EM,
|
mgr: &mut EM,
|
||||||
) -> Result<(), Error>
|
) -> Result<(), Error>
|
||||||
where
|
where
|
||||||
F: Fuzzer<E, EM, ST, State = S>,
|
F: Fuzzer<E, EM, S, ST>,
|
||||||
S: HasMetadata
|
S: HasMetadata
|
||||||
+ HasExecutions
|
+ HasExecutions
|
||||||
+ UsesInput
|
+ UsesInput
|
||||||
|
@ -23,7 +23,7 @@ fn do_report<F, ST, E, S, EM>(
|
|||||||
_mgr: &mut EM,
|
_mgr: &mut EM,
|
||||||
) -> Result<(), Error>
|
) -> Result<(), Error>
|
||||||
where
|
where
|
||||||
F: Fuzzer<E, EM, ST, State = S>,
|
F: Fuzzer<E, EM, S, ST>,
|
||||||
S: HasMetadata
|
S: HasMetadata
|
||||||
+ HasNamedMetadata
|
+ HasNamedMetadata
|
||||||
+ HasExecutions
|
+ HasExecutions
|
||||||
|
@ -13,7 +13,7 @@ use libafl::{
|
|||||||
schedulers::QueueScheduler,
|
schedulers::QueueScheduler,
|
||||||
stages::StdTMinMutationalStage,
|
stages::StdTMinMutationalStage,
|
||||||
state::{HasCorpus, StdState},
|
state::{HasCorpus, StdState},
|
||||||
Error, Fuzzer, StdFuzzer,
|
Error, ExecutesInput, Fuzzer, StdFuzzer,
|
||||||
};
|
};
|
||||||
use libafl_bolts::{
|
use libafl_bolts::{
|
||||||
rands::{RomuDuoJrRand, StdRand},
|
rands::{RomuDuoJrRand, StdRand},
|
||||||
|
@ -50,7 +50,6 @@ where
|
|||||||
EM: UsesState<State = S>,
|
EM: UsesState<State = S>,
|
||||||
S: State + HasExecutions,
|
S: State + HasExecutions,
|
||||||
S::Input: HasTargetBytes,
|
S::Input: HasTargetBytes,
|
||||||
Z: UsesState<State = S>,
|
|
||||||
OT: ObserversTuple<S::Input, S>,
|
OT: ObserversTuple<S::Input, S>,
|
||||||
{
|
{
|
||||||
fn run_target(
|
fn run_target(
|
||||||
|
@ -98,7 +98,7 @@ pub unsafe fn inproc_qemu_timeout_handler<E, EM, ET, OF, S, Z>(
|
|||||||
ET: EmulatorModuleTuple<S>,
|
ET: EmulatorModuleTuple<S>,
|
||||||
OF: Feedback<EM, E::Input, E::Observers, E::State>,
|
OF: Feedback<EM, E::Input, E::Observers, E::State>,
|
||||||
S: State + Unpin,
|
S: State + Unpin,
|
||||||
Z: HasObjective<Objective = OF, State = E::State>,
|
Z: HasObjective<Objective = OF>,
|
||||||
<<E as UsesState>::State as HasSolutions>::Solutions: Corpus<Input = E::Input>, //delete me
|
<<E as UsesState>::State as HasSolutions>::Solutions: Corpus<Input = E::Input>, //delete me
|
||||||
<<<E as UsesState>::State as HasCorpus>::Corpus as Corpus>::Input: Clone, //delete me
|
<<<E as UsesState>::State as HasCorpus>::Corpus as Corpus>::Input: Clone, //delete me
|
||||||
{
|
{
|
||||||
@ -166,9 +166,10 @@ where
|
|||||||
EM: EventFirer<State = S> + EventRestarter<State = S>,
|
EM: EventFirer<State = S> + EventRestarter<State = S>,
|
||||||
OF: Feedback<EM, S::Input, OT, S>,
|
OF: Feedback<EM, S::Input, OT, S>,
|
||||||
S: Unpin + State + HasExecutions + HasCorpus + HasSolutions,
|
S: Unpin + State + HasExecutions + HasCorpus + HasSolutions,
|
||||||
Z: HasObjective<Objective = OF, State = S>
|
S::Corpus: Corpus<Input = S::Input>,
|
||||||
+ HasScheduler<State = S>
|
Z: HasObjective<Objective = OF>
|
||||||
+ ExecutionProcessor<EM, OT>,
|
+ HasScheduler<<S::Corpus as Corpus>::Input, S>
|
||||||
|
+ ExecutionProcessor<EM, <S::Corpus as Corpus>::Input, OT, S>,
|
||||||
S::Solutions: Corpus<Input = S::Input>, //delete me
|
S::Solutions: Corpus<Input = S::Input>, //delete me
|
||||||
<S::Corpus as Corpus>::Input: Clone, //delete me
|
<S::Corpus as Corpus>::Input: Clone, //delete me
|
||||||
{
|
{
|
||||||
@ -241,7 +242,6 @@ where
|
|||||||
H: FnMut(&mut Emulator<CM, ED, ET, S, SM>, &mut S, &S::Input) -> ExitKind,
|
H: FnMut(&mut Emulator<CM, ED, ET, S, SM>, &mut S, &S::Input) -> ExitKind,
|
||||||
OT: ObserversTuple<S::Input, S>,
|
OT: ObserversTuple<S::Input, S>,
|
||||||
S: State + HasExecutions + Unpin,
|
S: State + HasExecutions + Unpin,
|
||||||
Z: UsesState<State = S>,
|
|
||||||
{
|
{
|
||||||
fn run_target(
|
fn run_target(
|
||||||
&mut self,
|
&mut self,
|
||||||
@ -315,7 +315,6 @@ where
|
|||||||
OT: ObserversTuple<S::Input, S>,
|
OT: ObserversTuple<S::Input, S>,
|
||||||
S: UsesInput,
|
S: UsesInput,
|
||||||
SP: ShMemProvider,
|
SP: ShMemProvider,
|
||||||
Z: UsesState<State = S>,
|
|
||||||
{
|
{
|
||||||
inner: QemuInProcessForkExecutor<'a, CM, ED, EM, ET, H, OT, S, SM, SP, Z>,
|
inner: QemuInProcessForkExecutor<'a, CM, ED, EM, ET, H, OT, S, SM, SP, Z>,
|
||||||
}
|
}
|
||||||
@ -333,7 +332,6 @@ where
|
|||||||
S: UsesInput + Debug,
|
S: UsesInput + Debug,
|
||||||
SM: Debug,
|
SM: Debug,
|
||||||
SP: ShMemProvider,
|
SP: ShMemProvider,
|
||||||
Z: UsesState<State = S>,
|
|
||||||
{
|
{
|
||||||
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
|
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
|
||||||
f.debug_struct("QemuForkExecutor")
|
f.debug_struct("QemuForkExecutor")
|
||||||
@ -354,7 +352,7 @@ where
|
|||||||
OT: ObserversTuple<S::Input, S>,
|
OT: ObserversTuple<S::Input, S>,
|
||||||
S: State + HasSolutions,
|
S: State + HasSolutions,
|
||||||
SP: ShMemProvider,
|
SP: ShMemProvider,
|
||||||
Z: HasObjective<State = S>,
|
Z: HasObjective,
|
||||||
Z::Objective: Feedback<EM, S::Input, OT, S>,
|
Z::Objective: Feedback<EM, S::Input, OT, S>,
|
||||||
{
|
{
|
||||||
#[allow(clippy::too_many_arguments)]
|
#[allow(clippy::too_many_arguments)]
|
||||||
@ -416,7 +414,7 @@ where
|
|||||||
OT: ObserversTuple<S::Input, S> + Debug,
|
OT: ObserversTuple<S::Input, S> + Debug,
|
||||||
S: State + HasExecutions + Unpin,
|
S: State + HasExecutions + Unpin,
|
||||||
SP: ShMemProvider,
|
SP: ShMemProvider,
|
||||||
Z: HasObjective<Objective = OF, State = S>,
|
Z: HasObjective<Objective = OF>,
|
||||||
{
|
{
|
||||||
fn run_target(
|
fn run_target(
|
||||||
&mut self,
|
&mut self,
|
||||||
@ -452,7 +450,6 @@ where
|
|||||||
OT: ObserversTuple<S::Input, S>,
|
OT: ObserversTuple<S::Input, S>,
|
||||||
S: State,
|
S: State,
|
||||||
SP: ShMemProvider,
|
SP: ShMemProvider,
|
||||||
Z: UsesState<State = S>,
|
|
||||||
{
|
{
|
||||||
type State = S;
|
type State = S;
|
||||||
}
|
}
|
||||||
@ -468,7 +465,6 @@ where
|
|||||||
OT: ObserversTuple<S::Input, S>,
|
OT: ObserversTuple<S::Input, S>,
|
||||||
S: State,
|
S: State,
|
||||||
SP: ShMemProvider,
|
SP: ShMemProvider,
|
||||||
Z: UsesState<State = S>,
|
|
||||||
{
|
{
|
||||||
type Observers = OT;
|
type Observers = OT;
|
||||||
#[inline]
|
#[inline]
|
||||||
|
@ -38,7 +38,6 @@ impl<EM, TE, S, Z> Named for AFLppCmplogTracingStage<'_, EM, TE, S, Z> {
|
|||||||
impl<E, EM, TE, S, Z> Stage<E, EM, S, Z> for AFLppCmplogTracingStage<'_, EM, TE, S, Z>
|
impl<E, EM, TE, S, Z> Stage<E, EM, S, Z> for AFLppCmplogTracingStage<'_, EM, TE, S, Z>
|
||||||
where
|
where
|
||||||
EM: UsesState<State = S>,
|
EM: UsesState<State = S>,
|
||||||
Z: UsesState<State = S>,
|
|
||||||
TE: HasObservers + Executor<EM, Z, State = S>,
|
TE: HasObservers + Executor<EM, Z, State = S>,
|
||||||
TE::Observers: MatchNameRef + ObserversTuple<BytesInput, S>,
|
TE::Observers: MatchNameRef + ObserversTuple<BytesInput, S>,
|
||||||
S: HasCorpus
|
S: HasCorpus
|
||||||
|
@ -37,7 +37,7 @@ where
|
|||||||
OF: Feedback<EM, E::Input, E::Observers, E::State>,
|
OF: Feedback<EM, E::Input, E::Observers, E::State>,
|
||||||
E::State: HasSolutions + HasCorpus + HasExecutions,
|
E::State: HasSolutions + HasCorpus + HasExecutions,
|
||||||
E::Observers: ObserversTuple<<E::State as UsesInput>::Input, E::State>,
|
E::Observers: ObserversTuple<<E::State as UsesInput>::Input, E::State>,
|
||||||
Z: HasObjective<Objective = OF, State = E::State>,
|
Z: HasObjective<Objective = OF>,
|
||||||
<<E as UsesState>::State as HasSolutions>::Solutions: Corpus<Input = E::Input>, //delete me
|
<<E as UsesState>::State as HasSolutions>::Solutions: Corpus<Input = E::Input>, //delete me
|
||||||
<<<E as UsesState>::State as HasCorpus>::Corpus as Corpus>::Input: Clone, //delete me
|
<<<E as UsesState>::State as HasCorpus>::Corpus as Corpus>::Input: Clone, //delete me
|
||||||
{
|
{
|
||||||
|
@ -54,7 +54,6 @@ where
|
|||||||
S: State + HasExecutions,
|
S: State + HasExecutions,
|
||||||
S::Input: HasTargetBytes,
|
S::Input: HasTargetBytes,
|
||||||
SP: ShMemProvider,
|
SP: ShMemProvider,
|
||||||
Z: UsesState<State = S>,
|
|
||||||
{
|
{
|
||||||
#[inline]
|
#[inline]
|
||||||
fn run_target(
|
fn run_target(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user