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

Trigger feedback side effects during force-loading #1317

Merged

Conversation

Andrew-Fryer
Copy link
Contributor

During some experimentation, I noticed that calling load_initial_inputs_forced rather than load_initial_inputs made a significant impact on the code coverage of my fuzzer.
This was because load_initial_inputs_forced does not evaluate feedbacks (or objectives), so the code coverage of the initial corpus elements wasn't recorded.
While this might be seem significant for very long running fuzzing sessions, it means that other inputs will be added to the corpus that wouldn't otherwise be interesting (because their code coverage is included in the initial corpus elements).

Therefore, I believe that the correct behaviour of load_initial_inputs_forced is to trigger the side-effects of feedbacks and objectives, but then consider the inputs interesting (and not solutions). Alternatively, we could change how feedbacks are implemented not to use side-effects this way.

Please let me know if I'm missing something here!

@tokatoka
Copy link
Member

for me, looks good

@domenukk
Copy link
Member

+1, thanks.

The Introspection branch needs a fix:

error[E0308]: mismatched types
   --> libafl/src/fuzzer/mod.rs:529:78
    |
529 |             .is_interesting_introspection(state, manager, &input, observers, exit_kind)?;
    |              ----------------------------                                    ^^^^^^^^^ expected `&ExitKind`, found `ExitKind`
    |              |
    |              arguments to this method are incorrect
    |
note: method defined here
   --> libafl/src/feedbacks/mod.rs:79:8
    |
79  |     fn is_interesting_introspection<EM, OT>(
    |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
85  |         exit_kind: &ExitKind,
    |         --------------------
help: consider borrowing here
    |
529 |             .is_interesting_introspection(state, manager, &input, observers, &exit_kind)?;
    |                                                                              +

@Andrew-Fryer
Copy link
Contributor Author

Sorry, (I should have noticed that.)

I just built an example fuzzer (forkserver_simple) with introspection on (libafl = { path = "../../libafl/", features = ["std", "derive", "introspection"] }) and it builds now.

@domenukk
Copy link
Member

Great, thanks! :)

@domenukk domenukk merged commit 07530fe into AFLplusplus:main Jun 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants