Skip to content

Use fuzz_targets from clusterfuzz_manifest.json if available - #5387

Open
notvictorl wants to merge 2 commits into
google:masterfrom
notvictorl:liuvic/run
Open

Use fuzz_targets from clusterfuzz_manifest.json if available#5387
notvictorl wants to merge 2 commits into
google:masterfrom
notvictorl:liuvic/run

Conversation

@notvictorl

@notvictorl notvictorl commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

Chrome archives initially pick fuzz targets from a fuzz_target property from clusterfuzz_manifest.json, but it doesn't use it on future runs when picking fuzz targets. This leads to wasting time doing a directory scan for _fuzzer binaries to choose a fuzz target and can pick a binary that is not intended to be run (run_*_fuzzer).

Modifying fuzzer utils to re-access clusterfuzz_manifest.json for fuzz_targets if available otherwise fall back to existing behavior. Adding unit tests for fuzzer utils.

Drive-by: Improve Chrome manifest path search by joining to root_dir for wrapped directories where ClusterFuzz's build directory is not the Chrome archives root directory with respective unit tests.

Bug: https://crbug.com/507833074

@notvictorl
notvictorl requested a review from a team as a code owner July 23, 2026 20:56
@notvictorl
notvictorl marked this pull request as draft July 23, 2026 21:58
@notvictorl
notvictorl marked this pull request as ready for review July 24, 2026 20:59

@dylanjew dylanjew left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

is this going to fix all of the run_*_fuzzer targets?

return False


def _get_manifest_fuzz_targets(path):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

should this be a shared util?

manifest_path = CHROME_MANIFEST_FILENAME

return fuzz_target_paths


def get_fuzz_targets_local(path):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

what is the behavior for the non local version of get_fuzz_targets?



def get_fuzz_targets_local(path):
"""Get list of fuzz targets paths (local)."""

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nit: update the docstring to explain the manifest and fallback behavior

def test_manifest_targets_used(self):
"""Test that clusterfuzz_manifest.json is used to find targets."""
target_a = self._create_file('target_a', contents=b'LLVMFuzzerTestOneInput')
self._create_file('run_target_a_fuzzer', contents=b'LLVMFuzzerTestOneInput')

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nit: instead of target_a and run_target_a_fuzzer you could name these something like manifest_target and file_target or dir_target and the assertions would be clearer

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.

2 participants