Commit Graph

1 Commits

Author SHA1 Message Date
Tacet fa8444016c
Adding Ruby Support into OSS-Fuzz via Ruzzy (#12034)
This is a follow-up to the discussions held during our Monthly Fuzzing
Collaboration meetings and directly relates to issue #11967.

This Pull Request integrates Ruzzy support for Ruby fuzzing into
OSS-Fuzz. Ruzzy is a coverage-guided fuzzer for pure Ruby code and Ruby
C extensions, developed by Matt (@mschwager) at Trail of Bits. More
information on Ruzzy can be found in the blog post titled "[Introducing
Ruzzy, a coverage-guided Ruby
fuzzer](https://blog.trailofbits.com/2024/03/29/introducing-ruzzy-a-coverage-guided-ruby-fuzzer/)".

The first commit of this PR integrates Ruby support into the OSS-Fuzz
project via Ruzzy, while the second one includes the Ox project as an
example of its usage.

The first commit introduces changes in the infra directory, most notably
by adding the base-builder-ruby docker and the ruby install script.

Two scripts, ruzzy-build and ruzzy, have been added to base-builder-ruby
and base-runner respectively. The former creates scripts that start
harnesses with the latter one, and the latter is simply a wrapper for
ruby with LD_PRELOAD.
In order to prevent the duplication of many gigabytes of data, we use
separate installation directories for RubyGem. Technically, Ruzzy can be
installed in the default directory without any performance disadvantage,
but having a separate directory may facilitate troubleshooting.

This implementation was arrived at through testing a few ideas. If you
have suggestions for further improvements, please let me know. I am
currently addressing my concerns in the related issue.

Using the provided scripts isn't necessary but it does simplify the
process. Installation directories are set using environment variables in
the Dockerfiles, making it transparent for users.

The second commit simply adds a project to illustrate how
straightforward the integration process is. You can test it using the
standard helper commands.

Fixes: #11967

Co-authored-by: mschwager <matt.schwager@trailofbits.com>

---------

Co-authored-by: mschwager <matt.schwager@trailofbits.com>
2024-07-02 08:33:01 -04:00