From 887e3c6f72dfc6cd0c27a8bfa78873cea19b8e01 Mon Sep 17 00:00:00 2001 From: Dominik Maier Date: Mon, 23 Sep 2024 13:21:45 +0200 Subject: [PATCH 1/2] Fix ForkserverExecutorBuilder::shmem_provider (#2539) --- libafl/src/executors/forkserver.rs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/libafl/src/executors/forkserver.rs b/libafl/src/executors/forkserver.rs index f653f7f5a7..fbf85f3f63 100644 --- a/libafl/src/executors/forkserver.rs +++ b/libafl/src/executors/forkserver.rs @@ -1309,6 +1309,9 @@ impl<'a> ForkserverExecutorBuilder<'a, UnixShMemProvider> { shmem_provider: &'a mut SP, ) -> ForkserverExecutorBuilder<'a, SP> { ForkserverExecutorBuilder { + // Set the new provider + shmem_provider: Some(shmem_provider), + // Copy all other values from the old Builder program: self.program, arguments: self.arguments, envs: self.envs, @@ -1319,14 +1322,13 @@ impl<'a> ForkserverExecutorBuilder<'a, UnixShMemProvider> { is_deferred_frksrv: self.is_deferred_frksrv, autotokens: self.autotokens, input_filename: self.input_filename, - shmem_provider: Some(shmem_provider), map_size: self.map_size, - max_input_size: MAX_INPUT_SIZE_DEFAULT, - min_input_size: MIN_INPUT_SIZE_DEFAULT, - kill_signal: None, - timeout: None, - asan_obs: None, - crash_exitcode: None, + max_input_size: self.max_input_size, + min_input_size: self.min_input_size, + kill_signal: self.kill_signal, + timeout: self.timeout, + asan_obs: self.asan_obs, + crash_exitcode: self.crash_exitcode, } } } From 9b812ccc666c9fad5b2c4bd0fcd2036c3040bd39 Mon Sep 17 00:00:00 2001 From: Dominik Maier Date: Mon, 23 Sep 2024 13:44:27 +0200 Subject: [PATCH 2/2] fmt --- libafl/src/inputs/bytessub.rs | 5 ++++- libafl/src/inputs/mod.rs | 11 ++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/libafl/src/inputs/bytessub.rs b/libafl/src/inputs/bytessub.rs index 53b6dea0e1..5b60b27bf4 100644 --- a/libafl/src/inputs/bytessub.rs +++ b/libafl/src/inputs/bytessub.rs @@ -203,7 +203,10 @@ where } impl<'a, I> MappedInput for BytesSubInput<'a, I> { - type Type<'b> = BytesSubInput<'b, I> where Self: 'b; + type Type<'b> + = BytesSubInput<'b, I> + where + Self: 'b; } #[cfg(test)] diff --git a/libafl/src/inputs/mod.rs b/libafl/src/inputs/mod.rs index 85bc929b69..a82964c1f1 100644 --- a/libafl/src/inputs/mod.rs +++ b/libafl/src/inputs/mod.rs @@ -209,8 +209,10 @@ impl MappedInput for Option where T: MappedInput, { - type Type<'a> = Option> - where T: 'a; + type Type<'a> + = Option> + where + T: 'a; } /// A wrapper type that allows us to use mutators for Mutators for `&mut `[`Vec`]. @@ -263,7 +265,10 @@ impl<'a> HasMutatorBytes for MutVecInput<'a> { } impl<'a> MappedInput for MutVecInput<'a> { - type Type<'b> = MutVecInput<'b> where Self: 'b; + type Type<'b> + = MutVecInput<'b> + where + Self: 'b; } /// Defines the input type shared across traits of the type.