oss-fuzz/infra/base-images/base-builder
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
..
test_data
Dockerfile add asan poison check to afl++ cmplog (#5311) 2021-03-06 07:02:29 -08:00
README.md [infra] Dummy change in the base-builder to test something. 2020-02-06 11:11:24 -08:00
bisect_clang.py Replace terms that are uninclusive. (#5045) 2021-01-25 08:41:34 -08:00
bisect_clang_test.py Lint everything (and test everything too? 2021-01-20 13:25:56 -08:00
compile [jazzer] Adapt infra scripting to JVM fuzz targets (#5176) 2021-02-16 07:06:58 -08:00
compile_afl update afl++ commit id plus add afl++ debug script (#5297) 2021-03-04 14:19:53 +00:00
compile_dataflow [infra] Fix dataflow engine compilation for a speed up (#1632). (#3219) 2020-01-12 11:43:03 -08:00
compile_go_fuzzer Go 1.16 local builds (#5241) 2021-02-23 07:35:32 -08:00
compile_honggfuzz [AFL++][base-builder] Precompile afl++ (#5290) 2021-03-03 19:10:35 -08:00
compile_libfuzzer [base-builder] Use builtin libFuzzer instead of recompling. (#4682) 2021-02-24 11:36:03 -08:00
debug_afl add asan poison check to afl++ cmplog (#5311) 2021-03-06 07:02:29 -08:00
detect_repo.py [CIFuzz] Go support (#3352) 2020-02-06 15:35:42 -08:00
detect_repo_test.py [infra] Mark more tests as integration (#4869) 2020-12-18 10:44:12 -08:00
ossfuzz_coverage_runner.go [infra] Add code coverage report generation for Go projects (#3142) 2020-11-19 00:14:30 -08:00
precompile_afl [AFL++][base-builder] Precompile afl++ (#5290) 2021-03-03 19:10:35 -08:00
precompile_honggfuzz [AFL++][base-builder] Precompile afl++ (#5290) 2021-03-03 19:10:35 -08:00
srcmap [infra] Improve srcmap support for Go projects (#3355, #2714). (#3664) 2020-04-16 22:44:01 -07:00
write_labels.py add license 2021-01-20 13:31:16 -08:00

README.md

base-builder

Abstract base image for project builders.

Every project image supports multiple commands that can be invoked through docker after the image is built:

docker run --rm -ti gcr.io/oss-fuzz/$project <command> <arguments...>

Supported Commands

Command Description
compile (default) build all fuzz targets
/bin/bash drop into shell, execute compile script to start build.

Build Configuration

A single build image can build same set of fuzzers in many configurations. The configuration is picked through one or more environment variables.

Env Variable Description
$SANITIZER ("address") Specifies predefined sanitizer configuration to use. address or memory or undefined.
$SANITIZER_FLAGS Specify compiler sanitizer flags directly. Overrides $SANITIZER.
$COVERAGE_FLAGS Specify compiler flags to use for fuzzer feedback coverage.
$BUILD_UID User id to use while building fuzzers.

Examples

  • building sqlite3 fuzzer with UBSan (SANITIZER=undefined):
docker run --rm -ti -e SANITIZER=undefined gcr.io/oss-fuzz/sqlite3

Image Files Layout

Location Env Description
/out/ $OUT Directory to store build artifacts (fuzz targets, dictionaries, options files, seed corpus archives).
/src/ $SRC Directory to checkout source files
/work/ $WORK Directory for storing intermediate files
/usr/lib/libFuzzingEngine.a $LIB_FUZZING_ENGINE Location of prebuilt fuzzing engine library (e.g. libFuzzer) that needs to be linked with all fuzz targets.

While files layout is fixed within a container, the environment variables are provided to be able to write retargetable scripts.

Compiler Flags

You must use special compiler flags to build your project and fuzz targets. These flags are provided in following environment variables:

Env Variable Description
$CC The C compiler binary.
$CXX, $CCC The C++ compiler binary.
$CFLAGS C compiler flags.
$CXXFLAGS C++ compiler flags.

Most well-crafted build scripts will automatically use these variables. If not, pass them manually to the build tool.

Child Image Interface

Sources

Child image has to checkout all sources that it needs to compile fuzz targets into $SRC directory. When the image is executed, a directory could be mounted on top of these with local checkouts using docker run -v $HOME/my_project:/src/my_project ....

Other Required Files

Following files have to be added by child images:

File Location Description
$SRC/build.sh build script to build the project and its fuzz targets