Discard no tc mm (follow-up) (#2584)

* forgot to set the flags
This commit is contained in:
Romain Malmain 2024-10-03 20:26:28 +02:00 committed by GitHub
parent 9a50868058
commit 15157e0b72
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -9,7 +9,7 @@ use std::{
#[cfg(feature = "llmp_compression")] #[cfg(feature = "llmp_compression")]
use libafl_bolts::llmp::LLMP_FLAG_COMPRESSED; use libafl_bolts::llmp::LLMP_FLAG_COMPRESSED;
use libafl_bolts::{ use libafl_bolts::{
llmp::{Flags, LlmpBrokerInner, LlmpHook, LlmpMsgHookResult, Tag}, llmp::{Flags, LlmpBrokerInner, LlmpHook, LlmpMsgHookResult, Tag, LLMP_FLAG_FROM_MM},
ownedref::OwnedRef, ownedref::OwnedRef,
shmem::ShMemProvider, shmem::ShMemProvider,
ClientId, Error, ClientId, Error,
@ -255,20 +255,22 @@ where
let msg = msg.into_owned().unwrap().into_vec(); let msg = msg.into_owned().unwrap().into_vec();
#[cfg(feature = "llmp_compression")] #[cfg(feature = "llmp_compression")]
match state_wr_lock.compressor().maybe_compress(msg.as_ref()) { match state_wr_lock.compressor().maybe_compress(msg.as_ref()) {
Some(comp_buf) => { Some(comp_buf) => Ok((
Ok((_LLMP_TAG_TO_MAIN, LLMP_FLAG_COMPRESSED, comp_buf)) _LLMP_TAG_TO_MAIN,
} LLMP_FLAG_COMPRESSED | LLMP_FLAG_FROM_MM,
None => Ok((_LLMP_TAG_TO_MAIN, Flags(0), msg)), comp_buf,
)),
None => Ok((_LLMP_TAG_TO_MAIN, LLMP_FLAG_FROM_MM, msg)),
} }
#[cfg(not(feature = "llmp_compression"))] #[cfg(not(feature = "llmp_compression"))]
Ok((_LLMP_TAG_TO_MAIN, Flags(0), msg)) Ok((_LLMP_TAG_TO_MAIN, LLMP_FLAG_FROM_MM, msg))
} }
MultiMachineMsg::Event(evt) => { MultiMachineMsg::Event(evt) => {
let evt = evt.into_owned().unwrap(); let evt = evt.into_owned().unwrap();
let (inner_flags, buf) = let (inner_flags, buf) =
Self::try_compress(&mut state_wr_lock, evt.as_ref())?; Self::try_compress(&mut state_wr_lock, evt.as_ref())?;
Ok((_LLMP_TAG_TO_MAIN, inner_flags, buf)) Ok((_LLMP_TAG_TO_MAIN, inner_flags | LLMP_FLAG_FROM_MM, buf))
} }
}) })
.collect(); .collect();