Skip to content

Build a self-contained Docker image for fuzzing OSS-Fuzz projects with FuzzBench fuzzing engines. #13185

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

Open
wants to merge 79 commits into
base: master
Choose a base branch
from

Conversation

decoNR
Copy link
Collaborator

@decoNR decoNR commented Mar 28, 2025

Add build steps to create and upload a self-contained Docker image that enables fuzzing OSS-Fuzz projects using FuzzBench fuzzers. This image encapsulates all necessary runtime dependencies.

  • Added a build step to copy essential runtime files to the /workspace directory, ensuring they are accessible across build steps.
  • Added a build step to build runner.Dockerfile from FuzzBench, incorporating required fuzzer runtime dependencies into the image.
  • Added a build step to create and push a self-contained OSS-Fuzz on Demand Docker image. Executing docker run on this image will initiate fuzzing. Created ood.Dockerfile for building this image.

Note that the high quantity of commits is due to the fact that, during the GCB build, ood.Dockerfile is obtained by cloning the repository. Therefore, commits are necessary to apply code changes that affect the build process.

Related to b/401215144 .

decoNR added 30 commits March 7, 2025 18:19
@decoNR
Copy link
Collaborator Author

decoNR commented Mar 28, 2025

/gcbrun oss_fuzz_on_demand.py skcms --fuzzing-engine libafl

@decoNR
Copy link
Collaborator Author

decoNR commented Mar 28, 2025

/gcbrun oss_fuzz_on_demand.py skcms --fuzzing-engine eclipser

@decoNR
Copy link
Collaborator Author

decoNR commented Mar 28, 2025

/gcbrun oss_fuzz_on_demand.py skcms --fuzzing-engine libafl

@decoNR decoNR marked this pull request as ready for review March 28, 2025 21:06
@decoNR decoNR requested a review from jonathanmetzman March 28, 2025 21:07
Base automatically changed from oss_fuzz_on_demand_builds to master April 8, 2025 14:23
def get_env_dict(env):
"""Converts a list of environment strings to a dictionary."""
env_dict = {}
for item in env:
Copy link
Contributor

Choose a reason for hiding this comment

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

env_dict = {k: v for k,v in item.split('=')}

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we avoid doing this? This isn't great, is it possible to get this while it is still in dict format before it is converted to a string with '='

Copy link
Collaborator Author

@decoNR decoNR Apr 11, 2025

Choose a reason for hiding this comment

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

The issue is that the build_project.get_env() function, which is used in multiple files, returns a list of strings (likely because GCB requires env be a list of strings). Given that, I can either retrieve the needed env variables from the list of strings or transform the list to a dictionary to make it easier. Added a commit with the second option.

Copy link
Contributor

Choose a reason for hiding this comment

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

It's a list of lists right? I think dict(l) should work.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's a list of strings in the format: ['key0=value0', 'key1=value1', ...]. Therefore, I couldn't directly use dict(l).

Copy link
Contributor

@jonathanmetzman jonathanmetzman left a comment

Choose a reason for hiding this comment

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

LGTM with minor nits.

@decoNR
Copy link
Collaborator Author

decoNR commented Apr 11, 2025

/gcbrun oss_fuzz_on_demand.py skcms --fuzzing-engine libafl

@decoNR
Copy link
Collaborator Author

decoNR commented Apr 17, 2025

/gcbrun oss_fuzz_on_demand.py skcms --fuzzing-engine libafl

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