Skip to content

Fix #1: avoid mutating all code inside INSTRUMENTATION_SET functions#6

Open
carlosluengos2004 wants to merge 1 commit into
agroce:masterfrom
carlosluengos2004:fix/issue-1-instrumentation-avoidance
Open

Fix #1: avoid mutating all code inside INSTRUMENTATION_SET functions#6
carlosluengos2004 wants to merge 1 commit into
agroce:masterfrom
carlosluengos2004:fix/issue-1-instrumentation-avoidance

Conversation

@carlosluengos2004
Copy link
Copy Markdown

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.

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.
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.

Avoid mutating all code inside INST_SET related blocks

1 participant