-
-
Notifications
You must be signed in to change notification settings - Fork 324
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
Add generic cmp observer metadata, rename cmp observers, fix cmplogmap reset #1461
Conversation
Awesome! error[E0432]: unresolved import `libafl::prelude`
--> libafl_targets/src/cmplog.rs:12:5
|
[12](https://github.com/AFLplusplus/LibAFL/actions/runs/5968828500/job/16193481867?pr=1461#step:15:13) | prelude::CmpValuesMetadata,
| ^^^^^^^ could not find `prelude` in `libafl` Can't haz prelude in the lib |
Now I'm confused why this builds for me locally, RIP. Will fix :) |
This will generally build (the prelude feature is set by default), just not if you build with |
Darn, I was hoping everything would work with no modifications. I'll fix the fuzzers :) |
@@ -346,7 +349,8 @@ fn fuzz( | |||
cmplog_shmem.write_to_env("__AFL_CMPLOG_SHM_ID").unwrap(); | |||
let cmpmap = unsafe { cmplog_shmem.as_object_mut::<AFLppCmpMap>() }; | |||
|
|||
let cmplog_observer = StdCmpObserver::new("cmplog", cmpmap, true); | |||
let cmplog_observer: StdCmpObserver<'_, _, _, CmpValuesMetadata> = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The generics look a bit unfortunate, any way to get around them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about having a type StdCmpValuesObserver<'a, B, C> = StdCmpObserver<'a, B, C, CmValuesMetadata>
or something like that? Just an idea
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure that sounds good 🙂
LGTM, but StdCmpObserver was the original name, then #1291 changed it I see, we know why? |
I think simply because we introduced another cmplog map format for AFLpp... cc @tokatoka |
because it's not really StdCmplogObserver.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
…nd add aux data accessors
Ok, added that type alias (thanks for the suggestion) and also added accessors for the stored aux data. No need to update it imo but in this case if you wanted to do something like what AFLppCmpObserver does, you could just use the @tokatoka I think calling them forkserver in your merge made sense, I just changed it back because with the changes I'm now using these in a context where they aren't used with a forkserver but inprocess, so figured maybe the more generic name makes sense now so people don't think they can't use 'em in other ways :) |
Renames:
ForkserverCmpObserver
toStdCmpObserver
AFLppForkserverCmpObserver
toAFLppCmpObserver
Adds:
CmpObserverMetadata
trait, which defines a metadata that can have cmp information added to it from aCmpObserver
, along with some auxiliary data type which right now is only used forAFLppCmpObserver
'soriginal
field, but can be used for whatever custom thing users wantpub
fields. This solves that and reduces my hackiness)Fixes: