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

Implement AflMap #416

Merged
merged 15 commits into from
Dec 16, 2021
Merged

Implement AflMap #416

merged 15 commits into from
Dec 16, 2021

Conversation

vanhauser-thc
Copy link
Member

@domenukk @andreafioraldi
it compiles so far, not sure it works :)

@vanhauser-thc
Copy link
Member Author

vanhauser-thc commented Dec 10, 2021

Somewhere the (virgin) map also has to be updated correctly. not sure where this is done.

@vanhauser-thc vanhauser-thc marked this pull request as draft December 10, 2021 00:34
Copy link
Member

@domenukk domenukk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lookin' good!

libafl/src/feedbacks/map.rs Outdated Show resolved Hide resolved
libafl/src/feedbacks/map.rs Outdated Show resolved Hide resolved
libafl/src/feedbacks/map.rs Outdated Show resolved Hide resolved
@vanhauser-thc
Copy link
Member Author

I thought about this, and came to the conclusion that it is very easy to implement.

We need a reducer that combines the history map + (already reduced hitcountobserver) current map.
In is_interesting we then just check if history map != current map and if true it is interesting.
FeedbackMap then sets map = reduced - and that is why our reducer has to combine the bits from the history and current map entry.

@andreafioraldi

@vanhauser-thc vanhauser-thc marked this pull request as ready for review December 13, 2021 12:29
@vanhauser-thc
Copy link
Member Author

IMHO it is done :)

fn is_interesting(old: T, new: T) -> bool {
(new == T::one() || new == T::one() || new == T::max_value()) && new > old
fn is_novel(old: T, new: T) -> bool {
(new == T::one() || new == T::max_value()) && new > old
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically this also makes sure the new value is larger, so it only makes sense of the values grow

@andreafioraldi andreafioraldi merged commit 1f24ad0 into main Dec 16, 2021
@domenukk domenukk deleted the aflmap branch December 29, 2021 17:47
khang06 pushed a commit to khang06/LibAFL that referenced this pull request Oct 11, 2022
* aflmap

* nits

* nits

* switch implementation

* clippy

* set fuzzbench fuzzer to afl map

* fix monitor display

* Remove MapFindFilter and fix names

* AndReducer

* fixed testcase

* always inline

* remove inline(always)

Co-authored-by: Andrea Fioraldi <andreafioraldi@gmail.com>
Co-authored-by: Dominik Maier <domenukk@gmail.com>
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.

None yet

3 participants