-
-
Notifications
You must be signed in to change notification settings - Fork 330
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 an observer for COUNTERS_MAPS
for 8-bit SanCov
#1283
Merged
domenukk
merged 11 commits into
AFLplusplus:main
from
novafacing:novafacing/sancov-observer
May 23, 2023
Merged
Changes from 6 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
d35e4c7
Add sancov multimap observer to sancov_8bit target
novafacing 4cf5928
Merge branch 'main' into HEAD
novafacing b7a3751
Undo autofmt of Cargo.toml
novafacing dc30b46
Fix formatting
novafacing dc4d861
Fix import errors under no-default-features, add Safety to counters_m…
novafacing 33f9e68
Merge branch 'main' of https://github.com/AFLplusplus/libafl into nov…
novafacing 0c3f8ef
Make observer function no_mangle to allow it to easily be used in a s…
novafacing fd98b2c
Make clippy happy by using export_name instead of no_mangle
novafacing a12ed63
Add observers feature flag and hide counters maps observer behind it
novafacing 91c6726
Merge branch 'main' of https://github.com/AFLplusplus/libafl into nov…
novafacing 1231466
Fix formatting
novafacing File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 observers should live in the main lib, not in libafl_targets (I think)
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.
Having libafl depend on libafl_targets to make the static visible would introduce a circular dependency, so I think it does have to go in here. I could be missing another option though.
(it can also go in your binary of course, but then I can't reuse this observer 😋)
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.
Ah I see, I thought the dependency went the other way.
But in this case, maybe we should hide additional observers behind a
observers
flag? Dragging inintervaltree
andahash
for this seems excessive for most usecases, what do you think?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.
Yeah
libafl_targets
is already full of feature flags, no biggie to add another :)I pushed that change up adding an
observers
flag and moved the observer into there.Checking over the source, I notice that
cmplog.rs
hasCmpLogObserver
andcoverage.rs
hasDifferentialAFLMapSwapObserver
(although it is already behind the"pointer_maps"
flag). Probably not be worth gating theCmpLogObserver
since it doesn't add any dependencies, but it might be worth gating all three the same way to trim down static library size and make things consistent.One more note is that
DifferentialAFLMapSwapObserver
usesserde
, but it's the only thing other thanCountersMapsObserver
that does. We should probably make serde an optional dependency as well (we could gate it behind"observers"
if we add it as a feature gate for all the observers in the crate), because it has the"alloc"
feature enabled which makes it not possible to uselibafl_targets
inno_std
currently.(This is probably another PR, happy to open it if these suggestions sound good)
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.
Sounds good. FWIW using alloc in no_std is totally possible. You just need to define an allocator.
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.
Cool, today I learned!