Commit Graph

1392 Commits

Author SHA1 Message Date
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
Caolán McNamara 0f02ca5a56
retry sequentially if multiprocessing do_bad_build_check detects fail… (#5578)
* retry sequentially if multiprocessing do_bad_build_check detects failures

https://github.com/google/oss-fuzz/issues/5441

The error seen in the build log is:

Whoops, the target binary crashed suddenly, before receiving any input
from the fuzzer!

suggesting that the fuzzer crashed before it got to do anything.
Debugging locally what I tend to see is that

a) in src/afl-forkserver.c afl_fsrv_start the read_s32_timed call
returns 0 and that triggers kill(fsrv->fsrv_pid, fsrv->kill_signal);
(SIGKILL)
b) read_s32_timed returns 0 because *stop_soon_p is non-zero at
restart_read:
c) *stop_soon_p becomes non-zero in handle_stop_sig of
src/afl-fuzz-init.c due to receiving SIGINT
d) that SIGINT is sent by the timeout script used in bad_build_check so
it is that "outer" timeout process which is sending SIGINT which then
triggers afl-forkserver's internal SIGKILL to kill the process

I get improved results if I retry the killed off fuzzers sequentially

* Remove unneeded semicolons to fix presubmit

Co-authored-by: Abhishek Arya <inferno@chromium.org>
2021-04-05 12:50:15 -07:00
Stefan Bucur 008c7ec1f5
Switch the cel-cpp project to the new Bazel build script. This reduces the build.sh file to a single line. (#5549) 2021-04-02 20:01:49 -07:00
van Hauser 4afd7f9c55
afl++: add CTX-2 coverage option (#5567) 2021-04-02 07:02:26 -07:00
priyawadhwa 2ef6b816b9
Add config and deploy script for triage party (#5557) 2021-04-02 07:01:09 -07:00
Stefan Bucur 8c1a588bef
Implement the Bazel building recipe as a stand-alone script that can be invoked from build.sh. (#5548) 2021-03-31 19:45:00 +00:00
jonathanmetzman 4cc3aa6343
[CIFuzz] Print crash stacktraces no matter what (#5474)
Even if we don't want to report them, print the stacktrace.
Related: https://github.com/google/oss-fuzz/issues/5461
2021-03-31 06:55:30 -07:00
dependabot[bot] 54f0985f8e
Bump pyyaml from 5.2 to 5.4 in /infra/build/functions (#5512)
Bumps [pyyaml](https://github.com/yaml/pyyaml) from 5.2 to 5.4.
- [Release notes](https://github.com/yaml/pyyaml/releases)
- [Changelog](https://github.com/yaml/pyyaml/blob/master/CHANGES)
- [Commits](https://github.com/yaml/pyyaml/compare/5.2...5.4)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-25 20:44:10 -07:00
dependabot[bot] 2ee9dae19f
Bump pyyaml from 5.3.1 to 5.4 in /infra/ci (#5511)
Bumps [pyyaml](https://github.com/yaml/pyyaml) from 5.3.1 to 5.4.
- [Release notes](https://github.com/yaml/pyyaml/releases)
- [Changelog](https://github.com/yaml/pyyaml/blob/master/CHANGES)
- [Commits](https://github.com/yaml/pyyaml/compare/5.3.1...5.4)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-25 20:43:57 -07:00
Oliver Chang 1ee46825bf
build_specified_commit: Add call to fetch_all_remotes on cleanup. (#5485)
We need to redo fetch_all_remotes as we re-copy the repo from the docker
container.
2021-03-24 08:59:33 +11:00
jonathanmetzman 8539aadb65
[CIFuzz] Fix repo detection for repos downloaded through "go get". (#5481)
Superseeds: #5463
Fixes: #3670
2021-03-23 11:01:02 -07:00
jonathanmetzman 00ad715801
[CIFuzz] Make it possible to skip bad build check. (#5475)
This will mainly be useful for non-OSS-Fuzz users.
Though it can also be used by OSS-Fuzz users to speed things
up (very slightly in most cases).
Fixes #4377
2021-03-23 09:22:53 -07:00
jonathanmetzman 6de9a3b187
[helper] Fix handling of gsutil's 2FA (#5482)
gsutil recently started asking daily for a security key jiggle for accounts
using it. This means if we don't print stderr in real time, users won't see
why a corpus isn't downloading and helper will hang until 2FA request times out.
2021-03-23 09:14:48 -07:00
Oliver Chang e8646d25ec
Fix bisection when the original checkout is for a single branch. (#5478)
Repos cloned with `--branch BRANCH` will only track that branch, even
when we unshallow. If we provide a git SHA from another branch, it will
not be recognized.

To fix, this, we update the remote tracking config and fetch them.

For google/osv#88.
2021-03-23 14:17:37 +11:00
jonathanmetzman e34a03385f
Delete unneeded files from cargo-fuzz install (100MB) (#5436) 2021-03-22 12:29:23 -07:00
jonathanmetzman 8a67befa1c
[infra/helper.py] Unittest shell base-runner-debug (#5470)
Make sure shell-base-runner-debug works.
2021-03-22 10:39:27 -07:00
Fabian Meumertzheim 6ca344a446
Generate badges for projects without coverage (#5459)
Generate badges also for projects with no coverage builds at all (e.g.
JVM and Python projects). For these projects, the badge only has the two
possible states "build passing" and "build failing".
2021-03-21 18:52:02 -07:00
jonathanmetzman 0fba276516
[NFC][base-builder] Fix order so comment is in right place (#5445) 2021-03-21 07:02:30 -07:00
jonathanmetzman 5792e5c529
[NFC][CIFuzz] Rename test_files to test_data and delete unneeded testcases directory (#5448) 2021-03-19 11:49:38 -07:00
van Hauser 2b4af8f24a
[AFL++] llvm 13 fix (#5454) 2021-03-19 18:45:54 +00:00
jonathanmetzman cb083cb365
[base-builder] Fix temp dir deletion for atheris (#5434)
Add back /tmp dir deletion that was accidentally removed before #5344 was committed.
2021-03-19 08:36:14 -07:00
Catena cyber 58d5848b0f
Fix typo in path equilavence for golang coverage (#5444) 2021-03-19 06:34:21 -07:00
van Hauser df6dc548a9
remove map size for afl++ (#5433)
* 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

Co-authored-by: jonathanmetzman <31354670+jonathanmetzman@users.noreply.github.com>
2021-03-18 14:49:58 +00:00
jonathanmetzman ccea7f4ad9
[base-clang] Reduce base-clang size by deleting unneeded binaries+libraries (#5282)
Delete unneeded LLVM tools, clang libraries and testing tools.

This reduces the image size from 1.71 GB to 901 MB.
It may be possible to improve on this by deleting some LLVM
libraries though I don't know which ones we should delete
because AFL++ might use some).

Related https://github.com/google/oss-fuzz/issues/5170
2021-03-18 06:38:46 -07:00
jonathanmetzman 62fce2a587
[CIFuzz] Give testcases unique names. (#5424) 2021-03-17 10:21:49 -07:00
Catena cyber 8b15e28751
Go coverage : use gofuzz tag by default (#5425)
as is done by gofuzz build
2021-03-17 07:42:12 -07:00
Catena cyber e71e49d721
Golang coverage summary updated to version 2.0.1 (#5346) 2021-03-17 06:53:19 -07:00
van Hauser a1135d001e
update afl++ commit id (#5402)
* 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

Co-authored-by: jonathanmetzman <31354670+jonathanmetzman@users.noreply.github.com>
2021-03-16 20:05:21 +00:00
Catena cyber 5c174c7e36
Golang coverage: use absolute paths (#5407) 2021-03-16 12:19:02 -07:00
jonathanmetzman 5ca736fe00
[CIFuzz] Fix issue deleting corpus (#5391)
Sometimes deleting the corpus in free_disk_if_needed exceptions.
Pass ignore_errors=True to fix this.
Related: #5383
2021-03-15 16:20:13 +00:00
Catena cyber 92cea13c5d
Rust coverage : do not trigger debug assertions (#5385) 2021-03-14 15:53:16 -07:00
Catena cyber b000f70a7a
Golang coverage: build binary instead of bash script (#5377) 2021-03-14 08:29:13 -07:00
Catena cyber be203e38a5
More generic target directory for rust coverage (#5366)
* More generic target directory for rust coverage

* Rust coverage cargo does not change PATH
2021-03-12 08:52:54 -08:00
jonathanmetzman 3465403f30
[CIFuzz] Add functionality to save diskspace (#5342)
* [CIFuzz] Add functionality to save diskspace.

Add a LOW_DISK_SPACE env/config var. When this is specified
(always true for Github actions) run_fuzzers will delete
base-builder and the project builder image before fuzzing.
After it finishes fuzzing with a target, it will also
delete the targets, its seed corpus and its corpus.

Related: #4879
2021-03-12 07:27:07 -08:00
Abhishek Arya 53e9531551
Don't rpath patch llvm-symbolizer. (#5357)
Should fix https://github.com/google/oss-fuzz/issues/5349
2021-03-10 12:24:57 -08: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 0475bfa16a
[base-builder] Remove unnecessary python files (58 MB) (#5348)
Related: #5170
2021-03-09 18:30:31 -08:00
Catena cyber 632f5ec0cb
Rust coverage : source remap after changing dir (#5345) 2021-03-09 20:57:46 +00:00
jonathanmetzman 1233505600
[base-builder] Delete unneeded files from atheris install (#5344) 2021-03-09 12:08:09 -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