Commit Graph

1432 Commits

Author SHA1 Message Date
jonathanmetzman c779501392
[CIFuzz] Implement filestore based on github artifacts (#5943)
Implement filestore based on github actions' artifacts feature.
This uses the github api and the github actions API.
Also fix imports in github_actions_toolkit library that were broken by move to third_party directory.
2021-06-21 15:28:21 +00:00
MarcoFalke aed20a9b62
ci: Fix get_changed_files_output (#5944)
* ci: Fix get_changed_files_output

* Update project_tests.yml

* ci: Fix presubmit checks

* ci: Use fetch-depth:0 instead of --unshallow
2021-06-21 07:14:41 -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
Fabian Meumertzheim 1eb1f23711
[infra][jvm] Provide jazzer_driver_with_sanitizer for coverage builds (#5948)
Previously, JVM coverage builds for projects with native dependencies would fail: https://oss-fuzz-build-logs.storage.googleapis.com/log-9b66fe39-7e33-4058-812a-c9c52f32e0ea.txt
2021-06-19 10:59:46 -07:00
jonathanmetzman de0cec2514
[CIFuzz] Improve fuzz_target.py (#5929)
* [CIFuzz] Clean up fuzz_target.py
1. Use CORPUS_DIR env var to set corpus so that corpus can be saved.
2. Clean up is_crash_novel.

* fix

* consistency

* improve logging messages, remove over-cautious check

* fix tests

* fix tests

* Make sure corpus path is mapped
2021-06-18 10:26:36 -07:00
jonathanmetzman ec492dd9e0
[CIFuzz][NFC] Put integration test decorator on class instead of test methods (#5936) 2021-06-18 04:59:01 -07:00
jonathanmetzman 1876845050
[CIFuzz] Add python port of github's actions/toolkit nodejs library (#5932) 2021-06-18 04:57:44 -07:00
jonathanmetzman 26dea63cde
[CIFuzz][NFC] Replace format strings with f-strings. (#5933)
Also replace % formatting.
2021-06-17 11:26:42 -07:00
jonathanmetzman 624a294bff
[CIFuzz] Allow run_fuzzers to use a preexisting corpus. (#5928)
* [CIFuzz] Allow run_fuzzers to use a preexisting corpus.

Also improve comment in cifuzz-base/Dockerfile.

* improve comment

* Fix run_fuzzers
Add --cache option to helper.py's build_image command which
uses the docker image cache when building and use this in
ci/build.py.
Change build_image_impl's argument no_cache to cache for clarity.
Eliminate default argument cache in build_fuzzers_impl since no users
use it.
2021-06-17 08:32:20 -07:00
jonathanmetzman 0034bfde5d
[CIFuzz] Refactor HTTP code and use a newer python. (#5842)
* Move to http_utils

* Update dockerfiles

* Dont install python3 from apt if we copy it into image

* fix

* fmt

* Add missing
2021-06-14 09:26:04 -07:00
van Hauser 6ca95a1817
enhance afl++ performance (#5916) 2021-06-14 07:37:20 -07:00
Fabian Meumertzheim 7c4739add9
[infra][base-builder] Clarify error messages in `compile` (#5912)
@jonathanmetzman
2021-06-11 07:53:28 -07:00
Fabian Meumertzheim 73d78b8879
[infra][jvm] Add Jazzer UBSan support (#5898)
* [infra][jvm] Add Jazzer UBSan support

* [java-example] Reenable and plant UB

* [docs] Mention support for Java UBSan in docs

Also adds a link to the java-example build.sh to the docs.
2021-06-10 07:57:42 -07:00
Catena cyber 26b9dd9828
go: compiles projects without go.mod from their directory (#5878) 2021-06-05 16:50:38 -07:00
Evgeny Vereshchagin 1f49a51ce2
infra: show RUSTFLAGS as well (#5867)
It should make it easier to see where all the rustc flags
come from. RUSTFLAGS along with `cargo fuzz build --verbose` should
help to track down weird issues like https://github.com/google/oss-fuzz/pull/5865#issuecomment-852685588

It's a follow-up to ecf3d384fb
2021-06-02 11:51:26 -07:00
Fabian Meumertzheim 770d590e13
[infra][jvm] Don't override jvm_args in coverage builds (#5862)
Specify --additional_jvm_args instead of --jvm_args so that custom
target JVM args (e.g. --enable-preview) are preserved in coverage runs.
2021-06-01 08:03:10 -07:00
jonathanmetzman dc6c44e2da
[CIFuzz][fuzz_target] Prepare for ClusterFuzzLite (#5845)
Return the path to the corpus in FuzzResult.
Also, refactor is_reportable: move code testing crash novelty
into its own method.
2021-05-26 17:09:21 +00:00
jonathanmetzman 8c4ad095e9
[CIFuzz] Refactor in preparation for filestore (#5841)
1. Moving the _create_config and create_config functions from build_fuzzers_test.py and run_fuzzers_test.py into test_helpers.py (which is now part of cifuzz instead of infra) and share code between them.
2. Rename artifacts_dir to crashes_dir in run_fuzzers.py. "artifacts" is ambiguous.
3. Make some small changes to pytest.ini to improve debugging.
2021-05-26 09:45:22 -07:00
jonathanmetzman 8d313798ab
[CIFuzz][NFC] Add skeleton for ClusterFuzzLite and Filestore (#5843) 2021-05-26 09:14:23 -07:00
jonathanmetzman 9648a6ebf4
[presubmit] Add option to skip slow build tests. (#5844) 2021-05-25 21:44:24 -07:00
Evgeny Vereshchagin ff25180bd7
infra: stop patching llvm-symbolizer (#5839)
* infra: stop patching llvm-symbolizer

to prevent it from failing to start up with
```
NEW_FUNC[1/1]: llvm-symbolizer: symbol lookup error: /tmp/not-out/instrumented_libraries/lib/x86_64-linux-gnu/libz.so.1: undefined symbol: __msan_va_arg_overflow_size_tls
==45==WARNING: external symbolizer didn't start up correctly!
```

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

* infra: reformat patch_build.py with yapf

to make the presubmit check happy
2021-05-25 23:06:59 +00:00
jonathanmetzman e146f71833
[presubmit] Add check to ensure dataflow is specified properly. (#5833)
Also remove dataflow from projects where it was removed improperly
or added improperly.
2021-05-25 16:02:44 +00:00
Fabian Meumertzheim 6defe8c725
[infra] File-level coverage for JVM projects (#5822)
* Exclude Jazzer classes from coverage reports

* Generate file-level coverage data for Java

Adds per-file coverage information to llvm-cov style *.json files for
Java targets.

This provides full CI Fuzz support for "jvm" projects.
2021-05-25 08:05:16 -07:00
Mohammed Al Sahaf f43928cf47
[infra] fix handling Go's SIV in coverage santizer (#5813) 2021-05-25 07:52:11 -07:00
jonathanmetzman d8b0c77eae
[CIFuzz] Support non-github action CI for external projects (#5824)
This is incomplete for a few reasons.
1. It probably can't diff properly.
2. It assumes the project source should be put in /src/$PROJECT_NAME.
2021-05-24 21:22:01 +00:00
van Hauser 878a05a092
afl++: increase forkserver timeout (#5784) 2021-05-24 13:43:34 -07:00
Fabian Meumertzheim f053e761ec
[infra] Allow shell script targets for all languages (#5802)
For proper support of Bazel's runfiles tree, a shell script wrapper is
also needed for C++ targets, see
https://github.com/bazelbuild/rules_fuzzing/pull/149.

This commit allows shell script fuzz targets for all languages. This
also helps to consolidate the various fuzz target checks in OSS-Fuzz
by removing a dependence on fuzzing_language.
2021-05-24 09:16:32 -07:00
Fabian Meumertzheim cbc4293c37
[infra] Make mount location configurable in build_fuzzers (#5744)
Exposing the mount location for local sources to a command-line
argument makes it possible to reproduce findings with local source
even for umbrella projects with WORKDIR $SRC/.
2021-05-18 09:15:14 -07:00
Catena cyber 7004ced0d3
Right copy for rust std lib for coverage (#5791) 2021-05-17 18:55:53 +00:00
Fabian Meumertzheim f08e98d176
[infra][jvm] Create per-target summary.json (#5778) 2021-05-17 07:25:10 -07:00
Catena cyber beee192ed3
Rust coverage: copy stdlib to the referenced directory (#5776)
using rustc commit-hash version
2021-05-16 14:32:33 -07:00
Fabian Meumertzheim 88f76bc641
[infra] Make `targets_list` detect JVM/Python targets (#5775)
* [infra] Make `targets_list` detect JVM/Python targets

`targets_list` should not detect `jazzer_driver` and `jazzer_driver_asan` as fuzz targets, but should consider shell scripts that contain `LLVMFuzzerTestOneInput`.

@inferno-chromium This should fix https://github.com/google/oss-fuzz/pull/5770#issuecomment-841851786.

* Fix
2021-05-16 18:37:55 +00:00
Fabian Meumertzheim fee51cc181
[infra] Run JVM coverage builds (#5770) 2021-05-14 17:07:48 -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 a1b558719b
[infra] Verify JVM coverage builds in the CI (#5752) 2021-05-12 14:57:26 +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 124db941a7
[infra] Fix java coverage (#5747)
* Filter non-fuzz target binaries in coverage script

* Filter non-fuzz target binaries in helper.py

* Fix fuzz target executable bit check in helper.py

Python and JVM fuzz target executables created via the docs template
set the exectuable via `chmod u+x` as the root user, which means that
os.access checks in infra/helper.py don't see the exectuable bit if
not run as root locally.

With this commit, the check now looks for any of the three exectuable
bits.
2021-05-11 10:10:54 -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
jonathanmetzman 033a858be0
[infra] Set OSS_FUZZ_CI=1 in CI so build scripts can know (#5731)
This will help bitcoin use CI to verify the build works, because
the last step is trivial (so testing not really needed) but will
fill up the disk.
2021-05-07 07:46:11 -07:00
van Hauser e31055e486
fix afl++ for pie targets (#5691)
* output afl++ setup

* update commit id

* update afl++ commit id

* asan + cmplog fix

* update commit id

* update and enhance afl++

* update afl++ commit id, better run asan options

* fix linter

* add debug_afl script

* Update debug_afl

* Update compile_afl

* fix for karchive

* put debug_afl in the docker container

* asan poison fix

* fix asan settings for zeek

* update afl++ commit id

* fix

* update afl++ commit id

* final touches

* remove map size

* remove old comment

* llvm 13 fix

* enhance documentation

* fix capstone build.sh

* update doc

* add afl++ ctx-2 coverage option

* set to 30% chance for ctx-2

* fix afl++ pie targets

* gracefuly fail for qemu hook

Co-authored-by: jonathanmetzman <31354670+jonathanmetzman@users.noreply.github.com>
2021-04-30 07:51:40 -07:00
jonathanmetzman d7fe9935e6
Revert "[CIFuzz] End fuzzing docker processes properly (#5473)" (#5651)
* Revert "[CIFuzz] End fuzzing docker processes properly (#5473)"

This reverts commit c9b3d057b0.
This commit causes CIFuzz to hang.
2021-04-21 18:11:01 +00:00
jonathanmetzman ffe4f892b1
[helper] Fix build_image --pull and refactor (#5642)
Fix behavior of build_image --pull (Fixes #5640)

Also refactor helper.py:

1. Change behavior of functions so that most return True on success and False on failure.
2. Only main will return 1 on failure and 0 on success now. Previous behavior was very error prone.
3. Rename _get_output_dir to _get_out_dir.
4. Make function docstrings use descriptive tense.
5. Make helper.py print help when no argument is specified.
2021-04-21 14:28:26 +00: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
jonathanmetzman 1e612a61b3
[CIFuzz] Ensure we don't through exception if we can't stop container (#5622)
It's probably fine to run another one, so just do that.
Also increase the amount of time we will wait to 5 seconds.
Fixes https://github.com/google/oss-fuzz/issues/5621
2021-04-15 16:58:39 +00:00
Abhishek Arya 53a97ef111
build_image with pull should pull all images. (#5620)
* build_image with pull should pull all images.

right now, build_image with pull only pulled the build image,
and not the runner image. this led to
https://github.com/google/oss-fuzz/issues/5480
so, pull all images to match pull_images functionality.

* address review comment.
2021-04-15 03:27:56 +00:00
Catena cyber 446d59e6e9
Adds swift-protobuf project (#5493)
* Adds swift-protobuf project

* Support swift language

* Fuzz target improvements

* No test for fuzz package

* fixup comments

* rename to binary

* symbolizer
2021-04-13 13:59:07 +10:00
asraa 1b9366c1be
[CIFuzz] fix bug (#5602)
Signed-off-by: Asra Ali <asraa@google.com>
2021-04-12 17:19:54 +00:00
jonathanmetzman c9b3d057b0
[CIFuzz] End fuzzing docker processes properly (#5473)
They only right way to do this properly seems to be using docker's container id file with docker stop.
Fixes #5423
2021-04-12 08:04:35 -07:00
Abhishek Arya 33ae18cc44
Enable generated dict in AFL++ (#5591)
This was accidently disabled.
2021-04-09 08:16:07 +10:00
priyawadhwa 18a05fce3d
Store triage party image in oss-fuzz-base repo (#5584) 2021-04-07 11:11:52 +10:00