Fix #1: avoid mutating all code inside INSTRUMENTATION_SET functions#6
Open
carlosluengos2004 wants to merge 1 commit into
Open
Conversation
The previous behavior only skipped individual disassembly lines that mentioned an instrumentation marker, which still allowed mutations inside e.g. __afl_maybe_log or a DeepState harness when a given line did not itself reference the marker. This adds a function-header guard mirroring the existing std::/boost:: check, so the whole function is excluded. Adds four regression tests that mock objdump.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #1.
INSTRUMENTATION_SET was only consulted line-by-line inside get_jumps(),
so a function whose name matched a marker (e.g. __afl_maybe_log,
DeepState_Run) could still have its internal jumps mutated whenever the
individual disassembly line did not itself repeat the marker.
This adds a function-header guard right after the existing std::/boost::
checks, mirroring their style. The old line-level filter is kept for
cross-function jumps that target an instrumentation label.
Also adds test/test_instrumentation_avoidance.py with four regression
tests that mock subprocess.Popen so they run without a real binary.
Test (1) fails against master and passes after the patch.