google / google/oss-fuzz

Parameterized fuzz targets?

Open
#14,437 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Shell
Stars
12.7k
Forks
2.9k
Avg merge
2d 2h
Merged PRs (30d)
62

Description

If you want to fuzz different functions in your codebase that accept different kinds of inputs, you need to create a fuzz target for each function.

The way to do this currently is to compile a separate fuzz target for each function. This works fine when there are only a couple of them.

However, there can be a need to fuzz a non-trivial number of functions. Compiling a dedicated fuzz target for each will balloon build times and disk footprint, especially due to static linking. For example, in Arrow each of our fuzz targets is around 120 MB on disk.

It would be nice to define fuzz targets that point to the same executable, but with different parameters. A simple way of passing parameters would be via dedicated environment variables.

A potential application would be the various Parquet encodings out there.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review OSS-Fuzz's existing fuzz-target compilation and execution flow, then compare it with the separate-target approach described here. Determine how one executable could receive different target parameters, such as environment variables, and define completion as supporting multiple functions without requiring a dedicated executable for each.

Written by the indexing model from the issue text.

Assessment

Domain
security, testing-qa
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.