Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fuzzing: Build Fuzz Tests with Rust Extensions and Optional Features #1358

Merged

Conversation

DaveLak
Copy link
Contributor

@DaveLak DaveLak commented Aug 30, 2024

Updates the OSS-Fuzz container environment & build script to build and install Dulwich with all optional features enabled and refines dictionary handling.

Impact:

  • Increases the fuzz-able surface area of the most interesting (from a fuzzing & security testing perspective) Dulwich APIs, enabling future fuzz harnesses improvements to specifically target these features in tests.
  • Enhances flexibility of fuzzer seed data generation steps to improve dictionary quality and simplify seed corpus management for all fuzz targets.

Key Changes in build.sh:

  • Unset problematic OSS-Fuzz provided $RUSTFLAGS to prevent build issues that inhibit PyO3 based Rust extension compilation.
  • Install Python dependencies with specific features (fastimport, gpg, paramiko, etc.).
  • Added "drop-in" support for inclusion of seed corpora zip files & LibFuzzer options files to be introduced later.

Key Changes in container-environment-bootstrap.sh:

  • Installs dependencies required to build Dulwich's optional features and Rust extensions.
  • Updated Python dependencies (setuptools, pyinstaller, etc.) to the latest compatible versions.
  • Improved dictionary handling for fuzz targets by encapsulating dictionary generation logic in shell functions and adding default common dictionary entries to all fuzz target specific .dict files.

Updates the OSS-Fuzz container environment & build script to
build and install Dulwich with all optional features enabled and
refines dictionary handling.

Impact:

- Increases the fuzz-able surface area of the most interesting
  (from a fuzzing & security testing perspective) Dulwich APIs,
  enabling future fuzz harnesses improvements to specifically
  target these features in tests.
- Enhances flexibility of fuzzer seed data generation steps to
  improve dictionary quality and simplify seed corpus management
  for all fuzz targets.

Key Changes in `build.sh`:
- Unset problematic OSS-Fuzz provided `$RUSTFLAGS` to prevent
  build issues that inhibit PyO3 based Rust extension compilation.
- Install Python dependencies with specific features (`fastimport`,
  `gpg`, `paramiko`, etc.).
- Added "drop-in" support for inclusion of seed corpora zip files
  & LibFuzzer options files to be introduced later.

Key Changes in `container-environment-bootstrap.sh`:
- Installs dependencies required to build Dulwich's optional
  features and Rust extensions.
- Updated Python dependencies (`setuptools`, `pyinstaller`, etc.)
  to the latest compatible versions.
- Improved dictionary handling for fuzz targets by encapsulating
  dictionary generation logic in shell functions and adding
  default common dictionary entries to all fuzz target specific
  `.dict` files.
@DaveLak DaveLak requested a review from jelmer as a code owner August 30, 2024 00:27
@jelmer jelmer merged commit 06b8bcc into jelmer:master Aug 30, 2024
27 of 28 checks passed
@DaveLak DaveLak deleted the fuzzing/build-with-optional-deps-and-extensions branch August 30, 2024 01:19
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