From 173a9ad8eab4e9ea6e39a3b2cf40f18ad90943e3 Mon Sep 17 00:00:00 2001 From: Dominik Maier Date: Mon, 23 Sep 2024 14:15:11 +0200 Subject: [PATCH] Fix ForkserverExecutorBuilder::shmem_provider (#2539) (#2540) * Fix ForkserverExecutorBuilder::shmem_provider (#2539) * fmt --- libafl/src/executors/forkserver.rs | 16 +++++++++------- libafl/src/inputs/bytessub.rs | 5 ++++- libafl/src/inputs/mod.rs | 11 ++++++++--- 3 files changed, 21 insertions(+), 11 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, } } } 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.