Skip to content

Commit

Permalink
Instrument test utility functions to increase fuzzer efficiency
Browse files Browse the repository at this point in the history
Fuzz Introspector was reporting a high percentage of fuzz blockers
in the `fuzz_diff` test. This means the fuzzing engine was unable
to gain visibility into functions lower in the call stack than the
blocking functions, making it less effective at producing interesting
input data.

This clears a large percentage of the fuzz blockers by adding fuzzer
instrumentation to them via the `@atheris.instrument_func` decorator.
  • Loading branch information
DaveLak committed May 15, 2024
1 parent 4e212c6 commit 315a2fd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fuzzing/fuzz-targets/fuzz_diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,19 @@
class BytesProcessAdapter:
"""Allows bytes to be used as process objects returned by subprocess.Popen."""

@atheris.instrument_func
def __init__(self, input_string):
self.stdout = io.BytesIO(input_string)
self.stderr = io.BytesIO()

@atheris.instrument_func
def wait(self):
return 0

poll = wait


@atheris.instrument_func
def TestOneInput(data):
fdp = atheris.FuzzedDataProvider(data)

Expand Down

0 comments on commit 315a2fd

Please sign in to comment.