Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decouple fuzzer functions from event manager #2915

Merged
merged 24 commits into from
Feb 1, 2025
6 changes: 6 additions & 0 deletions MIGRATION.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 0.15.0 -> 0.16.0
- `EventManager` is refactored to avoid calling function from `Fuzzer`, thus we do not evaluate testcases in `EventManager` anymore.
- Now we have `EventReceiver` in `events` module, and `EventProessor` in `fuzzer` module.
- `EventReceiver` is responsible for receiving testcases and delegates its evaluation to `EventProcessor`.
- `EventProcessor` is responsible for evaluating the testcases passed by the `EventReceiver`.
- Since we don't evaluate the `EventManager` anymore. `on_fire` and `post_exec` have been deleted from `EventManagerHook`.

# 0.14.1 -> 0.15.0
- `MmapShMem::new` and `MmapShMemProvider::new_shmem_with_id` now take `AsRef<Path>` instead of a byte array for the filename/id.
Expand Down
2 changes: 1 addition & 1 deletion fuzzers/baby/baby_fuzzer_unicode/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ pub fn main() {
&mut state,
&mut executor,
&mut mgr,
BytesInput::new(vec![b'a']),
&BytesInput::new(vec![b'a']),
)
.unwrap();

Expand Down
1 change: 0 additions & 1 deletion fuzzers/forkserver/libafl-fuzz/src/fuzzer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ pub type LibaflFuzzState =
#[cfg(not(feature = "fuzzbench"))]
type LibaflFuzzManager = CentralizedEventManager<
LlmpRestartingEventManager<(), BytesInput, LibaflFuzzState, StdShMem, StdShMemProvider>,
(),
BytesInput,
LibaflFuzzState,
StdShMem,
Expand Down
3 changes: 0 additions & 3 deletions fuzzers/forkserver/libafl-fuzz/src/hooks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,4 @@ where
}
Ok(true)
}
fn post_exec(&mut self, _state: &mut S, _client_id: ClientId) -> Result<bool, Error> {
Ok(true)
}
}
2 changes: 1 addition & 1 deletion fuzzers/inprocess/libfuzzer_libpng_centralized/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ pub extern "C" fn libafl_main() {

let mut secondary_run_client =
|state: Option<_>,
mut mgr: CentralizedEventManager<_, _, _, _, _, _>,
mut mgr: CentralizedEventManager<_, _, _, _, _>,
_client_description: ClientDescription| {
// Create an observation channel using the coverage map
let edges_observer =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ pub extern "C" fn libafl_main() {

let mut secondary_run_client =
|state: Option<_>,
mut mgr: CentralizedEventManager<_, _, _, _, _, _>,
mut mgr: CentralizedEventManager<_, _, _, _, _>,
_client_description: ClientDescription| {
// Create an observation channel using the coverage map
let edges_observer =
Expand Down
2 changes: 1 addition & 1 deletion fuzzers/structure_aware/baby_fuzzer_grimoire/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ pub fn main() {

for input in initial_inputs {
fuzzer
.evaluate_input(&mut state, &mut executor, &mut mgr, input)
.evaluate_input(&mut state, &mut executor, &mut mgr, &input)
.unwrap();
}

Expand Down
2 changes: 1 addition & 1 deletion fuzzers/structure_aware/baby_fuzzer_multi/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ pub fn main() {
]);

fuzzer
.evaluate_input(&mut state, &mut executor, &mut mgr, initial)
.evaluate_input(&mut state, &mut executor, &mut mgr, &initial)
.unwrap();

// Setup a mutational stage with a basic bytes mutator
Expand Down
Loading
Loading