Skip to content

Commit

Permalink
Better documentation headers (clippy) (AFLplusplus#2501)
Browse files Browse the repository at this point in the history
* Better documentation headers (clippy)

* more doc

* more fixes

* Even more

* more

* even more

* concrete

* fmt

* even more more

* tiny typo

* more

* more

* More

* more

* more docs?

* more docs
  • Loading branch information
domenukk authored Aug 26, 2024
1 parent 07db74b commit e2cc78f
Show file tree
Hide file tree
Showing 54 changed files with 156 additions and 59 deletions.
1 change: 1 addition & 0 deletions libafl/src/corpus/inmemory_ondisk.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//! The [`InMemoryOnDiskCorpus`] stores [`Testcase`]s to disk.
//!
//! Additionally, _all_ of them are kept in memory.
//! For a lower memory footprint, consider using [`crate::corpus::CachedOnDiskCorpus`]
//! which only stores a certain number of [`Testcase`]s and removes additional ones in a FIFO manner.
Expand Down
1 change: 1 addition & 0 deletions libafl/src/corpus/ondisk.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//! The [`OnDiskCorpus`] stores all [`Testcase`]s to disk.
//!
//! It _never_ keeps any of them in memory.
//! This is a good solution for solutions that are never reused, or for *very* memory-constraint environments.
//! For any other occasions, consider using [`crate::corpus::CachedOnDiskCorpus`]
Expand Down
1 change: 1 addition & 0 deletions libafl/src/events/events_hooks/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//! Hooks for event managers, especifically these are used to hook before `handle_in_client`.
//!
//! This will allow user to define pre/post-processing code when the event manager receives any message from
//! other clients
use libafl_bolts::ClientId;
Expand Down
2 changes: 2 additions & 0 deletions libafl/src/events/launcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,8 @@ where
}
}

/// A Launcher that minimizes re-execution of shared testcases.
///
/// Provides a Launcher, which can be used to launch a fuzzing run on a specified list of cores with a single main and multiple secondary nodes
/// This is for centralized, the 4th argument of the closure should mean if this is the main node.
#[cfg(all(unix, feature = "std", feature = "fork"))]
Expand Down
6 changes: 5 additions & 1 deletion libafl/src/events/llmp/restarting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ pub enum ManagerKind {
}

/// Sets up a restarting fuzzer, using the [`StdShMemProvider`], and standard features.
///
/// 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.
#[cfg(feature = "std")]
Expand Down Expand Up @@ -368,6 +369,7 @@ where
}

/// Sets up a restarting fuzzer, using the [`StdShMemProvider`], and standard features.
///
/// 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.
/// This one, additionally uses the timeobserver for the adaptive serialization
Expand Down Expand Up @@ -400,7 +402,9 @@ where
.launch()
}

/// Provides a `builder` which can be used to build a [`RestartingMgr`], which is a combination of a
/// Provides a `builder` which can be used to build a [`RestartingMgr`].
///
/// 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` will start a new process each time the child crashes or times out.
#[cfg(feature = "std")]
Expand Down
3 changes: 2 additions & 1 deletion libafl/src/events/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ pub mod multi_machine;
#[cfg(all(unix, feature = "std"))]
pub static mut EVENTMGR_SIGHANDLER_STATE: ShutdownSignalData = ShutdownSignalData {};

/// A signal handler for catching ctrl-c.
/// A signal handler for catching `ctrl-c`.
///
/// The purpose of this signal handler is solely for calling `exit()` with a specific exit code 100
/// In this way, the restarting manager can tell that we really want to exit
#[cfg(all(unix, feature = "std"))]
Expand Down
4 changes: 3 additions & 1 deletion libafl/src/events/simple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,9 @@ where
}
}

/// Provides a `builder` which can be used to build a [`SimpleRestartingEventManager`], which is a combination of a
/// Provides a `builder` which can be used to build a [`SimpleRestartingEventManager`].
///
/// The [`SimpleRestartingEventManager`] is a combination of a
/// `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.
#[cfg(feature = "std")]
Expand Down
7 changes: 5 additions & 2 deletions libafl/src/events/tcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1074,7 +1074,8 @@ pub enum TcpManagerKind {
}

/// Sets up a restarting fuzzer, using the [`StdShMemProvider`], and standard features.
/// The restarting mgr 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.
#[cfg(feature = "std")]
#[allow(clippy::type_complexity)]
Expand Down Expand Up @@ -1103,7 +1104,9 @@ where
.launch()
}

/// Provides a `builder` which can be used to build a [`TcpRestartingMgr`], which is a combination of a
/// Provides a `builder` which can be used to build a [`TcpRestartingMgr`].
///
/// The [`TcpRestartingMgr`] is a combination of a
/// `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.
#[cfg(feature = "std")]
Expand Down
1 change: 1 addition & 0 deletions libafl/src/executors/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ where
}

/// A `CommandExecutor` is a wrapper around [`std::process::Command`] to execute a target as a child process.
///
/// Construct a `CommandExecutor` by implementing [`CommandConfigurator`] for a type of your choice and calling [`CommandConfigurator::into_executor`] on it.
/// Instead, you can use [`CommandExecutor::builder()`] to construct a [`CommandExecutor`] backed by a [`StdCommandConfigurator`].
pub struct CommandExecutor<OT, S, T> {
Expand Down
1 change: 1 addition & 0 deletions libafl/src/executors/differential.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//! Executor for differential fuzzing.
//!
//! It wraps two executors that will be run after each other with the same input.
//! In comparison to the [`crate::executors::CombinedExecutor`] it also runs the secondary executor in `run_target`.
//!
Expand Down
1 change: 1 addition & 0 deletions libafl/src/executors/forkserver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,7 @@ impl Forkserver {
}

/// This [`Executor`] can run binaries compiled for AFL/AFL++ that make use of a forkserver.
///
/// Shared memory feature is also available, but you have to set things up in your code.
/// Please refer to AFL++'s docs. <https://github.com/AFLplusplus/AFLplusplus/blob/stable/instrumentation/README.persistent_mode.md>
pub struct ForkserverExecutor<OT, S, SP>
Expand Down
9 changes: 6 additions & 3 deletions libafl/src/executors/inprocess_fork/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@ pub(crate) type ForkHandlerFuncPtr = unsafe fn(

/// The inner structure of `InProcessForkExecutor`.
pub mod inner;
/// A version of `InProcessForkExecutor` with a state accessible from the harness.
pub mod stateful;

/// The `InProcessForkExecutor` with no user hooks. On Linux, when fuzzing a Rust target, set `panic = "abort"` in your `Cargo.toml` (see [Cargo documentation](https://doc.rust-lang.org/cargo/reference/profiles.html#panic)).
/// The `InProcessForkExecutor` with no user hooks.
///
/// On Linux, when fuzzing a Rust target, set `panic = "abort"` in your `Cargo.toml` (see [Cargo documentation](https://doc.rust-lang.org/cargo/reference/profiles.html#panic)).
/// Else panics can not be caught by `LibAFL`.
pub type InProcessForkExecutor<'a, H, OT, S, SP, EM, Z> =
GenericInProcessForkExecutor<'a, H, (), OT, S, SP, EM, Z>;
Expand Down Expand Up @@ -80,7 +81,9 @@ where
}
}

/// [`GenericInProcessForkExecutor`] is an executor that forks the current process before each execution. On Linux, when fuzzing a Rust target, set `panic = "abort"` in your `Cargo.toml` (see [Cargo documentation](https://doc.rust-lang.org/cargo/reference/profiles.html#panic)).
/// [`GenericInProcessForkExecutor`] is an executor that forks the current process before each execution.
///
/// On Linux, when fuzzing a Rust target, set `panic = "abort"` in your `Cargo.toml` (see [Cargo documentation](https://doc.rust-lang.org/cargo/reference/profiles.html#panic)).
/// Else panics can not be caught by `LibAFL`.
pub struct GenericInProcessForkExecutor<'a, H, HT, OT, S, SP, EM, Z>
where
Expand Down
5 changes: 4 additions & 1 deletion libafl/src/executors/inprocess_fork/stateful.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
//! The `StatefulGenericInProcessForkExecutor` to do forking before executing the harness in-processly. Harness can access internal state.
//! A version of `InProcessForkExecutor` with a state accessible from the harness.
//!
//! The `StatefulGenericInProcessForkExecutor` to do forking before executing the harness in-process.
//! The harness can access internal state.
use core::{
fmt::{self, Debug, Formatter},
marker::PhantomData,
Expand Down
2 changes: 2 additions & 0 deletions libafl/src/feedbacks/concolic.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//! Concolic feedback for concolic fuzzing.
//!
//! It is used to attach concolic tracing metadata to the testcase.
//! This feedback should be used in combination with another feedback as this feedback always considers testcases
//! to be not interesting.
Expand All @@ -23,6 +24,7 @@ use crate::{
};

/// The concolic feedback. It is used to attach concolic tracing metadata to the testcase.
///
/// This feedback should be used in combination with another feedback as this feedback always considers testcases
/// to be not interesting.
/// Requires a [`ConcolicObserver`] to observe the concolic trace.
Expand Down
1 change: 1 addition & 0 deletions libafl/src/feedbacks/custom_filename.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ use crate::{
};

/// A [`CustomFilenameToTestcaseFeedback`] takes a closure which returns a filename for the testcase.
///
/// Is never interesting (use with an Eager OR).
/// Note: Use only in conjunction with a `Corpus` type that writes to disk.
/// Note: If used as part of the `Objective` chain, then it will only apply to testcases which are
Expand Down
7 changes: 5 additions & 2 deletions libafl/src/feedbacks/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -720,8 +720,9 @@ pub type FastAndFeedback<A, B, S> = CombinedFeedback<A, B, LogicFastAnd, S>;
/// will call all feedbacks functions even if not necessary to conclude the result
pub type EagerOrFeedback<A, B, S> = CombinedFeedback<A, B, LogicEagerOr, S>;

/// Combine two feedbacks with an fast OR operation,
/// might skip calling feedbacks functions if not necessary to conclude the result.
/// Combine two feedbacks with an fast OR operation - fast.
///
/// This might skip calling feedbacks functions if not necessary to conclude the result.
/// This means any feedback that is not first might be skipped, use caution when using with
/// `TimeFeedback`
pub type FastOrFeedback<A, B, S> = CombinedFeedback<A, B, LogicFastOr, S>;
Expand Down Expand Up @@ -1141,6 +1142,8 @@ impl<T> FeedbackFactory<DiffExitKindFeedback, T> for DiffExitKindFeedback {
}
}

/// A [`Feedback`] to track execution time.
///
/// Nop feedback that annotates execution time in the new testcase, if any
/// for this Feedback, the testcase is never interesting (use with an OR).
/// It decides, if the given [`TimeObserver`] value of a run is interesting.
Expand Down
4 changes: 3 additions & 1 deletion libafl/src/feedbacks/transferred.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ use crate::{
pub const TRANSFERRED_FEEDBACK_NAME: Cow<'static, str> =
Cow::Borrowed("transferred_feedback_internal");

/// Metadata which denotes whether we are currently transferring an input. Implementors of
/// Metadata which denotes whether we are currently transferring an input.
///
/// Implementors of
/// multi-node communication systems (like [`crate::events::LlmpEventManager`]) should wrap any
/// [`crate::EvaluatorObservers::evaluate_input_with_observers`] or
/// [`crate::ExecutionProcessor::process_execution`] calls with setting this metadata to true/false
Expand Down
1 change: 1 addition & 0 deletions libafl/src/inputs/bytessub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use crate::inputs::HasMutatorBytes;

/// The [`BytesSubInput`] makes it possible to use [`crate::mutators::Mutator`]`s` that work on
/// inputs implementing the [`HasMutatorBytes`] for a sub-range of this input.
///
/// For example, we can do the following:
/// ```rust
/// # extern crate alloc;
Expand Down
5 changes: 3 additions & 2 deletions libafl/src/inputs/encoded.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//! The `EncodedInput` is the "normal" input, a map of codes, that can be sent directly to the client
//! (As opposed to other, more abstract, inputs, like an Grammar-Based AST Input)
//! The `EncodedInput` is the "normal" input, a map of codes, that can be sent directly to the client.
//!
//! This is different to other, more abstract inputs, like an Grammar-Based AST Input.
//! See also [the paper on token-level fuzzing](https://www.usenix.org/system/files/sec21-salls.pdf)
#[cfg(feature = "regex")]
Expand Down
3 changes: 2 additions & 1 deletion libafl/src/mutators/gramatron.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//! [`GramatronRandomMutator`] ist a random mutator using grammar automatons to perform grammar-aware fuzzing.
//! [`GramatronRandomMutator`] is a random mutator using grammar automatons to perform grammar-aware fuzzing.
//!
//! See the original gramatron repo [`Gramatron`](https://github.com/HexHive/Gramatron) for more details.
use alloc::{borrow::Cow, vec::Vec};
use core::cmp::max;
Expand Down
4 changes: 3 additions & 1 deletion libafl/src/mutators/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
//! [`Mutator`]`s` mutate input during fuzzing. These can be used standalone or in combination with other mutators to explore the input space more effectively.
//! [`Mutator`]`s` mutate input during fuzzing.
//!
//! These can be used standalone or in combination with other mutators to explore the input space more effectively.
//! You can read more about mutators in the [libAFL book](https://aflplus.plus/libafl-book/core_concepts/mutator.html)
pub mod scheduled;
use core::fmt;
Expand Down
5 changes: 4 additions & 1 deletion libafl/src/mutators/mopt_mutator.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
//! The `MOpt` mutation scheduler used in AFL++. It uses a modified Particle Swarm Optimization algorithm to determine an optimal distribution of mutators.
//! The `MOpt` mutation scheduler used in AFL++.
//!
//! It uses a modified Particle Swarm Optimization algorithm to determine an optimal distribution of mutators.
//! See <https://github.com/puppet-meteor/MOpt-AFL> and <https://www.usenix.org/conference/usenixsecurity19/presentation/lyu>
use alloc::{borrow::Cow, string::ToString, vec::Vec};
use core::{
Expand All @@ -21,6 +23,7 @@ use crate::{
};

/// A Struct for managing MOpt-mutator parameters.
///
/// There are 2 modes for `MOpt` scheduler, the core fuzzing mode and the pilot fuzzing mode.
/// In short, in the pilot fuzzing mode, the fuzzer employs several `swarms` to compute the probability to choose the mutation operator.
/// On the other hand, in the core fuzzing mode, the fuzzer chooses the best `swarms`, which was determined during the pilot fuzzing mode, to compute the probability to choose the mutation operator.
Expand Down
1 change: 1 addition & 0 deletions libafl/src/mutators/tuneable.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//! An extension to the `ScheduledMutator` which schedules multiple mutations internally.
//!
//! Instead of a random mutator for a random amount of iterations, we can run
//! a specific mutator for a specified amount of iterations
Expand Down
8 changes: 6 additions & 2 deletions libafl/src/observers/concolic/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,19 @@ use core::{
#[cfg(feature = "std")]
use serde::{Deserialize, Serialize};

/// A `SymExprRef` identifies a [`SymExpr`] in a trace. Reading a `SymExpr` from a trace will always also yield its
/// A `SymExprRef` identifies a [`SymExpr`] in a trace.
///
/// Reading a `SymExpr` from a trace will always also yield its
/// `SymExprRef`, which can be used later in the trace to identify the `SymExpr`.
/// It is also never zero, which allows for efficient use of `Option<SymExprRef>`.
///
/// In a trace, `SymExprRef`s are monotonically increasing and start at 1.
/// `SymExprRef`s are not valid across traces.
pub type SymExprRef = NonZeroUsize;

/// [`Location`]s are code locations encountered during concolic tracing, that are constructed from pointers, but not always in a meaningful way.
/// [`Location`]s are code locations encountered during concolic tracing
///
/// [`Location`]s are constructed from pointers, but not always in a meaningful way.
/// Therefore, a location is an opaque value that can only be compared against itself.
///
/// It is possible to get at the underlying value using [`Into::into`], should this restriction be too inflexible for your usecase.
Expand Down
4 changes: 3 additions & 1 deletion libafl/src/observers/map/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,15 @@ pub use multi_map::*;
pub mod owned_map;
pub use owned_map::*;

/// A trait indicating tracking of observed map values after testcase execution
///
/// Trait marker which indicates that this [`MapObserver`] is tracked for indices or novelties.
/// Implementors of feedbacks similar to [`crate::feedbacks::MapFeedback`] may wish to use this to
/// ensure that edge metadata is recorded as is appropriate for the provided observer.
///
/// If you get a type constraint failure for your map due to this type being unfulfilled, you must
/// call [`CanTrack::track_indices`] or [`CanTrack::track_novelties`] **at
/// the initialisation site of your map**.
/// the initialization site of your map**.
///
/// This trait allows various components which interact with map metadata to ensure that the
/// information they need is actually recorded by the map feedback.
Expand Down
2 changes: 2 additions & 0 deletions libafl/src/observers/stdio.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! Observers for `stdout` and `stderr`
//!
//! The [`StdOutObserver`] and [`StdErrObserver`] observers look at the stdout of a program
//! The executor must explicitly support these observers.
//! For example, they are supported on the [`crate::executors::CommandExecutor`].
Expand Down
11 changes: 6 additions & 5 deletions libafl/src/schedulers/minimizer.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//! The Minimizer schedulers are a family of corpus schedulers that feed the fuzzer
//! with testcases only from a subset of the total corpus.
//! The [`MinimizerScheduler`]`s` are a family of corpus schedulers that feed the fuzzer
//! with [`Testcase`]`s` only from a subset of the total [`Corpus`].
use alloc::vec::Vec;
use core::{any::type_name, cmp::Ordering, marker::PhantomData};
Expand Down Expand Up @@ -68,8 +68,9 @@ impl Default for TopRatedsMetadata {
}

/// The [`MinimizerScheduler`] employs a genetic algorithm to compute a subset of the
/// corpus that exercise all the requested features (e.g. all the coverage seen so far)
/// prioritizing [`Testcase`]`s` using [`TestcaseScore`]
/// corpus that exercise all the requested features.
///
/// E.g., it can use all the coverage seen so far to prioritize [`Testcase`]`s` using a [`TestcaseScore`].
#[derive(Debug, Clone)]
pub struct MinimizerScheduler<CS, F, M, O> {
base: CS,
Expand All @@ -93,7 +94,7 @@ where
<Self as UsesState>::State: HasCorpus + HasMetadata + HasRand,
O: CanTrack,
{
/// Replaces the testcase at the given id
/// Replaces the [`Testcase`] at the given [`CorpusId`]
fn on_replace(
&mut self,
state: &mut <Self as UsesState>::State,
Expand Down
1 change: 1 addition & 0 deletions libafl/src/schedulers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,5 +270,6 @@ impl<S> Default for RandScheduler<S> {
}

/// A [`StdScheduler`] uses the default scheduler in `LibAFL` to schedule [`Testcase`]s.
///
/// The current `Std` is a [`RandScheduler`], although this may change in the future, if another [`Scheduler`] delivers better results.
pub type StdScheduler<S> = RandScheduler<S>;
2 changes: 2 additions & 0 deletions libafl/src/schedulers/weighted.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! An AFL++-style scheduler with a weighted queue.
//!
//! The queue corpus scheduler with weighted queue item selection [from AFL++](https://github.com/AFLplusplus/AFLplusplus/blob/1d4f1e48797c064ee71441ba555b29fc3f467983/src/afl-fuzz-queue.c#L32).
//! This queue corpus scheduler needs calibration stage.
Expand Down
2 changes: 2 additions & 0 deletions libafl/src/stages/generation.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! The [`GenStage`] generates a single input and evaluates it.
//!
//! A [`Stage`] that generates a single input via a
//! [`crate::generators::Generator`] and evaluates it using the fuzzer, possibly
//! adding it to the corpus.
Expand Down
1 change: 0 additions & 1 deletion libafl/src/stages/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ pub mod concolic;
#[cfg(feature = "std")]
pub mod dump;
pub mod generalization;
/// The [`generation::GenStage`] generates a single input and evaluates it.
pub mod generation;
pub mod logics;
pub mod power;
Expand Down
3 changes: 2 additions & 1 deletion libafl/src/stages/pruning.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ use crate::{
use crate::{events::EventRestarter, state::Stoppable};

#[derive(Debug)]
/// The stage to probablistically disable a corpus entry.
/// The stage to probabilistically disable a corpus entry.
///
/// This stage should be wrapped in a if stage and run only when the fuzzer perform restarting
/// The idea comes from `https://mschloegel.me/paper/schiller2023fuzzerrestarts.pdf`
pub struct CorpusPruning<EM> {
Expand Down
2 changes: 2 additions & 0 deletions libafl/src/stages/push/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! [`PushStage`]`s` return inputs instead of calling an executor
//!
//! While normal stages call the executor over and over again, push stages turn this concept upside down:
//! A push stage instead returns an iterator that generates a new result for each time it gets called.
//! With the new testcase, you will have to take care about testcase execution, manually.
Expand Down
2 changes: 2 additions & 0 deletions libafl/src/stages/push/mutational.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ use crate::{monitors::PerfFeature, state::HasClientPerfMonitor};

/// The default maximum number of mutations to perform per input.
pub static DEFAULT_MUTATIONAL_MAX_ITERATIONS: usize = 128;

/// A Mutational push stage is the stage in a fuzzing run that mutates inputs.
///
/// Mutational push stages will usually have a range of mutations that are
/// being applied to the input one by one, between executions.
/// The push version, in contrast to the normal stage, will return each testcase, instead of executing it.
Expand Down
2 changes: 2 additions & 0 deletions libafl_bolts/src/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ pub fn get_unique_std_input_file() -> String {
format!("{}_{}", INPUTFILE_STD, std::process::id())
}

/// Write a file atomically
///
/// Creates a `.{file_name}.tmp` file, and writes all bytes to it.
/// After all bytes have been written, the tmp-file is moved to it's original `path`.
/// This way, on the majority of operating systems, the final file will never be incomplete or racey.
Expand Down
Loading

0 comments on commit e2cc78f

Please sign in to comment.