From 42959c5fd682a859daae648f2a7a63869d4396c0 Mon Sep 17 00:00:00 2001 From: Mike Aizatsky Date: Thu, 13 Oct 2016 08:24:56 -0700 Subject: [PATCH] Update new_library.md --- docs/new_library.md | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/docs/new_library.md b/docs/new_library.md index 7325c8abe..ee665a766 100644 --- a/docs/new_library.md +++ b/docs/new_library.md @@ -131,29 +131,33 @@ These flags are provided in following environment variables: Many well-crafted build scripts will automatically use these variables. If not, passing them manually to a build tool might be required. +### Custom libFuzzer options for ClusterFuzz -### Dictionaries and custom libfuzzer options +By default ClusterFuzz will run your fuzzier without any options. You can specify +options by creating a `fuzzer_name.options` file next to a fuzzier in `/out`: -Any top-level files in the library directory ending with the extension ".dict" -or ".options" will be picked up by ClusterFuzz. Files ending with ".dict" are -assumed to be libFuzzer-compatible [dictionaries], and .options files have the -format: +``` +[linfuzzer] +max_len = 1024 +``` + +[Available options](http://llvm.org/docs/LibFuzzer.html#options) + +For out of tree fuzzes You will commonly add options file using docker's +`COPY` directive and will copy it into output in build script. + +### Dictionaries + +Dictionaries hugely improve fuzzer effectiveness for inputs with lots of similar +sequences of bytes. [libFuzzer documentation](http://llvm.org/docs/LibFuzzer.html#dictionaries) + +Put your dict files in `/out` and specify them in .options file: ``` [libfuzzer] dict = dictionary_name.dict -max_len = 9001 ``` -This means that `-dict=/path/to/dictionary_name.dict` and `-max_len=9001` will -be passed to the fuzzer when it's run. - -### Others (e.g. fuzzer source) - -For some libraries, the upstream repository will contain fuzzers (e.g. -freetype2). In other cases, such as expat, we can check in fuzzer source into -the oss-fuzz repo. - ## Jenkinsfile This file will be largely the same for most libraries, and is used by our build