Commit Graph

660 Commits

Author SHA1 Message Date
Abhishek Arya 33ae18cc44
Enable generated dict in AFL++ (#5591)
This was accidently disabled.
2021-04-09 08:16:07 +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
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 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 e34a03385f
Delete unneeded files from cargo-fuzz install (100MB) (#5436) 2021-03-22 12:29:23 -07:00
jonathanmetzman 0fba276516
[NFC][base-builder] Fix order so comment is in right place (#5445) 2021-03-21 07:02:30 -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
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
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
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
Catena cyber fb8b2e25bf
Golang coverage ok with package in $SRC (#5325) 2021-03-09 06:07:33 -08:00
van Hauser 498b771b72
fix afl++ asan options (#5336) 2021-03-09 06:05:13 -08: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
van Hauser 6f19531812
add asan poison check to afl++ cmplog (#5311)
* 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

Co-authored-by: jonathanmetzman <31354670+jonathanmetzman@users.noreply.github.com>
2021-03-06 07:02:29 -08:00
van Hauser 7bd9da63c8
fix karchive build for afl++ (#5305)
* 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

Co-authored-by: jonathanmetzman <31354670+jonathanmetzman@users.noreply.github.com>
2021-03-05 07:10:34 -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
van Hauser c243108b6a
update afl++ commit id plus add afl++ debug script (#5297) 2021-03-04 14:19:53 +00:00
jonathanmetzman db02d9252e
[AFL++][base-builder] Precompile afl++ (#5290)
Precompile AFL like we already do for honggfuzz.
This saves about a minute in compilation time of AFL targets by doing it in base-builder
It only adds about 30 MB to the image size.
2021-03-03 19:10:35 -08:00
jonathanmetzman 2cc07015ef
[base-clang] Reduce build time by ~65% (#5280)
Reduce build time by doing the following:
1. Building the second stage clang build with a clang binary we download
from chromium.
2. Changing NPROC to be half of the cores instead of assuming it's 16
cores. This still addresses the OOM when building on GCB but speeds up
local building.
3. Don't install recommended packages and use --depth 1 when possible
(very minor improvements compared to the above).

In all this reduces local build time of base-clang from 32 minutes
to 11 minutes.

Because build times are reduced, it will be easier to
iteratively develop changes needed for #5170
2021-03-03 14:57:29 -08:00
jonathanmetzman f5901265d1
[TSAN] Support TSAN (#5266)
We aren't planning on suppoting TSAN on ClusterFuzz.
But we can support in CIFuzz since Skia wants it.
2021-03-02 09:20:40 -08:00
van Hauser fee28b9695
update afl++ commit id (#5273)
* output afl++ setup

* update commit id

* update afl++ commit id

* asan + cmplog fix

* update commit id
2021-03-02 08:25:29 -08:00
van Hauser a6f244e9c5
afl++ commit id update (#5271)
* output afl++ setup

* update commit id

* update afl++ commit id

* asan + cmplog fix
2021-03-01 18:38:31 -08:00
van Hauser 697c0480dd
afl++ commit id update (#5258)
* output afl++ setup

* update commit id

* update afl++ commit id
2021-02-26 07:24:46 -08:00
jonathanmetzman f939fcfa6f
[base-builder] Use builtin libFuzzer instead of recompling. (#4682)
Instead of recompiling libFuzzer each time we do a libFuzzer
build of a project, always use Clang's builtin version of libFuzzer.
Do this by copying the builtin libFuzzer to /usr/local/lib/FuzzingEngine.a.
This means that the projects that aren't using -fsanitize=fuzzer now also
use the builtin libFuzzer. And we no longer need to compile a sanitized
libFuzzer for them.

This change improves fuzzing performance and developer experience.
1. It improves developer experience by saving time spent compiling libFuzzer
when recompiling fuzzers.
The time saved is about 25 seconds on my machine.
This will make iterating on fuzzer integration much easier.
2. It improves fuzzer performance. The builtin libFuzzer isn't sanitized so it is faster.
In some cases (see [here](https://bugs.chromium.org/p/chromium/issues/detail?id=934639))
sanitized libFuzzers can waste 37% of the time running non-performant implementations
of code that the builtin-libFuzzer can do almost instantaneously (assembly vs C code).

The consequences of improving developer experience and 
fuzzer performance aren't so easy to measure (though 
we will look for perf consequences on ClusterFuzz).

But some of the consequences of saving time compiling libFuzzer 
are easy to figure out and quite important. They are:
1. Saving $14646 a year on build costs. Based on the following:
build time saved (on GCB): ~38 seconds
libFuzzer builds per day: 990
builds per year: >365
price per build-minute (32 core instance, https://cloud.google.com/build/pricing): 0.064
38/60*.064*990*365 = 14,646

2. Speeding up infra-tests.
Many of the integration tests build fuzzers and so building libFuzzer 
was a considerable bottleneck.
On my many-core machine the savings were good and noticeable 
(and are probably larger on the less performant CI machines).

|                            | With compiling libfuzzer | Without compiling libfuzzer |
| ---------------------- | ------------------------------- | ----------------------------------- |
| Parallel tests       | 45                                  | 34                                       | 
| Sequential tests  | 276                                | 190                                     | 

3. Speeding up CIFuzz.
CIFuzz needs to be fast but it spends about 40 seconds compiling libFuzzer.
In a run where no bugs are discovered which is intended to take about 20 minutes
compiling libFuzzer takes about 3% of the time (40/(20*60)*100).
Now we don't need to waste that time.
See https://github.com/google/oss-fuzz/issues/5180, which this partially fixes.

This bug fixes https://github.com/google/oss-fuzz/issues/2312 and  https://github.com/google/oss-fuzz/issues/4677.
2021-02-24 11:36:03 -08:00
Catena cyber e14bf4735a
Go 1.16 local builds (#5241)
* Makes vitess build local

As it uses vitess.io instead of github

* Completes minify project

* Completes quic-go

* Local build for nats project

* Completes ipfs

* run go mod tidy after adding go module

* Right bash sequence for go mod tidy
2021-02-23 07:35:32 -08:00
Catena cyber 1e03eb94af
Go 1.16 more fixes (#5239)
* Fixes cilium build

* Fixes dragonfly build

* Fixes fasthttp build

* Fixes fastjson build

* golang build: change directory only temporary

* Fixes gitea build

* Fixes grpc-gateway build

* Fixes hugo project build

* Fixes ipfs build

* Fixes jsonparser build

* Fixes kubernetes build

* Fixes loki build

* Fixes minify build

* Fixes nats build

* Removes go get from the docs

* Fixes quic-go build

* Fixes radon build

* Fixes syzkaller build

* Fixes tidb build

* Fixes vitess build
2021-02-22 15:25:47 -08:00
Catena cyber 90164f397e
Fixes go coverage build with go 1.16 (#5237) 2021-02-22 09:06:53 -08:00
van Hauser b5de0307a7
Fixes for afl++ (#5235)
* output afl++ setup

* update commit id
2021-02-22 07:41:49 -08:00
DavidKorczynski ab55c8eeef
infra: update the timeout of AFL (#5223)
* Updated the timeout for AFL.

* Updated the AFL timeout.
2021-02-21 16:06:29 -08:00
Catena cyber 60e9a661f9
Go 1.16 build fix with right parentheses (#5228)
* go: right bash condition for changing directory

* go-json-iterator: uses git clone

So as to copy fuzz target in right directory

* go: uses tags when running go list

* go-redis: uses git clone and builds local fuzz target

* cascadia: uses git clone instead of go get
2021-02-21 07:40:36 -08:00
Catena cyber 18500c17d7
golang: compatibility with go 1.16 modules (#5221) 2021-02-19 10:03:22 -08:00