oss-fuzz/infra/base-images/base-libfuzzer
Mike Aizatsky 6e41f2f824 [infra] hg sourcemap 2016-10-20 14:31:20 -07:00
..
Dockerfile [infra] revisions->srcmap cleanup 2016-10-20 13:15:28 -07:00
README.md [infra] test command 2016-10-20 00:44:35 -07:00
compile [infra] revisions->srcmap cleanup 2016-10-20 13:15:28 -07:00
run [infra] checking out library sources in the image (#40) 2016-10-18 15:37:23 -07:00
srcmap [infra] hg sourcemap 2016-10-20 14:31:20 -07:00
test [infra] fail test if there are zero fuzzers 2016-10-20 14:14:15 -07:00

README.md

base-libfuzzer

Abstract base image for libfuzzer builders.

Supported commands:

  • docker run -ti <image_name> [compile] - builds fuzzers.
  • docker run -ti <image_name> run <fuzzer_name> <fuzzer_options...> - build fuzzers and start specified one with given options.
  • docker run -ti <image_name> test - builds fuzzers and runs each for a little while to verify it is working correctly.
  • docker run -ti <image_name> /bin/bash - drop into shell. Run compile script to start build.

Image Files Layout

Location Description
/out/ build artifacts should be copied here
/src/ place to checkout source files
/work/ used to store intermediate files
/usr/lib/libfuzzer.a libfuzzer static library

Provided Environment Variables

You must use special compiler flags to build your library and fuzzers. 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.
$FUZZER_LDFLAGS Linker flags for fuzzer binaries.

Many well-crafted build scripts will automatically use these variables. If not, passing them manually to a build tool might be required.

Child Image Interface

Sources

Child image has to checkout all sources it needs to compile fuzzers 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_library:/src/my_library ....

Other Required Files

Following files have to be added by child images:

File Location Description
/src/build.sh build script to build the library and its fuzzers