Commit Graph

61 Commits

Author SHA1 Message Date
Catena cyber 7bda69cbeb
profraw: move from golang to python (#6565) 2021-10-11 12:52:33 -04:00
jonathanmetzman d01808333d
[cifuzz] Fuzz in cifuzz-base (#6142)
Fixes: #5926
2021-08-05 13:27:24 -07:00
Fabian Meumertzheim 84578fe2a3
Remove JDK dependency not available on ClusterFuzz (#6105)
While installing `libxext-dev` in `base-runner` makes it available for local fuzzing via `infra/helper.py run_fuzzer`, it is not installed in the image used by ClusterFuzz to run fuzz targets. ​Fuzz targets that rely on any JDK system dependency rather have to install it manually using the method described in https://google.github.io/oss-fuzz/further-reading/fuzzer-environment/#runtime-dependencies. 

By removing this package from `base-runner`, a failure to do so will already be detected via a local `check_build` rather than only during fuzzer execution on ClusterFuzz.
2021-07-27 11:57:33 -07:00
Abhishek Arya 1bf9031854
Fix code coverage regression. (#5949)
Hardcode commit hash for chromium code coverage script, till
revert happens.
Fixes #5934
2021-06-19 16:48:24 -07:00
jonathanmetzman 8221561c34
Fix coverage script issues (#5764)
Make sure to install MarkupSafe==0.23 instead of >=0.23 which breaks.
Probably the solution is to upgrade Jinja upstream.
Fixes #5763
2021-05-13 15:32:42 +00:00
Fabian Meumertzheim 466787d4f5
[infra] Fix base-runner build (#5756)
Builds of base-runner fail as the Chromium coverage helper script has a
transitive dependency on MarkupSafe, which as of version 2.0 requires
additional python packaging tools to be installed.

This commit installs python3-setuptools and wheels, which fixes the
build.
2021-05-12 07:13:22 -07:00
Fabian Meumertzheim 5cfb074ae5
Add Java coverage support (#5733)
Coverage is collected by running the fuzz targets with the JaCoCo agent
in Jazzer's no instrumentation mode.

Since JaCoCo does not support llvm-cov style coverage reports, a simple
Python helper creates it using the information contained in the JaCoCo
XML report.

As the Java build process does not maintain a mapping between source
files and build artifacts and JaCoCo needs to be passed the root folder
of the package tree, we use the Maven directory layout convention to
heuristically detect these roots.
2021-05-10 20:33:07 -07:00
Fabian Meumertzheim f393c97b11
Add missing Java AWT dependency (#5644)
The library libXext.so.6 is required by some Java AWT classes even in
headless environments.

This fixes a crash in apache-commons:
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=33489
2021-04-20 21:10:13 +01:00
Abhishek Arya 90b3d55f36
Fix unzip regression on base-runner. (#5356)
* Fix unzip regression on base-runner.

* Dont rpath patch llvm-symbolizer.

Should fix https://github.com/google/oss-fuzz/issues/5349

* Revert "Dont rpath patch llvm-symbolizer."

This reverts commit fdd881dea2.
2021-03-10 10:46:58 -08:00
jonathanmetzman 92bb205b50
[infra] Remove minijail. (#5343)
We don't need minijail tooling anymore since we aren't using it
on OSS-Fuzz.
2021-03-09 19:57:33 +00:00
jonathanmetzman c3124a0843
[base-runner] Reduce size by ~200 MB by using apt better (#5339)
Don't install recommended packages if it means installing an
entire gcc toolchain. We don't need it in the runner.
2021-03-09 18:06:44 +00:00
Catena cyber be915129e1
Golang coverage with go 1.16 and modules (#5321)
* Fixes go coverage with modules

* Golang coverage html report turning off modules

Otherwise, we get the error
working directory is not part of a module
2021-03-08 21:26:19 +00:00
jonathanmetzman 8fe74c1f72
[base-runner] Fix go issue and remove uneeded rust stuff. (#5319)
Go needs the toolchain for now, so add it back to base-runner.
We don't actually need the rust toolchain so get rid of it
(saving about 1GB).
2021-03-08 09:43:44 -08:00
Catena cyber c41e46ffc8
Rust coverage report (for Suricata) (#4697)
* Rust coverage test

* Workaround to get rust coverage for Suricata
2021-03-08 07:05:35 -08:00
jonathanmetzman 5e207cb607
[base-runner] Reduce image size by 45% (645 MB). (#5283)
Reduce image size by:
1. Not installing go toolchain in final image. Build go tools in
seperate image that doesn't become base-runner.
2. Download the JVM zip in the same step we remove it.
2021-03-04 06:33:27 -08:00
Fabian Meumertzheim 427f63c93c
Add Jazzer to base-builder and base-runner (#5166)
Jazzer is built from HEAD using Bazel and the clang toolchain provided
by base-clang. While it could be built with OpenJDK 8, which is
available as a package, JVM fuzz targets should not be forced to be
compatible with Java 8. For this reason, the official binary release of
OpenJDK 15 is pulled into both base-builder and base-runner and set as
JAVA_HOME. It is trimmed down in size by removing src.zip and the jmods
directory.

Jazzer consists of the following four components:

* The API (`jazzer_api_deploy.jar`), which is required for fuzz targets
  that use FuzzedDataProvider or custom method hooks, is made available
  in /usr/local/lib in base-builder.
* The driver (`jazzer_driver`), which links in libFuzzer and is reused
  across fuzz targets. Since it is used to run fuzz targets, it is
  included into base-runner.
* The ASanified driver (`jazzer_driver_asan`), which is obtained from
  `jazzer_driver` by linking in ASan.
* The agent (`jazzer_agent_deploy.jar`), which bundles the runtime
  instrumentation agent with the Jazzer API. It is loaded by the driver
  and thus also included into base-runner.

The changes to the infra scripts required by JVM fuzz targets will be
submitted as a separate PR.
2021-02-16 06:56:36 -08:00
jonathanmetzman a98d7f1ca4
[base-runner][NFC] Replace test_one with test_one.py (#5179) 2021-02-16 06:14:53 -08:00
jonathanmetzman c8d2319aa8
[test_all] Rewrite in Python (#4769)
Rewrite test_all in python.
Bash is quite annoying to write and test.
One issue with bash is it is even worse than Python for parallelism (which may be causing #4707).
Rewrite test_all in python and optimize base-runner/Dockerfile for fast development.
Also, combine some docker layers.
2020-12-03 12:52:34 -08:00
Catena cyber 181c036c5b
Self-hosts golang scripts for golang coverage (#4698)
* Self-hosts golang scripts for golang coverage

* fixup remove useless readmes

* Update Dockerfile

Co-authored-by: Abhishek Arya <inferno@chromium.org>
2020-11-24 07:37:56 -08:00
Catena cyber 07ea81ba3e
[infra] Add code coverage report generation for Go projects (#3142)
* Golang coverage report

* Enables golang coverage report for gonids and go-dns

* Generates summary for golang coverage reports

* Performance profile for golang projects
2020-11-19 00:14:30 -08:00
Max Moroz 941ada694b
[infra] Add support for custom sanitizer options in run_fuzzer. (#4274)
* [infra] Add support for custom sanitizer options in run_fuzzer.

* address review feedback

* fix presubmit warnings
2020-08-07 12:48:23 -07:00
Oliver Chang 434109ab61
Use dedup_token_length in bisector. (#3764)
Using whether or not the target crashed is not sufficient. There are
numerous cases where the state changes.
2020-05-06 15:30:16 +10:00
Max Moroz f6002f6139
[infra] Collect dataflow traces on the builder (#1632). (#3238)
* [infra] Skeleton of the changes needed for collecting DFT on the builder (#1632).

* move ENGINE_INFO to the helper as well

* make collect_dft +x

* syntax fixes

* add actual dataflow tracer script

* format

* more refactoring and cleanup

* format

* address Oliver's feedback

* format

* more fixes

* format

* do not redirect stderr to stdout

* add exit at the end of main

* address feedback from Oliver
2020-01-17 06:24:15 -08:00
jonathanmetzman 345d49adba
Reland Make bad_build_check more likely to catch hardcoding /out (#3180) (#3205)
This reverts commit 689c3f4b65.
2020-01-08 08:02:45 -08:00
Oliver Chang 84a2de2f84
Bump up rss limit to 2.5GB. (#3201) 2020-01-08 14:50:44 +11:00
jonathanmetzman 689c3f4b65
Revert "Make bad_build_check more likely to catch hardcoding /out (#3180)" (#3197)
Revert so that we don't get two errors in a row.

This reverts commit 14bdd9332c.
2020-01-07 08:23:13 -08:00
jonathanmetzman 14bdd9332c
Make bad_build_check more likely to catch hardcoding /out (#3180) 2020-01-06 10:48:35 -08:00
Max Moroz 66e0e37939
[infra] Install LLVM binaries in base-runner using base-clang artifacts (#3067). (#3072)
* [infra] Install LLVM binaries in base-runner using base-clang artifacts (#3067).

* add one more comment and remove MAINTAINER lines from all images
2019-11-26 10:40:58 -08:00
Oliver Chang b37f841dc5
remove libunwind and libblocksruntime from base-runner. (#3031)
Fixes #2947.
2019-11-13 14:40:25 +11:00
jonathanmetzman c60fcd7247
Add initial support for i386 builds (#2347)
This feature is not yet officially supported
2019-05-13 15:01:25 -07:00
Evgeny Vereshchagin 3740c751fd [infra] base-runner: remove strict_string_check from ASAN_OPTIONS (#1972)
Whether string_string_checks will be turned on or not is
being discussed in https://github.com/google/oss-fuzz/issues/542.
Until it's settled, it'd probably be better to remove the option
from ASAN_OPTIONS altogether so as not to confuse anybody.
2018-11-26 09:57:09 -08:00
Max Moroz 7703e360de
[infra] Remove sancov and rename "profile" to "coverage". (#1839)
* [infra] Remove sancov and rename "profile" to "coverage".

* Bring coverage flags back.

* Update projects files that rely on SANITIZER="profile".
2018-10-01 06:43:21 -07:00
Max Moroz 17a6cfbd40
[infra] Use coverage utils from Chromium and other fixes (follow-up #1547). (#1741)
* [infra] Use coverage utils from Chromium and other fixes (follow-up #1547).

* Sort dependencies in an alpha order plus make more readable.

* Re-order arguments passed to coverage_helper script.

* Rename REPORT_DIR variable and put summary.json into platform specific dir.

* Fix -src-root-dir value.
2018-08-21 14:02:48 -07:00
Max Moroz 80ea4a427a
[infra] Coverage: handle shared libraries via coverage_helper script. (#1727)
* [infra] Coverage: handle shared libraries and provide per directory view.

* Add coverage_helper script for detecting shared libraries.

* Address review feedback.
2018-08-17 15:15:08 -07:00
Max Moroz e1aa07c491
[infra] Add script for downloading a batch of corpus backups (for #1547). (#1713)
* [infra] Add script for downloading a batch of corpus backups (for #1547).

* Add missing wget dependency and replace a tab with spaces.

* Convert more tabs to spaces.
2018-08-15 06:34:10 -07:00
Max Moroz 0fe45f59a7
[infra] Re-enable UIO for UBSan in a non-faulting mode (#910). (#1690) 2018-08-07 10:04:25 -07:00
Oliver Chang 2ef8e32bfa Move targets_list to base-runner. 2018-07-27 14:59:02 +10:00
Oliver Chang 40326f9520 Add libcap2 to base-runner image. 2018-07-09 17:22:15 +10:00
jonathanmetzman 5ea8600f84
Remove test_report since it isn't usable from anywhere (#1569) 2018-06-25 16:59:21 -07:00
Max Moroz 20e55ce3b1
[infra] Enable clange code coverage reports generation for local runs. (#1494)
* [infra] Enable clange code coverage reports generation for local runs.

* Use runner image and move corpus management to the helper.py
.

* Clean up, delete unnecessary stuff, add comments.

* Run fuzz targets in parallel. Do not exit in case of an error.

* Address review feedback, except of the threading thing.

* Fix a typo.

* Use ThreadPool implementatino available in standard python2.7 package.

* Add dry run support + no corpus download option.

* Fix flags handling + add log output in case of an error.

* Append arguments for fuzz target instead of replacing them.

* Remove dry run functionality as it currently errors out after two runs.

* Fix some spacing in the code.

* Update documentation regarding new code coverage script.
2018-06-14 15:00:46 -07:00
jonathanmetzman e06ca92ee4
Install fonts-dejavu on base-runner (#1392)
Install a small (<10MB) font library on base-runner since some fuzzers
(such as image_deserialize_fuzzer) expect them on a system.
2018-05-02 08:33:08 -07:00
Max Moroz 2c23c20d8c
[infra] enable -fsanitize=unsigned-integer-overflow in non-faulting mode (#910). (#927) 2017-10-27 14:13:11 -07:00
Oliver Chang fa41e6a949 Add script for testing sandbox. 2017-10-16 15:54:58 -07:00
Max Moroz 6a6163110a [infra] Add another coverage build using Clang Source-based Code Coverage. (#804)
* [infra] Add another coverage build using Clang Source-based Code Coverage.

* [infra] Remove redundant compile_coverage script.
2017-08-31 13:43:06 -07:00
Max Moroz b1ea461e17 [infra] Add sancov binary to base-runner image in order to perform bad build checks. 2017-08-08 11:40:30 -07:00
Max Moroz f81476ca75 [infra] Add post build checks for catching and reporting bad builds + add test projects. (#754)
* [WIP] Add post build checks for catching and reporting bad builds + test projects.

* Move all type of issues into a single project. Tested all sanitizers.

* First version of the script for performing bad build checks. Still not ready to commit.\

* Added a valid example that should pass all the checks + fixed instrumentation check.

* Use SIGTERM and the handler calling _exit(0) for the startup crash case.

* Small fixes.

* Ignore startup_crash check_for fuzzing engines other than libFuzzer.

* Use "local" for local variables in the script, fix container name.

* Add COPY step for bad_build_check into base-runner Dockerfile.

* Make bad_build_check temporary noop unless EXPERIMENTAL_BAD_BUILD_CHECK is set to 1.

* Temporary remove test binaries step.

* Remove empty line.

* Remove unnecessary env variable.
2017-08-08 10:54:53 -07:00
robertswiecki 268d8052a2 Support honggfuzz as a FUZZING_ENGINE (#636) 2017-06-01 17:55:01 -07:00
Oliver Chang 60835ac420 oss-fuzz/BASE_IMAGE -> oss-fuzz-base/BASE_IMAGE 2017-03-22 12:12:51 -07:00
Oliver Chang 7df64d4ac4 [infra] ossfuzz/IMAGE -> gcr.io/oss-fuzz/IMAGE 2017-03-15 18:46:31 -07:00
Oliver Chang 7ebb132bbd afl: don't set mem limit. 2017-02-22 12:05:29 -08:00