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

Improve the libafl_libfuzzer corpus #1539

Merged
merged 6 commits into from
Nov 3, 2023
Merged

Improve the libafl_libfuzzer corpus #1539

merged 6 commits into from
Nov 3, 2023

Conversation

addisoncrump
Copy link
Collaborator

This libafl_libfuzzer corpus had several annoying issues previously, esp. with duplication of existing inputs. This should fix it :)

libafl/src/corpus/mod.rs Outdated Show resolved Hide resolved
@addisoncrump
Copy link
Collaborator Author

@domenukk fairly certain the CI failure here is not my fault lol

res => res?,
}

// we DO NOT save metadata!
Copy link
Member

@tokatoka tokatoka Sep 25, 2023

Choose a reason for hiding this comment

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

why we don't save metadata?
(maybe because it's never evicted so no need to save it on the disk?)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

There's no point for libafl_libfuzzer -- all of the metadata will be recovered at runtime for effectively no cost.

@domenukk
Copy link
Member

Let's make this a general corpus then?

@tokatoka
Copy link
Member

but addison said it doesn't work with remove/replace

@domenukk
Copy link
Member

It should work if we just always create new (and remove keeps the guy around on disk, who cares)

@addisoncrump
Copy link
Collaborator Author

and remove keeps the guy around on disk, who cares

This might be a problem because the entry will be reloaded on corpus load next time the fuzzer is started.

_idx: CorpusId,
_testcase: Testcase<Self::Input>,
) -> Result<Testcase<Self::Input>, Error> {
unimplemented!("It is unsafe to use this corpus variant with replace!");
Copy link
Member

Choose a reason for hiding this comment

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

Why not? Just create a new file and link to the new file, keep the old one around?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This would mean that the old corpus entry would be loaded at start time. Better in this case (since this will only ever be used by libafl_libfuzzer_runtime) to keep it tight to requirements and fail fast if we do anything new 🙂

Copy link
Member

Choose a reason for hiding this comment

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

not sure about this one

@domenukk domenukk merged commit 56b37bb into main Nov 3, 2023
17 checks passed
@domenukk domenukk deleted the libfuzzer-corpus branch November 3, 2023 16:33
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